From 97a890e8a040418d3acf0f1b855c0ea184fe0e75 Mon Sep 17 00:00:00 2001 From: Michael Lass Date: Sat, 3 Mar 2018 11:10:55 +0100 Subject: [PATCH] Open previously opened databases in correct order Databases are re-opened by traversing LastOpenedDatabases from front to back, i.e. the last element in the list will be the active tab. However, the most-recently used database is currently stored at the beginning of the list. This leads to the least-recently used database to be the ative tab on next startup. Previously, this has been fixed in 4c76c97 by opening the databases in reversed order. This change was accidentally reverted in 165d664. Instead, change the order of LastOpenedDatabases itself, so no reversal on opening the databases is necessary. Resolves #1572 --- src/gui/MainWindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 76f1ffb60..7f732faca 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -933,7 +933,7 @@ void MainWindow::setShortcut(QAction* action, QKeySequence::StandardKey standard void MainWindow::rememberOpenDatabases(const QString& filePath) { - m_openDatabases.append(filePath); + m_openDatabases.prepend(filePath); } void MainWindow::applySettingsChanges() @@ -1150,4 +1150,4 @@ void MainWindow::closeAllDatabases() void MainWindow::lockAllDatabases() { lockDatabasesAfterInactivity(); -} \ No newline at end of file +}