]> git.sesse.net Git - vlc/commitdiff
Correctly save the column size from the playlist.
authorJean-Baptiste Kempf <jb@videolan.org>
Mon, 25 Aug 2008 03:26:51 +0000 (20:26 -0700)
committerJean-Baptiste Kempf <jb@videolan.org>
Mon, 25 Aug 2008 03:57:14 +0000 (20:57 -0700)
Fix bug reported on IRC and on Forum.

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/gui/qt4/components/playlist/playlist.cpp
modules/gui/qt4/components/playlist/playlist.hpp
modules/gui/qt4/components/playlist/standardpanel.cpp
modules/gui/qt4/dialogs/playlist.cpp

index 621c251b2fd9dbe55e9999e48aae33bbe5ee63f5..c55b0dc7e8e4cc8ee95e6709db8d7e29210c3ee0 100644 (file)
@@ -140,10 +140,9 @@ QSize PlaylistWidget::sizeHint() const
 }
 
 PlaylistWidget::~PlaylistWidget()
-{}
-
-void PlaylistWidget::savingSettings()
 {
+    getSettings()->beginGroup("playlistdialog");
     getSettings()->setValue( "splitterSizes", saveState() );
+    getSettings()->endGroup();
 }
 
index c83456a1cd080db3cabca9523c0dfdbd2849e75b..8401688a945e9fbc18344abab2cdfa05657abb6a 100644 (file)
@@ -48,7 +48,6 @@ public:
     PlaylistWidget( intf_thread_t *_p_i, QWidget *parent ) ;
     virtual ~PlaylistWidget();
     QSize sizeHint() const;
-    void savingSettings();
 private:
     PLSelector *selector;
     PLPanel *rightPanel;
index e29f0643d983c6f4eb97e635fe2fd7ecfd77d318..65e4e51637166ac3e4f039c21a9f1164768a4271 100644 (file)
@@ -74,12 +74,22 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
     view->setDropIndicatorShown( true );
     view->setAutoScroll( true );
 
-    /* Configure the size of the header */
-    view->header()->resizeSection( 0, 200 );
-    view->header()->resizeSection( 1, 80 );
-    view->header()->setSortIndicatorShown( true );
-    view->header()->setClickable( true );
-    view->header()->setContextMenuPolicy( Qt::CustomContextMenu );
+#if HAS_QT43
+    if( getSettings()->contains( "headerState" ) )
+    {
+        view->header()->restoreState( getSettings()->value( "headerState" ).toByteArray() );
+        msg_Dbg( p_intf, "exists" );
+    }
+    else
+#endif
+    {
+        /* Configure the size of the header */
+        view->header()->resizeSection( 0, 200 );
+        view->header()->resizeSection( 1, 80 );
+        view->header()->setSortIndicatorShown( true );
+        view->header()->setClickable( true );
+        view->header()->setContextMenuPolicy( Qt::CustomContextMenu );
+    }
 
     /* Connections for the TreeView */
     CONNECT( view, activated( const QModelIndex& ) ,
@@ -350,4 +360,12 @@ void StandardPLPanel::deleteSelection()
 }
 
 StandardPLPanel::~StandardPLPanel()
-{}
+{
+#if HAS_QT43
+    getSettings()->beginGroup("playlistdialog");
+    getSettings()->setValue( "headerState", view->header()->saveState() );
+    getSettings()->endGroup();
+#endif
+}
+
+
index cff3c0b4d7ed2fade131223575871efc3b1145e9..289db4fcc45d3914d84da26548322845b7887762 100644 (file)
@@ -63,10 +63,7 @@ PlaylistDialog::PlaylistDialog( intf_thread_t *_p_intf )
 PlaylistDialog::~PlaylistDialog()
 {
     getSettings()->beginGroup("playlistdialog");
-
     writeSettings( getSettings() );
-    playlistWidget->savingSettings();
-
     getSettings()->endGroup();
 }