[vlc-commits] commit: Qt: more settings fixes (undocked playlist size) (Jakob Leben )

git at videolan.org git at videolan.org
Tue Apr 6 12:51:01 CEST 2010


vlc | branch: master | Jakob Leben <jleben at videolan.org> | Tue Apr  6 12:30:50 2010 +0200| [c97421717a56ff9e80bd65225d306cf7c757c657] | committer: Jakob Leben 

Qt: more settings fixes (undocked playlist size)

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

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

diff --git a/modules/gui/qt4/main_interface.cpp b/modules/gui/qt4/main_interface.cpp
index 26e9d11..6cba05f 100644
--- a/modules/gui/qt4/main_interface.cpp
+++ b/modules/gui/qt4/main_interface.cpp
@@ -295,19 +295,15 @@ MainInterface::~MainInterface()
 
     /* Save states */
     settings->beginGroup( "MainWindow" );
+
     settings->setValue( "pl-dock-status", b_plDocked );
     /* Save playlist state */
     if( playlistWidget )
     {
-        if( isPlDocked() )
-        {
-            QVLCTools::saveWidgetPosition( p_intf, "Playlist", playlistWidget );
-            settings->setValue( "playlist-visible", playlistVisible );
-        }
-        else
-        {
-            settings->setValue( "playlist-visible", playlistWidget->isVisible() ); // FIXME
-        }
+        settings->setValue( "playlist-visible",
+                            isPlDocked() ?
+                            playlistVisible :
+                            playlistWidget->isVisible() /* FIXME */ );
     }
 
     settings->setValue( "adv-controls",
@@ -320,9 +316,15 @@ MainInterface::~MainInterface()
 
     /* Save this size */
     QVLCTools::saveWidgetPosition(settings, this);
+
     settings->endGroup();
 
+    /* Save undocked playlist size */
+    if( playlistWidget && !isPlDocked() )
+        QVLCTools::saveWidgetPosition( p_intf, "Playlist", playlistWidget );
+
     delete playlistWidget;
+
     delete statusBar();
 
     /* Unregister callbacks */
@@ -717,6 +719,7 @@ void MainInterface::dockPlaylist( bool p_docked )
     }
     else
     {
+        QVLCTools::saveWidgetPosition( p_intf, "Playlist", playlistWidget );
         playlistWidget->setWindowFlags( Qt::Widget ); // Probably a Qt bug here
         // It would be logical that QStackWidget::addWidget reset the flags...
         stackCentralW->addWidget( playlistWidget );



More information about the vlc-commits mailing list