[vlc-commits] Qt: fix loop-button icon on notification of change

Filip Roséen git at videolan.org
Tue May 31 14:45:12 CEST 2016


vlc | branch: master | Filip Roséen <filip at videolabs.io> | Mon May 30 18:18:06 2016 +0200| [45be534e9213fdad471af8a896e003f78f41865b] | committer: Jean-Baptiste Kempf

Qt: fix loop-button icon on notification of change

Given that NORMAL=0, REPEAT_ALL=1, REPEAT_ONE=2, the previous code would
not yield a value that actually corresponds to the correct icon when we
receive notification of "loop mode change".

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=45be534e9213fdad471af8a896e003f78f41865b
---

 modules/gui/qt/input_manager.cpp |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/modules/gui/qt/input_manager.cpp b/modules/gui/qt/input_manager.cpp
index 6847969..aa9402d 100644
--- a/modules/gui/qt/input_manager.cpp
+++ b/modules/gui/qt/input_manager.cpp
@@ -1131,10 +1131,12 @@ void MainInputManager::notifyRandom(bool value)
 
 void MainInputManager::notifyRepeatLoop(bool)
 {
-    int i_value = var_GetBool( THEPL, "loop" ) * REPEAT_ALL
-              + var_GetBool( THEPL, "repeat" ) * REPEAT_ONE;
+    int i_state = NORMAL;
 
-    emit repeatLoopChanged( i_value );
+    if( var_GetBool( THEPL, "loop" ) )   i_state = REPEAT_ALL;
+    if( var_GetBool( THEPL, "repeat" ) ) i_state = REPEAT_ONE;
+
+    emit repeatLoopChanged( i_state );
 }
 
 void MainInputManager::loopRepeatLoopStatus()



More information about the vlc-commits mailing list