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

Rémi Denis-Courmont git at videolan.org
Tue Apr 17 19:26:23 CEST 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Apr 17 20:25:03 2012 +0300| [212b20ddf01c4eef7817e34a8107620bdff170ed] | committer: Rémi Denis-Courmont

Qt4: override playlist configuration on request, _not_ on exit

Fixes #6346.

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

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

diff --git a/modules/gui/qt4/input_manager.cpp b/modules/gui/qt4/input_manager.cpp
index 28ffee5..5ee9264 100644
--- a/modules/gui/qt4/input_manager.cpp
+++ b/modules/gui/qt4/input_manager.cpp
@@ -977,11 +977,6 @@ MainInputManager::~MainInputManager()
     var_DelCallback( THEPL, "item-current", PLItemChanged, this );
     var_DelCallback( THEPL, "playlist-item-append", PLItemAppended, this );
     var_DelCallback( THEPL, "playlist-item-deleted", PLItemRemoved, 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" ) );
 }
 
 vout_thread_t* MainInputManager::getVout()
@@ -1125,7 +1120,7 @@ void MainInputManager::pause()
 
 void MainInputManager::toggleRandom()
 {
-    var_ToggleBool( THEPL, "random" );
+    config_PutInt( p_intf, "random", var_ToggleBool( THEPL, "random" ) );
 }
 
 void MainInputManager::notifyRandom(bool value)
@@ -1144,15 +1139,29 @@ void MainInputManager::notifyRepeatLoop(bool)
 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