Commit de1d714f authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: Better restore of the playlist State

parent 5174f448
......@@ -325,7 +325,6 @@ void StandardPLPanel::createTreeView()
else if( m == COLUMN_DURATION ) treeView->header()->resizeSection( c, 80 );
}
}
getSettings()->endGroup();
/* Connections for the TreeView */
CONNECT( treeView, activated( const QModelIndex& ),
......
......@@ -254,8 +254,7 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
}
/* Playlist */
int i_plVis = settings->value( "playlist-visible", 0 ).toInt();
int i_plVis = settings->value( "playlist-visible", false ).toBool();
settings->endGroup();
if( i_plVis ) togglePlaylist();
......@@ -274,18 +273,9 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
MainInterface::~MainInterface()
{
/* Unsure we hide the videoWidget before destroying it */
if( stackCentralOldWidget == playlistWidget )
if( stackCentralOldWidget == videoWidget )
showBg();
/* Save playlist state */
if( playlistWidget )
{
if( !isPlDocked() )
QVLCTools::saveWidgetPosition( p_intf, "Playlist", playlistWidget );
delete playlistWidget;
}
#ifdef WIN32
if( himl )
ImageList_Destroy( himl );
......@@ -306,7 +296,22 @@ MainInterface::~MainInterface()
/* Save states */
settings->beginGroup( "MainWindow" );
settings->setValue( "pl-dock-status", b_plDocked );
settings->setValue( "playlist-visible", (int)playlistVisible );
/* 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
}
delete playlistWidget;
}
settings->setValue( "adv-controls",
getControlsVisibilityStatus() & CONTROLS_ADVANCED );
......
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