Commit 1809e70b authored by Filip Roséen's avatar Filip Roséen Committed by 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's avatarJean-Baptiste Kempf <>
parent 3bfb9356
......@@ -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;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment