Commit 27eb5342 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Correctly save the column size from the playlist.

Fix bug reported on IRC and on Forum.
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 83dbe964
...@@ -140,10 +140,9 @@ QSize PlaylistWidget::sizeHint() const ...@@ -140,10 +140,9 @@ QSize PlaylistWidget::sizeHint() const
} }
PlaylistWidget::~PlaylistWidget() PlaylistWidget::~PlaylistWidget()
{}
void PlaylistWidget::savingSettings()
{ {
getSettings()->beginGroup("playlistdialog");
getSettings()->setValue( "splitterSizes", saveState() ); getSettings()->setValue( "splitterSizes", saveState() );
getSettings()->endGroup();
} }
...@@ -48,7 +48,6 @@ public: ...@@ -48,7 +48,6 @@ public:
PlaylistWidget( intf_thread_t *_p_i, QWidget *parent ) ; PlaylistWidget( intf_thread_t *_p_i, QWidget *parent ) ;
virtual ~PlaylistWidget(); virtual ~PlaylistWidget();
QSize sizeHint() const; QSize sizeHint() const;
void savingSettings();
private: private:
PLSelector *selector; PLSelector *selector;
PLPanel *rightPanel; PLPanel *rightPanel;
......
...@@ -74,12 +74,22 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent, ...@@ -74,12 +74,22 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
view->setDropIndicatorShown( true ); view->setDropIndicatorShown( true );
view->setAutoScroll( true ); view->setAutoScroll( true );
/* Configure the size of the header */ #if HAS_QT43
view->header()->resizeSection( 0, 200 ); if( getSettings()->contains( "headerState" ) )
view->header()->resizeSection( 1, 80 ); {
view->header()->setSortIndicatorShown( true ); view->header()->restoreState( getSettings()->value( "headerState" ).toByteArray() );
view->header()->setClickable( true ); msg_Dbg( p_intf, "exists" );
view->header()->setContextMenuPolicy( Qt::CustomContextMenu ); }
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 */ /* Connections for the TreeView */
CONNECT( view, activated( const QModelIndex& ) , CONNECT( view, activated( const QModelIndex& ) ,
...@@ -350,4 +360,12 @@ void StandardPLPanel::deleteSelection() ...@@ -350,4 +360,12 @@ void StandardPLPanel::deleteSelection()
} }
StandardPLPanel::~StandardPLPanel() StandardPLPanel::~StandardPLPanel()
{} {
#if HAS_QT43
getSettings()->beginGroup("playlistdialog");
getSettings()->setValue( "headerState", view->header()->saveState() );
getSettings()->endGroup();
#endif
}
...@@ -63,10 +63,7 @@ PlaylistDialog::PlaylistDialog( intf_thread_t *_p_intf ) ...@@ -63,10 +63,7 @@ PlaylistDialog::PlaylistDialog( intf_thread_t *_p_intf )
PlaylistDialog::~PlaylistDialog() PlaylistDialog::~PlaylistDialog()
{ {
getSettings()->beginGroup("playlistdialog"); getSettings()->beginGroup("playlistdialog");
writeSettings( getSettings() ); writeSettings( getSettings() );
playlistWidget->savingSettings();
getSettings()->endGroup(); getSettings()->endGroup();
} }
......
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