Prioritize explicit databases.

This commit is contained in:
Louis-Bertrand Varin 2017-04-05 09:00:40 -04:00 committed by Jonathan White
parent 86e88c18b0
commit beba23ea2e

View File

@ -115,6 +115,15 @@ int main(int argc, char** argv)
mainWindow.show(); 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++) { for (int ii=0; ii < args.length(); ii++) {
QString filename = args[ii]; QString filename = args[ii];
if (!filename.isEmpty() && QFile::exists(filename)) { 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(); int exitCode = app.exec();
#if defined(WITH_ASAN) && defined(WITH_LSAN) #if defined(WITH_ASAN) && defined(WITH_LSAN)