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
}
PlaylistWidget::~PlaylistWidget()
{}
void PlaylistWidget::savingSettings()
{
getSettings()->beginGroup("playlistdialog");
getSettings()->setValue( "splitterSizes", saveState() );
getSettings()->endGroup();
}
......@@ -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;
......
......@@ -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
}
......@@ -63,10 +63,7 @@ PlaylistDialog::PlaylistDialog( intf_thread_t *_p_intf )
PlaylistDialog::~PlaylistDialog()
{
getSettings()->beginGroup("playlistdialog");
writeSettings( getSettings() );
playlistWidget->savingSettings();
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