From fca39e9e1c6fe777f2994b075cde4ebc4695e40b Mon Sep 17 00:00:00 2001 From: Martin Kleusberg Date: Thu, 6 Nov 2014 16:56:08 +0100 Subject: [PATCH] Don't override project file settings right after loading them This fixes a bug which was introduced during the SQLCipher development and which caused some settings loaded from a project file to be loaded but then replaced by the default values which were loaded right afterwards. --- src/MainWindow.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 301e75c3..32aa8450 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -209,6 +209,7 @@ bool MainWindow::fileOpen(const QString& fileName, bool dontAddToRecentFiles) if(QFile::exists(wFile) ) { fileClose(); + // Try opening it as a project file first if(loadProject(wFile)) { @@ -223,17 +224,17 @@ bool MainWindow::fileOpen(const QString& fileName, bool dontAddToRecentFiles) if(!dontAddToRecentFiles) addToRecentFilesMenu(wFile); openSqlTab(true); + loadExtensionsFromSettings(); + populateStructure(); + resetBrowser(); + if(ui->mainTab->currentIndex() == 2) + loadPragmas(); retval = true; } else { QMessageBox::warning(this, qApp->applicationName(), tr("Invalid file format.")); return false; } } - loadExtensionsFromSettings(); - populateStructure(); - resetBrowser(); - if(ui->mainTab->currentIndex() == 2) - loadPragmas(); } return retval;