From: Jakob Leben Date: Thu, 1 Apr 2010 13:58:15 +0000 (+0200) Subject: Qt: settings X-Git-Tag: 1.1.0-pre1~144 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=e5c9c3b1de2c7d7afb0576e296b67cdc5a5945f5;p=vlc 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 --- diff --git a/modules/gui/qt4/components/playlist/standardpanel.cpp b/modules/gui/qt4/components/playlist/standardpanel.cpp index 3a4568b058..84da46c42f 100644 --- a/modules/gui/qt4/components/playlist/standardpanel.cpp +++ b/modules/gui/qt4/components/playlist/standardpanel.cpp @@ -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& ) ); diff --git a/modules/gui/qt4/main_interface.cpp b/modules/gui/qt4/main_interface.cpp index 706186c2e2..26e9d11b24 100644 --- a/modules/gui/qt4/main_interface.cpp +++ b/modules/gui/qt4/main_interface.cpp @@ -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 );