[vlmc-devel] commit: MainWindow: Don' t restore geometry only if the crash handler is active. ( Hugo Beauzée-Luyssen )

git at videolan.org git at videolan.org
Thu Oct 7 18:42:15 CEST 2010


vlmc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Thu Oct  7 18:41:54 2010 +0200| [9856736ba3a57c86279b891cb8217775c1c9d2a6] | committer: Hugo Beauzée-Luyssen 

MainWindow: Don't restore geometry only if the crash handler is active.

> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=9856736ba3a57c86279b891cb8217775c1c9d2a6
---

 src/Gui/DockWidgetManager.cpp |    6 +-----
 src/Gui/MainWindow.cpp        |   10 +++++-----
 2 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/src/Gui/DockWidgetManager.cpp b/src/Gui/DockWidgetManager.cpp
index fcd04b4..b063f21 100644
--- a/src/Gui/DockWidgetManager.cpp
+++ b/src/Gui/DockWidgetManager.cpp
@@ -39,11 +39,7 @@ DockWidgetManager::DockWidgetManager( QObject *parent )
 
 DockWidgetManager::~DockWidgetManager()
 {
-    QList<QDockWidget*> widgets = m_dockWidgets.values();
-    QDockWidget* dockWidget;
-
-    foreach( dockWidget, widgets )
-        delete dockWidget;
+    qDeleteAll( m_dockWidgets );
 }
 
 void DockWidgetManager::setMainWindow( MainWindow *mainWin )
diff --git a/src/Gui/MainWindow.cpp b/src/Gui/MainWindow.cpp
index ffc06e3..630d6d3 100644
--- a/src/Gui/MainWindow.cpp
+++ b/src/Gui/MainWindow.cpp
@@ -130,6 +130,11 @@ MainWindow::MainWindow( QWidget *parent ) :
 #endif
     QSettings s;
 
+    // Restore the geometry
+    restoreGeometry( s.value( "MainWindowGeometry" ).toByteArray() );
+    // Restore the layout
+    restoreState( s.value( "MainWindowState" ).toByteArray() );
+
     if ( s.value( "ShowWizardStartup", true ).toBool() )
     {
         //If a project was opened from the command line: don't show the wizard.
@@ -794,11 +799,6 @@ MainWindow::restoreSession()
     {
         bool        cleanQuit = s.value( "CleanQuit", true ).toBool();
 
-        // Restore the geometry
-        restoreGeometry( s.value( "MainWindowGeometry" ).toByteArray() );
-        // Restore the layout
-        restoreState( s.value( "MainWindowState" ).toByteArray() );
-
         if ( cleanQuit == false )
         {
             QMessageBox::StandardButton res = QMessageBox::question( this, tr( "Crash recovery" ), tr( "VLMC didn't closed nicely. Do you want to recover your project?" ),



More information about the Vlmc-devel mailing list