[vlc-commits] commit: Qt: settings (Jakob Leben )

git at videolan.org git at videolan.org
Thu Apr 1 16:17:59 CEST 2010


vlc | branch: master | Jakob Leben <jleben at videolan.org> | Thu Apr  1 15:58:15 2010 +0200| [e5c9c3b1de2c7d7afb0576e296b67cdc5a5945f5] | committer: 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

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e5c9c3b1de2c7d7afb0576e296b67cdc5a5945f5
---

 .../gui/qt4/components/playlist/standardpanel.cpp  |    7 ++++++-
 modules/gui/qt4/main_interface.cpp                 |    9 +++++----
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/modules/gui/qt4/components/playlist/standardpanel.cpp b/modules/gui/qt4/components/playlist/standardpanel.cpp
index 3a4568b..84da46c 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 706186c..26e9d11 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 );



More information about the vlc-commits mailing list