diff --git a/src/main.cpp b/src/main.cpp index 7687eca76..51051e537 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -58,5 +58,14 @@ int main(int argc, char** argv) mainWindow.openDatabase(filename, argumentMap.value("password"), QString()); } + if (config()->get("OpenPreviousDatabasesOnStartup").toBool()) { + QStringList filenames = config()->get("OpenDatabasesOnExit").toStringList(); + Q_FOREACH (const QString& filename, filenames) { + if (!filename.isEmpty() && QFile::exists(filename)) { + mainWindow.openDatabase(filename, argumentMap.value("password"), QString()); + } + } + } + return app.exec(); }