mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-05-03 07:04:58 -04:00
Open previously opened databases in correct order
In LastOpenedDatabases, the most recently opened file is listed first and the least recently opened one is listed last. If the databases are re-opened in this order, LastOpenedDatabases is reversed afterwards. To avoid this, load the files in reverse order, so LastOpenedDatabases is not modified.
This commit is contained in:
parent
1d30283514
commit
4c76c97762
1 changed files with 2 additions and 1 deletions
|
@ -131,7 +131,8 @@ int main(int argc, char** argv)
|
|||
|
||||
if (config()->get("OpenPreviousDatabasesOnStartup").toBool()) {
|
||||
const QStringList filenames = config()->get("LastOpenedDatabases").toStringList();
|
||||
for (const QString& filename : filenames) {
|
||||
for (int ii = filenames.size()-1; ii >= 0; ii--) {
|
||||
QString filename = filenames.at(ii);
|
||||
if (!filename.isEmpty() && QFile::exists(filename)) {
|
||||
mainWindow.openDatabase(filename, QString(), QString());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue