[vlc-commits] Qt: fix setup of loop-button icon

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


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

Qt: fix setup of loop-button icon

Given that NORMAL=0, REPEAT_ALL=1, REPEAT_ONE=3 the previous code would
not always yield the correct state for the loop button during setup.

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

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

 modules/gui/qt/components/controller.cpp |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/modules/gui/qt/components/controller.cpp b/modules/gui/qt/components/controller.cpp
index 7acf5c3..c846f25 100644
--- a/modules/gui/qt/components/controller.cpp
+++ b/modules/gui/qt/components/controller.cpp
@@ -448,8 +448,13 @@ QWidget *AbstractController::createWidget( buttonType_e button, int options )
         setupButton( loopButton );
         loopButton->setToolTip( qtr( "Click to toggle between loop all, loop one and no loop") );
         loopButton->setCheckable( true );
-        int i_state = 2 * var_GetBool( THEPL, "loop" ) + var_GetBool( THEPL, "repeat" );
-        loopButton->updateButtonIcons( i_state );
+        {
+            int i_state = NORMAL;
+            if( var_GetBool( THEPL, "loop" ) )   i_state = REPEAT_ALL;
+            if( var_GetBool( THEPL, "repeat" ) ) i_state = REPEAT_ONE;
+            loopButton->updateButtonIcons( i_state );
+        }
+
         CONNECT( THEMIM, repeatLoopChanged( int ), loopButton, updateButtonIcons( int ) );
         CONNECT( loopButton, clicked(), THEMIM, loopRepeatLoopStatus() );
         widget = loopButton;



More information about the vlc-commits mailing list