-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix crash on database open from browser (#9939)
- Loading branch information
1 parent
30c5326
commit 0c3d68b
Showing
3 changed files
with
11 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* Copyright (C) 2021 KeePassXC Team <[email protected]> | ||
* Copyright (C) 2023 KeePassXC Team <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
|
@@ -41,6 +41,7 @@ DatabaseTabWidget::DatabaseTabWidget(QWidget* parent) | |
, m_dbWidgetStateSync(new DatabaseWidgetStateSync(this)) | ||
, m_dbWidgetPendingLock(nullptr) | ||
, m_databaseOpenDialog(new DatabaseOpenDialog(this)) | ||
, m_databaseOpenInProgress(false) | ||
{ | ||
auto* tabBar = new QTabBar(this); | ||
tabBar->setAcceptDrops(true); | ||
|
@@ -859,6 +860,7 @@ void DatabaseTabWidget::emitDatabaseLockChanged() | |
emit databaseLocked(dbWidget); | ||
} else { | ||
emit databaseUnlocked(dbWidget); | ||
m_databaseOpenInProgress = false; | ||
} | ||
} | ||
|
||
|
@@ -891,6 +893,11 @@ void DatabaseTabWidget::performGlobalAutoType(const QString& search) | |
|
||
void DatabaseTabWidget::performBrowserUnlock() | ||
{ | ||
if (m_databaseOpenInProgress) { | ||
return; | ||
} | ||
|
||
m_databaseOpenInProgress = true; | ||
auto dbWidget = currentDatabaseWidget(); | ||
if (dbWidget && dbWidget->isLocked()) { | ||
unlockAnyDatabaseInDialog(DatabaseOpenDialog::Intent::Browser); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* Copyright (C) 2021 KeePassXC Team <[email protected]> | ||
* Copyright (C) 2023 KeePassXC Team <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
|
@@ -117,6 +117,7 @@ private slots: | |
QPointer<DatabaseWidget> m_dbWidgetPendingLock; | ||
QPointer<DatabaseOpenDialog> m_databaseOpenDialog; | ||
QTimer m_lockDelayTimer; | ||
bool m_databaseOpenInProgress; | ||
}; | ||
|
||
#endif // KEEPASSX_DATABASETABWIDGET_H |