mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-25 15:29:44 -05:00
Fix crash on database open from browser (#9939)
This commit is contained in:
parent
f93adaa854
commit
6f5f600559
@ -116,7 +116,7 @@ bool BrowserService::openDatabase(bool triggerUnlock)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (triggerUnlock) {
|
if (triggerUnlock && !m_bringToFrontRequested) {
|
||||||
m_bringToFrontRequested = true;
|
m_bringToFrontRequested = true;
|
||||||
updateWindowState();
|
updateWindowState();
|
||||||
emit requestUnlock();
|
emit requestUnlock();
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2021 KeePassXC Team <team@keepassxc.org>
|
* Copyright (C) 2023 KeePassXC Team <team@keepassxc.org>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* 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_dbWidgetStateSync(new DatabaseWidgetStateSync(this))
|
||||||
, m_dbWidgetPendingLock(nullptr)
|
, m_dbWidgetPendingLock(nullptr)
|
||||||
, m_databaseOpenDialog(new DatabaseOpenDialog(this))
|
, m_databaseOpenDialog(new DatabaseOpenDialog(this))
|
||||||
|
, m_databaseOpenInProgress(false)
|
||||||
{
|
{
|
||||||
auto* tabBar = new QTabBar(this);
|
auto* tabBar = new QTabBar(this);
|
||||||
tabBar->setAcceptDrops(true);
|
tabBar->setAcceptDrops(true);
|
||||||
@ -857,6 +858,7 @@ void DatabaseTabWidget::emitDatabaseLockChanged()
|
|||||||
emit databaseLocked(dbWidget);
|
emit databaseLocked(dbWidget);
|
||||||
} else {
|
} else {
|
||||||
emit databaseUnlocked(dbWidget);
|
emit databaseUnlocked(dbWidget);
|
||||||
|
m_databaseOpenInProgress = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -889,6 +891,11 @@ void DatabaseTabWidget::performGlobalAutoType(const QString& search)
|
|||||||
|
|
||||||
void DatabaseTabWidget::performBrowserUnlock()
|
void DatabaseTabWidget::performBrowserUnlock()
|
||||||
{
|
{
|
||||||
|
if (m_databaseOpenInProgress) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_databaseOpenInProgress = true;
|
||||||
auto dbWidget = currentDatabaseWidget();
|
auto dbWidget = currentDatabaseWidget();
|
||||||
if (dbWidget && dbWidget->isLocked()) {
|
if (dbWidget && dbWidget->isLocked()) {
|
||||||
unlockAnyDatabaseInDialog(DatabaseOpenDialog::Intent::Browser);
|
unlockAnyDatabaseInDialog(DatabaseOpenDialog::Intent::Browser);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2021 KeePassXC Team <team@keepassxc.org>
|
* Copyright (C) 2023 KeePassXC Team <team@keepassxc.org>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -117,6 +117,7 @@ private:
|
|||||||
QPointer<DatabaseWidget> m_dbWidgetPendingLock;
|
QPointer<DatabaseWidget> m_dbWidgetPendingLock;
|
||||||
QPointer<DatabaseOpenDialog> m_databaseOpenDialog;
|
QPointer<DatabaseOpenDialog> m_databaseOpenDialog;
|
||||||
QTimer m_lockDelayTimer;
|
QTimer m_lockDelayTimer;
|
||||||
|
bool m_databaseOpenInProgress;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // KEEPASSX_DATABASETABWIDGET_H
|
#endif // KEEPASSX_DATABASETABWIDGET_H
|
||||||
|
Loading…
Reference in New Issue
Block a user