[vlc-devel] [PATCH 2/2] gui/qt: fix loop-button icon on notification of change

Filip Roséen filip at videolabs.io
Mon May 30 18:18:06 CEST 2016


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".

This patch fixes that issue.
---
 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()
-- 
2.8.3



More information about the vlc-devel mailing list