From beba23ea2e5d49b4cc189da116756b373fb4e9c6 Mon Sep 17 00:00:00 2001 From: Louis-Bertrand Varin Date: Wed, 5 Apr 2017 09:00:40 -0400 Subject: [PATCH] Prioritize explicit databases. --- src/main.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 49fbdb85b..5981999e7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -115,6 +115,15 @@ int main(int argc, char** argv) mainWindow.show(); } + if (config()->get("OpenPreviousDatabasesOnStartup").toBool()) { + const QStringList filenames = config()->get("LastOpenedDatabases").toStringList(); + for (const QString& filename : filenames) { + if (!filename.isEmpty() && QFile::exists(filename)) { + mainWindow.openDatabase(filename, QString(), QString()); + } + } + } + for (int ii=0; ii < args.length(); ii++) { QString filename = args[ii]; if (!filename.isEmpty() && QFile::exists(filename)) { @@ -127,15 +136,6 @@ int main(int argc, char** argv) } } - if (config()->get("OpenPreviousDatabasesOnStartup").toBool()) { - const QStringList filenames = config()->get("LastOpenedDatabases").toStringList(); - for (const QString& filename : filenames) { - if (!filename.isEmpty() && QFile::exists(filename)) { - mainWindow.openDatabase(filename, QString(), QString()); - } - } - } - int exitCode = app.exec(); #if defined(WITH_ASAN) && defined(WITH_LSAN)