diff --git a/src/browser/BrowserService.cpp b/src/browser/BrowserService.cpp index 60412b5a..c0497d91 100644 --- a/src/browser/BrowserService.cpp +++ b/src/browser/BrowserService.cpp @@ -249,7 +249,7 @@ QJsonObject BrowserService::createNewGroup(const QString& groupName) return result; } - auto dialogResult = MessageBox::warning(m_currentDatabaseWidget, + auto dialogResult = MessageBox::warning(nullptr, tr("KeePassXC - Create a new group"), tr("A request for creating a new group \"%1\" has been received.\n" "Do you want to create this group?\n") @@ -422,7 +422,7 @@ QList BrowserService::confirmEntries(QList& entriesToConfirm, m_dialogActive = true; updateWindowState(); - BrowserAccessControlDialog accessControlDialog(m_currentDatabaseWidget); + BrowserAccessControlDialog accessControlDialog{}; connect(m_currentDatabaseWidget, SIGNAL(databaseLockRequested()), &accessControlDialog, SLOT(reject())); @@ -512,7 +512,7 @@ QString BrowserService::storeKey(const QString& key) QString id; do { - QInputDialog keyDialog(m_currentDatabaseWidget); + QInputDialog keyDialog{}; connect(m_currentDatabaseWidget, SIGNAL(databaseLockRequested()), &keyDialog, SLOT(reject())); keyDialog.setWindowTitle(tr("KeePassXC - New key association request")); keyDialog.setLabelText(tr("You have received an association request for the following database:\n%1\n\n" @@ -535,7 +535,7 @@ QString BrowserService::storeKey(const QString& key) contains = db->metadata()->customData()->contains(CustomData::BrowserKeyPrefix + id); if (contains) { - dialogResult = MessageBox::warning(m_currentDatabaseWidget, + dialogResult = MessageBox::warning(nullptr, tr("KeePassXC - Overwrite existing key?"), tr("A shared encryption key with the name \"%1\" " "already exists.\nDo you want to overwrite it?") @@ -595,7 +595,7 @@ QJsonObject BrowserService::showPasskeysRegisterPrompt(const QJsonObject& public const auto existingEntries = getPasskeyEntriesWithUserHandle(rpId, userId, keyList); raiseWindow(); - BrowserPasskeysConfirmationDialog confirmDialog(m_currentDatabaseWidget); + BrowserPasskeysConfirmationDialog confirmDialog{}; confirmDialog.registerCredential(username, rpId, existingEntries, timeout); auto dialogResult = confirmDialog.exec(); @@ -612,7 +612,7 @@ QJsonObject BrowserService::showPasskeysRegisterPrompt(const QJsonObject& public // If no entry is selected, show the import dialog for manual entry selection auto selectedEntry = confirmDialog.getSelectedEntry(); if (!selectedEntry) { - PasskeyImporter passkeyImporter(m_currentDatabaseWidget); + PasskeyImporter passkeyImporter{}; const auto result = passkeyImporter.showImportDialog(db, nullptr, origin, @@ -683,7 +683,7 @@ QJsonObject BrowserService::showPasskeysAuthenticationPrompt(const QJsonObject& const auto timeout = publicKeyOptions["timeout"].toInt(); raiseWindow(); - BrowserPasskeysConfirmationDialog confirmDialog(m_currentDatabaseWidget); + BrowserPasskeysConfirmationDialog confirmDialog{}; confirmDialog.authenticateCredential(entries, rpId, timeout); auto dialogResult = confirmDialog.exec(); if (dialogResult == QDialog::Accepted) { @@ -760,7 +760,7 @@ void BrowserService::addPasskeyToEntry(Entry* entry, // Ask confirmation if entry already contains a Passkey if (entry->hasPasskey()) { - if (MessageBox::question(m_currentDatabaseWidget, + if (MessageBox::question(nullptr, tr("KeePassXC - Update passkey"), tr("Entry already has a passkey.\nDo you want to overwrite the passkey in %1 - %2?") .arg(entry->title(), passkeyUtils()->getUsernameFromEntry(entry)), @@ -873,7 +873,7 @@ bool BrowserService::updateEntry(const EntryParameters& entryParameters, const Q MessageBox::Button dialogResult = MessageBox::No; if (!browserSettings()->alwaysAllowUpdate()) { raiseWindow(); - dialogResult = MessageBox::question(m_currentDatabaseWidget, + dialogResult = MessageBox::question(nullptr, tr("KeePassXC - Update Entry"), tr("Do you want to update the information in %1 - %2?") .arg(QUrl(entryParameters.siteUrl).host(), username), @@ -909,7 +909,7 @@ bool BrowserService::deleteEntry(const QString& uuid) return false; } - auto dialogResult = MessageBox::warning(m_currentDatabaseWidget, + auto dialogResult = MessageBox::warning(nullptr, tr("KeePassXC - Delete entry"), tr("A request for deleting entry \"%1\" has been received.\n" "Do you want to delete the entry?\n") @@ -1536,7 +1536,7 @@ QSharedPointer BrowserService::selectedDatabase() } } - BrowserEntrySaveDialog browserEntrySaveDialog(m_currentDatabaseWidget); + BrowserEntrySaveDialog browserEntrySaveDialog{}; int openDatabaseCount = browserEntrySaveDialog.setItems(databaseWidgets, m_currentDatabaseWidget); if (openDatabaseCount > 1) { int res = browserEntrySaveDialog.exec(); diff --git a/src/fdosecrets/objects/Prompt.cpp b/src/fdosecrets/objects/Prompt.cpp index e89cd499..347c98b8 100644 --- a/src/fdosecrets/objects/Prompt.cpp +++ b/src/fdosecrets/objects/Prompt.cpp @@ -313,7 +313,7 @@ namespace FdoSecrets if (!entries.isEmpty()) { QString app = tr("%1 (PID: %2)").arg(client->name()).arg(client->pid()); auto ac = new AccessControlDialog( - findWindow(m_windowId), entries, app, client->processInfo(), AuthOption::Remember); + nullptr, entries, app, client->processInfo(), AuthOption::Remember); connect(ac, &AccessControlDialog::finished, this, &UnlockPrompt::itemUnlockFinished); connect(ac, &AccessControlDialog::finished, ac, &AccessControlDialog::deleteLater); ac->open(); diff --git a/src/gui/DatabaseTabWidget.cpp b/src/gui/DatabaseTabWidget.cpp index 805d4eab..4836199e 100644 --- a/src/gui/DatabaseTabWidget.cpp +++ b/src/gui/DatabaseTabWidget.cpp @@ -41,7 +41,7 @@ DatabaseTabWidget::DatabaseTabWidget(QWidget* parent) : QTabWidget(parent) , m_dbWidgetStateSync(new DatabaseWidgetStateSync(this)) , m_dbWidgetPendingLock(nullptr) - , m_databaseOpenDialog(new DatabaseOpenDialog(this)) + , m_databaseOpenDialog(new DatabaseOpenDialog()) , m_databaseOpenInProgress(false) { auto* tabBar = new QTabBar(this);