Skip to content

Commit

Permalink
Open previously opened databases in correct order
Browse files Browse the repository at this point in the history
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 keepassxreboot#1572
  • Loading branch information
michaellass authored and phoerious committed Mar 3, 2018
1 parent a5dc196 commit 97a890e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gui/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -1150,4 +1150,4 @@ void MainWindow::closeAllDatabases()
void MainWindow::lockAllDatabases()
{
lockDatabasesAfterInactivity();
}
}

0 comments on commit 97a890e

Please sign in to comment.