Prevent recursive loads using AutoOpen
* Fix #3334 - AutoOpen is now processed after the database widget is put into view mode to prevent infinite recursion of unlock attempts if two databases auto open each other.
This commit is contained in:
committed by
Janek Bevendorff
parent
cb9929712c
commit
4edb623745
@@ -400,7 +400,6 @@ void DatabaseWidget::replaceDatabase(QSharedPointer<Database> db)
|
||||
m_db = std::move(db);
|
||||
connectDatabaseSignals();
|
||||
m_groupView->changeDatabase(m_db);
|
||||
processAutoOpen();
|
||||
|
||||
// Restore the new parent group pointer, if not found default to the root group
|
||||
// this prevents data loss when merging a database while creating a new entry
|
||||
@@ -946,6 +945,7 @@ void DatabaseWidget::loadDatabase(bool accepted)
|
||||
if (accepted) {
|
||||
replaceDatabase(openWidget->database());
|
||||
switchToMainView();
|
||||
processAutoOpen();
|
||||
m_saveAttempts = 0;
|
||||
emit databaseUnlocked();
|
||||
if (config()->get("MinimizeAfterUnlock").toBool()) {
|
||||
@@ -1032,6 +1032,7 @@ void DatabaseWidget::unlockDatabase(bool accepted)
|
||||
m_entryBeforeLock = QUuid();
|
||||
|
||||
switchToMainView();
|
||||
processAutoOpen();
|
||||
emit databaseUnlocked();
|
||||
|
||||
if (senderDialog && senderDialog->intent() == DatabaseOpenDialog::Intent::AutoType) {
|
||||
@@ -1468,6 +1469,7 @@ void DatabaseWidget::reloadDatabaseFile()
|
||||
}
|
||||
|
||||
replaceDatabase(db);
|
||||
processAutoOpen();
|
||||
restoreGroupEntryFocus(groupBeforeReload, entryBeforeReload);
|
||||
m_blockAutoSave = false;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user