[vlc-commits] Qt4: override playlist configuration on request, _not_ on exit

Rémi Denis-Courmont git at videolan.org
Mon Aug 20 00:45:21 CEST 2012


vlc/vlc-2.0 | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Apr 17 20:25:03 2012 +0300| [ae296115f09facb2004fc7537d9484c3136fa1cc] | committer: Jean-Baptiste Kempf

Qt4: override playlist configuration on request, _not_ on exit

Fixes #6346.
(cherry picked from commit 212b20ddf01c4eef7817e34a8107620bdff170ed)

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

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

 modules/gui/qt4/input_manager.cpp |   33 +++++++++++++++++++++------------
 1 file changed, 21 insertions(+), 12 deletions(-)

diff --git a/modules/gui/qt4/input_manager.cpp b/modules/gui/qt4/input_manager.cpp
index b071fd1..0c379ad 100644
--- a/modules/gui/qt4/input_manager.cpp
+++ b/modules/gui/qt4/input_manager.cpp
@@ -988,11 +988,6 @@ MainInputManager::~MainInputManager()
     var_DelCallback( THEPL, "repeat", RepeatChanged, this );
     var_DelCallback( THEPL, "loop", LoopChanged, this );
 
-    /* Save some interface state in configuration, at module quit */
-    config_PutInt( p_intf, "random", var_GetBool( THEPL, "random" ) );
-    config_PutInt( p_intf, "loop", var_GetBool( THEPL, "loop" ) );
-    config_PutInt( p_intf, "repeat", var_GetBool( THEPL, "repeat" ) );
-
     if( var_InheritBool( p_intf, "qt-autosave-volume" ) )
         config_PutInt( p_intf, "volume", aout_VolumeGet( THEPL ) );
 }
@@ -1145,7 +1140,7 @@ void MainInputManager::pause()
 
 void MainInputManager::toggleRandom()
 {
-    var_ToggleBool( THEPL, "random" );
+    config_PutInt( p_intf, "random", var_ToggleBool( THEPL, "random" ) );
 }
 
 void MainInputManager::notifyRepeatLoop()
@@ -1159,15 +1154,29 @@ void MainInputManager::notifyRepeatLoop()
 void MainInputManager::loopRepeatLoopStatus()
 {
     /* Toggle Normal -> Loop -> Repeat -> Normal ... */
-    if( var_GetBool( THEPL, "repeat" ) )
-        var_SetBool( THEPL, "repeat", false );
-    else if( var_GetBool( THEPL, "loop" ) )
+    bool loop = var_GetBool( THEPL, "loop" );
+    bool repeat = var_GetBool( THEPL, "repeat" );
+
+    if( repeat )
+    {
+        loop = false;
+        repeat = false;
+    }
+    else if( loop )
     {
-        var_SetBool( THEPL, "loop", false );
-        var_SetBool( THEPL, "repeat", true );
+        loop = false;
+        repeat = true;
     }
     else
-        var_SetBool( THEPL, "loop", true );
+    {
+        loop = true;
+        //repeat = false;
+    }
+
+    var_SetBool( THEPL, "loop", loop );
+    var_SetBool( THEPL, "repeat", repeat );
+    config_PutInt( p_intf, "loop", loop );
+    config_PutInt( p_intf, "repeat", repeat );
 }
 
 void MainInputManager::activatePlayQuit( bool b_exit )



More information about the vlc-commits mailing list