Commit e5c9c3b1 authored by Jakob Leben's avatar Jakob Leben

Qt: settings

MainInterface:
  Use same settings context when creating and deleting playlistWidget
  Make beginGroup() / endGroup() pairs explicit.
StandardPLPanel:
  Use same settings context whenever creating treeView
parent d4297619
......@@ -119,10 +119,11 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
getSettings()->beginGroup("Playlist");
int i_viewMode = getSettings()->value( "view-mode", TREE_VIEW ).toInt();
showView( i_viewMode );
getSettings()->endGroup();
showView( i_viewMode );
DCONNECT( THEMIM, leafBecameParent( input_item_t *),
this, browseInto( input_item_t * ) );
......@@ -311,6 +312,8 @@ void StandardPLPanel::createTreeView()
/* setModel after setSortingEnabled(true), or the model will sort immediately! */
treeView->setModel( model );
getSettings()->beginGroup("Playlist");
if( getSettings()->contains( "headerStateV2" ) )
{
treeView->header()->restoreState(
......@@ -326,6 +329,8 @@ void StandardPLPanel::createTreeView()
}
}
getSettings()->endGroup();
/* Connections for the TreeView */
CONNECT( treeView, activated( const QModelIndex& ),
this, activate( const QModelIndex& ) );
......
......@@ -131,7 +131,7 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
**/
mainBasedSize = settings->value( "mainBasedSize", QSize( 350, 120 ) ).toSize();
mainVideoSize = settings->value( "mainVideoSize", QSize( 400, 300 ) ).toSize();
settings->endGroup( );
/**************
* Status Bar *
......@@ -308,8 +308,6 @@ MainInterface::~MainInterface()
{
settings->setValue( "playlist-visible", playlistWidget->isVisible() ); // FIXME
}
delete playlistWidget;
}
settings->setValue( "adv-controls",
......@@ -324,6 +322,7 @@ MainInterface::~MainInterface()
QVLCTools::saveWidgetPosition(settings, this);
settings->endGroup();
delete playlistWidget;
delete statusBar();
/* Unregister callbacks */
......@@ -376,6 +375,8 @@ void MainInterface::createMainWidget( QSettings *settings )
}
mainLayout->insertWidget( 1, stackCentralW );
settings->beginGroup( "MainWindow" );
/* Create the CONTROLS Widget */
controls = new ControlsWidget( p_intf,
settings->value( "adv-controls", false ).toBool(), this );
......@@ -392,7 +393,7 @@ void MainInterface::createMainWidget( QSettings *settings )
visualSelector->hide();
#endif
getSettings()->endGroup();
settings->endGroup();
/* Enable the popup menu in the MI */
main->setContextMenuPolicy( Qt::CustomContextMenu );
......
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