diff --git a/src/core/Config.cpp b/src/core/Config.cpp index bd4d0a7dd..9f60cfef0 100644 --- a/src/core/Config.cpp +++ b/src/core/Config.cpp @@ -75,7 +75,7 @@ static const QHash configStrings = { {Config::GlobalAutoTypeModifiers,{QS("GlobalAutoTypeModifiers"), Roaming, 0}}, {Config::TrackNonDataChanges,{QS("TrackNonDataChanges"), Roaming, false}}, {Config::FaviconDownloadTimeout,{QS("FaviconDownloadTimeout"), Roaming, 10}}, - {Config::UpdateCheckMessageShown,{QS("UpdateCheckMessageShown"), Roaming, true}}, + {Config::UpdateCheckMessageShown,{QS("UpdateCheckMessageShown"), Roaming, false}}, {Config::UseTouchID,{QS("UseTouchID"), Roaming, false}}, {Config::LastDatabases, {QS("LastDatabases"), Local, {}}}, @@ -102,6 +102,7 @@ static const QHash configStrings = { {Config::GUI_MonospaceNotes, {QS("GUI/MonospaceNotes"), Roaming, false}}, {Config::GUI_ApplicationTheme, {QS("GUI/ApplicationTheme"), Roaming, QS("auto")}}, {Config::GUI_CheckForUpdates, {QS("GUI/CheckForUpdates"), Roaming, true}}, + {Config::GUI_CheckForUpdatesNextCheck, {QS("GUI/CheckForUpdatesNextCheck"), Local, 0}}, {Config::GUI_CheckForUpdatesIncludeBetas, {QS("GUI/CheckForUpdatesIncludeBetas"), Roaming, false}}, {Config::GUI_MainWindowGeometry, {QS("GUI/MainWindowGeometry"), Local, {}}}, @@ -111,7 +112,6 @@ static const QHash configStrings = { {Config::GUI_SplitterState, {QS("GUI/SplitterState"), Local, {}}}, {Config::GUI_PreviewSplitterState, {QS("GUI/PreviewSplitterState"), Local, {}}}, {Config::GUI_AutoTypeSelectDialogSize, {QS("GUI/AutoTypeSelectDialogSize"), Local, QSize(600, 250)}}, - {Config::GUI_CheckForUpdatesNextCheck, {QS("GUI/AutoTypeSelectDialogSize"), Local, 0}}, // Security {Config::Security_ClearClipboard, {QS("Security/ClearClipboard"), Roaming, true}}, @@ -185,13 +185,13 @@ static const QHash configStrings = { {Config::PasswordGenerator_EASCII, {QS("PasswordGenerator/EASCII"), Roaming, false}}, {Config::PasswordGenerator_AdvancedMode, {QS("PasswordGenerator/AdvancedMode"), Roaming, false}}, {Config::PasswordGenerator_SpecialChars, {QS("PasswordGenerator/SpecialChars"), Roaming, true}}, - {Config::PasswordGenerator_AdditionalChars, {QS("PasswordGenerator/AdditionalChars"), Roaming, true}}, {Config::PasswordGenerator_Braces, {QS("PasswordGenerator/Braces"), Roaming, false}}, {Config::PasswordGenerator_Punctuation, {QS("PasswordGenerator/Punctuation"), Roaming, false}}, {Config::PasswordGenerator_Quotes, {QS("PasswordGenerator/Quotes"), Roaming, false}}, {Config::PasswordGenerator_Dashes, {QS("PasswordGenerator/Dashes"), Roaming, false}}, {Config::PasswordGenerator_Math, {QS("PasswordGenerator/Math"), Roaming, false}}, {Config::PasswordGenerator_Logograms, {QS("PasswordGenerator/Logograms"), Roaming, false}}, + {Config::PasswordGenerator_AdditionalChars, {QS("PasswordGenerator/AdditionalChars"), Roaming, {}}}, {Config::PasswordGenerator_ExcludedChars, {QS("PasswordGenerator/ExcludedChars"), Roaming, {}}}, {Config::PasswordGenerator_ExcludeAlike, {QS("PasswordGenerator/ExcludeAlike"), Roaming, true}}, {Config::PasswordGenerator_EnsureEvery, {QS("PasswordGenerator/EnsureEvery"), Roaming, true}}, diff --git a/src/core/Database.cpp b/src/core/Database.cpp index 30e5a565b..f3615be77 100644 --- a/src/core/Database.cpp +++ b/src/core/Database.cpp @@ -251,12 +251,13 @@ bool Database::saveAs(const QString& filePath, QString* error, bool atomic, bool setReadOnly(false); m_fileWatcher->stop(); - auto& canonicalFilePath = QFileInfo::exists(filePath) ? QFileInfo(filePath).canonicalFilePath() : filePath; - bool ok = AsyncTask::runAndWaitForFuture([&] { return performSave(canonicalFilePath, error, atomic, backup); }); + QFileInfo fileInfo(filePath); + auto realFilePath = fileInfo.exists() ? fileInfo.canonicalFilePath() : fileInfo.absoluteFilePath(); + bool ok = AsyncTask::runAndWaitForFuture([&] { return performSave(realFilePath, error, atomic, backup); }); if (ok) { markAsClean(); setFilePath(filePath); - m_fileWatcher->start(canonicalFilePath, 30, 1); + m_fileWatcher->start(realFilePath, 30, 1); } else { // Saving failed, don't rewatch file since it does not represent our database markAsModified(); diff --git a/src/core/PasswordHealth.cpp b/src/core/PasswordHealth.cpp index bb313170a..6fdbf6c36 100644 --- a/src/core/PasswordHealth.cpp +++ b/src/core/PasswordHealth.cpp @@ -142,7 +142,7 @@ QSharedPointer HealthChecker::evaluate(const Entry* entry) const for (int i = 0; i < used.size(); ++i) { health->addScoreDetails(used[i]); if (i == 19) { - health->addScoreDetails(QStringLiteral("...")); + health->addScoreDetails("…"); break; } } diff --git a/src/crypto/ssh/bcrypt_pbkdf.cpp b/src/crypto/ssh/bcrypt_pbkdf.cpp index fed4cdb29..a57e2dab1 100644 --- a/src/crypto/ssh/bcrypt_pbkdf.cpp +++ b/src/crypto/ssh/bcrypt_pbkdf.cpp @@ -82,7 +82,7 @@ bcrypt_hash(const quint8* sha2pass, const quint8* sha2salt, quint8* out) cdata[i] = Blowfish_stream2word(ciphertext, sizeof(ciphertext), &j); for (i = 0; i < 64; i++) - blf_enc(&state, cdata, sizeof(cdata) / sizeof(uint64_t)); + blf_enc(&state, cdata, BCRYPT_WORDS / 2); /* copy out */ for (i = 0; i < BCRYPT_WORDS; i++) { diff --git a/src/format/KdbxXmlReader.cpp b/src/format/KdbxXmlReader.cpp index 4ab5c9d03..ecc4111bf 100644 --- a/src/format/KdbxXmlReader.cpp +++ b/src/format/KdbxXmlReader.cpp @@ -875,11 +875,13 @@ QPair KdbxXmlReader::parseEntryBinary(Entry* entry) } if (keySet && valueSet) { - if (entry->attachments()->hasKey(key)) { - raiseError(tr("Duplicate attachment found")); - } else { - entry->attachments()->set(key, value); + if (entry->attachments()->hasKey(key) && entry->attachments()->value(key) != value) { + // NOTE: This only impacts KDBX 3.x databases + // Prepend a random string to the key to make it unique and prevent data loss + key = key.prepend(QUuid::createUuid().toString().mid(1, 8) + "_"); + qWarning("Duplicate attachment name found, renamed to: %s", qPrintable(key)); } + entry->attachments()->set(key, value); } else { raiseError(tr("Entry binary key or value missing")); } diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 18e8ac0dc..ca4898d80 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -333,7 +333,7 @@ MainWindow::MainWindow() m_ui->actionDatabaseSaveBackup->setIcon(resources()->icon("document-save-copy")); m_ui->actionDatabaseClose->setIcon(resources()->icon("document-close")); m_ui->actionReports->setIcon(resources()->icon("reports")); - m_ui->actionChangeDatabaseSettings->setIcon(resources()->icon("document-edit")); + m_ui->actionDatabaseSettings->setIcon(resources()->icon("document-edit")); m_ui->actionChangeMasterKey->setIcon(resources()->icon("database-change-key")); m_ui->actionLockDatabases->setIcon(resources()->icon("database-lock")); m_ui->actionQuit->setIcon(resources()->icon("application-exit")); @@ -413,7 +413,7 @@ MainWindow::MainWindow() connect(m_ui->actionDatabaseMerge, SIGNAL(triggered()), m_ui->tabWidget, SLOT(mergeDatabase())); connect(m_ui->actionChangeMasterKey, SIGNAL(triggered()), m_ui->tabWidget, SLOT(changeMasterKey())); connect(m_ui->actionReports, SIGNAL(triggered()), m_ui->tabWidget, SLOT(changeReports())); - connect(m_ui->actionChangeDatabaseSettings, SIGNAL(triggered()), m_ui->tabWidget, SLOT(changeDatabaseSettings())); + connect(m_ui->actionDatabaseSettings, SIGNAL(triggered()), m_ui->tabWidget, SLOT(changeDatabaseSettings())); connect(m_ui->actionImportCsv, SIGNAL(triggered()), m_ui->tabWidget, SLOT(importCsv())); connect(m_ui->actionImportKeePass1, SIGNAL(triggered()), m_ui->tabWidget, SLOT(importKeePass1Database())); connect(m_ui->actionImportOpVault, SIGNAL(triggered()), m_ui->tabWidget, SLOT(importOpVaultDatabase())); @@ -456,8 +456,11 @@ MainWindow::MainWindow() m_actionMultiplexer.connect(m_ui->actionGroupDownloadFavicons, SIGNAL(triggered()), SLOT(downloadAllFavicons())); connect(m_ui->actionSettings, SIGNAL(toggled(bool)), SLOT(switchToSettings(bool))); - connect(m_ui->actionPasswordGenerator, SIGNAL(toggled(bool)), SLOT(switchToPasswordGen(bool))); - connect(m_ui->passwordGeneratorWidget, SIGNAL(closePasswordGenerator()), SLOT(closePasswordGen())); + connect(m_ui->actionPasswordGenerator, SIGNAL(toggled(bool)), SLOT(togglePasswordGenerator(bool))); + connect(m_ui->passwordGeneratorWidget, &PasswordGeneratorWidget::closed, this, [this] { + togglePasswordGenerator(false); + }); + m_ui->passwordGeneratorWidget->setStandaloneMode(true); connect(m_ui->welcomeWidget, SIGNAL(newDatabase()), SLOT(switchToNewDatabase())); connect(m_ui->welcomeWidget, SIGNAL(openDatabase()), SLOT(switchToOpenDatabase())); @@ -719,7 +722,7 @@ void MainWindow::setMenuActionState(DatabaseWidget::Mode mode) && !recycleBinSelected); m_ui->actionChangeMasterKey->setEnabled(true); m_ui->actionReports->setEnabled(true); - m_ui->actionChangeDatabaseSettings->setEnabled(true); + m_ui->actionDatabaseSettings->setEnabled(true); m_ui->actionDatabaseSave->setEnabled(m_ui->tabWidget->canSave()); m_ui->actionDatabaseSaveAs->setEnabled(true); m_ui->actionDatabaseSaveBackup->setEnabled(true); @@ -775,7 +778,7 @@ void MainWindow::setMenuActionState(DatabaseWidget::Mode mode) m_ui->actionChangeMasterKey->setEnabled(false); m_ui->actionReports->setEnabled(false); - m_ui->actionChangeDatabaseSettings->setEnabled(false); + m_ui->actionDatabaseSettings->setEnabled(false); m_ui->actionDatabaseSave->setEnabled(false); m_ui->actionDatabaseSaveAs->setEnabled(false); m_ui->actionDatabaseSaveBackup->setEnabled(false); @@ -804,7 +807,7 @@ void MainWindow::setMenuActionState(DatabaseWidget::Mode mode) m_ui->actionChangeMasterKey->setEnabled(false); m_ui->actionReports->setEnabled(false); - m_ui->actionChangeDatabaseSettings->setEnabled(false); + m_ui->actionDatabaseSettings->setEnabled(false); m_ui->actionDatabaseSave->setEnabled(false); m_ui->actionDatabaseSaveAs->setEnabled(false); m_ui->actionDatabaseSaveBackup->setEnabled(false); @@ -990,24 +993,18 @@ void MainWindow::switchToSettings(bool enabled) } } -void MainWindow::switchToPasswordGen(bool enabled) +void MainWindow::togglePasswordGenerator(bool enabled) { if (enabled) { m_ui->passwordGeneratorWidget->loadSettings(); m_ui->passwordGeneratorWidget->regeneratePassword(); m_ui->stackedWidget->setCurrentIndex(PasswordGeneratorScreen); - m_ui->passwordGeneratorWidget->setStandaloneMode(true); } else { m_ui->passwordGeneratorWidget->saveSettings(); switchToDatabases(); } } -void MainWindow::closePasswordGen() -{ - switchToPasswordGen(false); -} - void MainWindow::switchToNewDatabase() { m_ui->tabWidget->newDatabase(); diff --git a/src/gui/MainWindow.h b/src/gui/MainWindow.h index f5d58d75e..9adc5f0cb 100644 --- a/src/gui/MainWindow.h +++ b/src/gui/MainWindow.h @@ -104,14 +104,13 @@ private slots: void openKeyboardShortcuts(); void switchToDatabases(); void switchToSettings(bool enabled); - void switchToPasswordGen(bool enabled); + void togglePasswordGenerator(bool enabled); void switchToNewDatabase(); void switchToOpenDatabase(); void switchToDatabaseFile(const QString& file); void switchToKeePass1Database(); void switchToOpVaultDatabase(); void switchToCsvImport(); - void closePasswordGen(); void databaseStatusChanged(DatabaseWidget* dbWidget); void databaseTabChanged(int tabIndex); void openRecentDatabase(QAction* action); diff --git a/src/gui/MainWindow.ui b/src/gui/MainWindow.ui index 10e29ff28..64883b142 100644 --- a/src/gui/MainWindow.ui +++ b/src/gui/MainWindow.ui @@ -13,6 +13,12 @@ 600 + + + 800 + 0 + + KeePassXC @@ -229,9 +235,9 @@ &Import - - + + @@ -248,9 +254,9 @@ - - + + @@ -381,9 +387,9 @@ - + @@ -550,7 +556,7 @@ false - &Reports... + &Database Reports... Statistics, health check, etc. @@ -559,7 +565,7 @@ QAction::NoRole - + false @@ -711,7 +717,7 @@ false - &Export to CSV File… + &CSV File… @@ -719,7 +725,7 @@ false - &Export to HTML File… + &HTML File… diff --git a/src/gui/PasswordGeneratorWidget.cpp b/src/gui/PasswordGeneratorWidget.cpp index edcf41d6f..e1c15310f 100644 --- a/src/gui/PasswordGeneratorWidget.cpp +++ b/src/gui/PasswordGeneratorWidget.cpp @@ -44,6 +44,14 @@ PasswordGeneratorWidget::PasswordGeneratorWidget(QWidget* parent) m_ui->buttonCopy->setIcon(resources()->icon("clipboard-text")); m_ui->buttonClose->setShortcut(Qt::Key_Escape); + m_ui->clearInclude->setIcon(resources()->icon("edit-clear-locationbar-rtl")); + m_ui->editAdditionalChars->addAction(m_ui->clearInclude, QLineEdit::TrailingPosition); + m_ui->clearInclude->setVisible(false); + + m_ui->clearExclude->setIcon(resources()->icon("edit-clear-locationbar-rtl")); + m_ui->editExcludedChars->addAction(m_ui->clearExclude, QLineEdit::TrailingPosition); + m_ui->clearExclude->setVisible(false); + connect(m_ui->editNewPassword, SIGNAL(textChanged(QString)), SLOT(updateButtonsEnabled(QString))); connect(m_ui->editNewPassword, SIGNAL(textChanged(QString)), SLOT(updatePasswordStrength(QString))); connect(m_ui->buttonAdvancedMode, SIGNAL(toggled(bool)), SLOT(setAdvancedMode(bool))); @@ -53,7 +61,9 @@ PasswordGeneratorWidget::PasswordGeneratorWidget(QWidget* parent) connect(m_ui->buttonApply, SIGNAL(clicked()), SLOT(applyPassword())); connect(m_ui->buttonCopy, SIGNAL(clicked()), SLOT(copyPassword())); connect(m_ui->buttonGenerate, SIGNAL(clicked()), SLOT(regeneratePassword())); - connect(m_ui->buttonClose, SIGNAL(clicked()), SIGNAL(closePasswordGenerator())); + connect(m_ui->buttonClose, SIGNAL(clicked()), SIGNAL(closed())); + connect(m_ui->clearInclude, SIGNAL(triggered(bool)), m_ui->editAdditionalChars, SLOT(clear())); + connect(m_ui->clearExclude, SIGNAL(triggered(bool)), m_ui->editExcludedChars, SLOT(clear())); connect(m_ui->sliderLength, SIGNAL(valueChanged(int)), SLOT(passwordLengthChanged(int))); connect(m_ui->spinBoxLength, SIGNAL(valueChanged(int)), SLOT(passwordLengthChanged(int))); @@ -110,7 +120,7 @@ PasswordGeneratorWidget* PasswordGeneratorWidget::popupGenerator(QWidget* parent pwGenerator->setWindowFlags(Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint); pwGenerator->setStandaloneMode(false); - connect(pwGenerator, SIGNAL(closePasswordGenerator()), pwGenerator, SLOT(deleteLater())); + connect(pwGenerator, SIGNAL(closed()), pwGenerator, SLOT(deleteLater())); pwGenerator->show(); pwGenerator->raise(); @@ -180,6 +190,7 @@ void PasswordGeneratorWidget::saveSettings() config()->set(Config::PasswordGenerator_Dashes, m_ui->checkBoxDashes->isChecked()); config()->set(Config::PasswordGenerator_Math, m_ui->checkBoxMath->isChecked()); config()->set(Config::PasswordGenerator_Logograms, m_ui->checkBoxLogograms->isChecked()); + config()->set(Config::PasswordGenerator_AdditionalChars, m_ui->editAdditionalChars->text()); config()->set(Config::PasswordGenerator_ExcludedChars, m_ui->editExcludedChars->text()); config()->set(Config::PasswordGenerator_ExcludeAlike, m_ui->checkBoxExcludeAlike->isChecked()); config()->set(Config::PasswordGenerator_EnsureEvery, m_ui->checkBoxEnsureEvery->isChecked()); @@ -220,15 +231,6 @@ QString PasswordGeneratorWidget::getGeneratedPassword() return m_ui->editNewPassword->text(); } -void PasswordGeneratorWidget::keyPressEvent(QKeyEvent* e) -{ - if (e->key() == Qt::Key_Escape && m_standalone) { - emit closePasswordGenerator(); - } else { - e->ignore(); - } -} - void PasswordGeneratorWidget::regeneratePassword() { if (m_ui->tabWidget->currentIndex() == Password) { @@ -273,7 +275,7 @@ void PasswordGeneratorWidget::applyPassword() { saveSettings(); emit appliedPassword(m_ui->editNewPassword->text()); - emit closePasswordGenerator(); + emit closed(); } void PasswordGeneratorWidget::copyPassword() @@ -534,6 +536,9 @@ void PasswordGeneratorWidget::updateGenerator() } else { m_ui->buttonGenerate->setEnabled(false); } + + m_ui->clearInclude->setVisible(!m_ui->editAdditionalChars->text().isEmpty()); + m_ui->clearExclude->setVisible(!m_ui->editExcludedChars->text().isEmpty()); } else { m_dicewareGenerator->setWordCase( static_cast(m_ui->wordCaseComboBox->currentData().toInt())); diff --git a/src/gui/PasswordGeneratorWidget.h b/src/gui/PasswordGeneratorWidget.h index 59de40986..08409ed22 100644 --- a/src/gui/PasswordGeneratorWidget.h +++ b/src/gui/PasswordGeneratorWidget.h @@ -64,7 +64,7 @@ public slots: signals: void appliedPassword(const QString& password); - void closePasswordGenerator(); + void closed(); private slots: void updateButtonsEnabled(const QString& password); @@ -87,9 +87,6 @@ private: const QScopedPointer m_passwordGenerator; const QScopedPointer m_dicewareGenerator; const QScopedPointer m_ui; - -protected: - void keyPressEvent(QKeyEvent* e) override; }; #endif // KEEPASSX_PASSWORDGENERATORWIDGET_H diff --git a/src/gui/PasswordGeneratorWidget.ui b/src/gui/PasswordGeneratorWidget.ui index 9323590f0..17b2432e5 100644 --- a/src/gui/PasswordGeneratorWidget.ui +++ b/src/gui/PasswordGeneratorWidget.ui @@ -870,9 +870,6 @@ QProgressBar::chunk { Additional characters - - true - @@ -895,9 +892,6 @@ QProgressBar::chunk { Excluded characters - - true - @@ -1152,6 +1146,9 @@ QProgressBar::chunk { Close + + Esc + @@ -1159,6 +1156,9 @@ QProgressBar::chunk { Apply Password + + Ctrl+S + true @@ -1183,6 +1183,22 @@ QProgressBar::chunk { + + + Clear + + + Clear + + + + + Clear + + + Clear + + diff --git a/src/gui/entry/EntryModel.cpp b/src/gui/entry/EntryModel.cpp index 6438f8ed1..0b766c854 100644 --- a/src/gui/entry/EntryModel.cpp +++ b/src/gui/entry/EntryModel.cpp @@ -185,14 +185,16 @@ QVariant EntryModel::data(const QModelIndex& index, int role) const } return result; case Notes: - // Display only first line of notes in simplified format if not hidden - if (config()->get(Config::Security_HideNotes).toBool()) { - result = EntryModel::HiddenContentDisplay; - } else { - result = entry->notes().section("\n", 0, 0).simplified(); - } - if (attr->isReference(EntryAttributes::NotesKey)) { - result.prepend(tr("Ref: ", "Reference abbreviation")); + if (!entry->notes().isEmpty()) { + if (config()->get(Config::Security_HideNotes).toBool()) { + result = EntryModel::HiddenContentDisplay; + } else { + // Display only first line of notes in simplified format if not hidden + result = entry->notes().section("\n", 0, 0).simplified(); + } + if (attr->isReference(EntryAttributes::NotesKey)) { + result.prepend(tr("Ref: ", "Reference abbreviation")); + } } return result; case Expires: diff --git a/src/gui/reports/ReportsWidgetHealthcheck.cpp b/src/gui/reports/ReportsWidgetHealthcheck.cpp index 00194e182..9e1cf1812 100644 --- a/src/gui/reports/ReportsWidgetHealthcheck.cpp +++ b/src/gui/reports/ReportsWidgetHealthcheck.cpp @@ -126,8 +126,9 @@ ReportsWidgetHealthcheck::ReportsWidgetHealthcheck(QWidget* parent) m_ui->healthcheckTableView->setModel(m_referencesModel.data()); m_ui->healthcheckTableView->setSelectionMode(QAbstractItemView::NoSelection); m_ui->healthcheckTableView->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents); - connect(m_ui->healthcheckTableView, SIGNAL(customContextMenuRequested(QPoint)), SLOT(customMenuRequested(QPoint))); + m_ui->healthcheckTableView->setSortingEnabled(true); + connect(m_ui->healthcheckTableView, SIGNAL(customContextMenuRequested(QPoint)), SLOT(customMenuRequested(QPoint))); connect(m_ui->healthcheckTableView, SIGNAL(doubleClicked(QModelIndex)), SLOT(emitEntryActivated(QModelIndex))); connect(m_ui->showKnownBadCheckBox, SIGNAL(stateChanged(int)), this, SLOT(calculateHealth())); } diff --git a/src/gui/reports/ReportsWidgetHealthcheck.ui b/src/gui/reports/ReportsWidgetHealthcheck.ui index 38359a881..72e4fc328 100644 --- a/src/gui/reports/ReportsWidgetHealthcheck.ui +++ b/src/gui/reports/ReportsWidgetHealthcheck.ui @@ -43,9 +43,6 @@ false - - false - true diff --git a/src/gui/reports/ReportsWidgetHibp.cpp b/src/gui/reports/ReportsWidgetHibp.cpp index 3678c2932..48e3946a4 100644 --- a/src/gui/reports/ReportsWidgetHibp.cpp +++ b/src/gui/reports/ReportsWidgetHibp.cpp @@ -56,6 +56,7 @@ ReportsWidgetHibp::ReportsWidgetHibp(QWidget* parent) m_ui->hibpTableView->setModel(m_referencesModel.data()); m_ui->hibpTableView->setSelectionMode(QAbstractItemView::NoSelection); m_ui->hibpTableView->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents); + m_ui->hibpTableView->setSortingEnabled(true); connect(m_ui->hibpTableView, SIGNAL(doubleClicked(QModelIndex)), SLOT(emitEntryActivated(QModelIndex))); connect(m_ui->hibpTableView, SIGNAL(customContextMenuRequested(QPoint)), SLOT(customMenuRequested(QPoint))); diff --git a/src/gui/reports/ReportsWidgetHibp.ui b/src/gui/reports/ReportsWidgetHibp.ui index 3de67a817..94582e8cd 100644 --- a/src/gui/reports/ReportsWidgetHibp.ui +++ b/src/gui/reports/ReportsWidgetHibp.ui @@ -157,9 +157,6 @@ false - - false - true diff --git a/src/keeshare/ShareImport.cpp b/src/keeshare/ShareImport.cpp index 9b05465f9..a767ab3aa 100644 --- a/src/keeshare/ShareImport.cpp +++ b/src/keeshare/ShareImport.cpp @@ -233,8 +233,8 @@ namespace return {}; } default: - Q_ASSERT(false); - return {reference.path, ShareObserver::Result::Error, ShareImport::tr("Unexpected error")}; + qWarning("Prevented untrusted import of signed KeeShare database %s", qPrintable(reference.path)); + return {reference.path, ShareObserver::Result::Warning, ShareImport::tr("Untrusted import prevented")}; } #endif } @@ -323,7 +323,7 @@ namespace return {}; } default: - qWarning("Prevent untrusted import"); + qWarning("Prevented untrusted import of unsigned KeeShare database %s", qPrintable(reference.path)); return {reference.path, ShareObserver::Result::Warning, ShareImport::tr("Untrusted import prevented")}; } #endif diff --git a/src/sshagent/SSHAgent.cpp b/src/sshagent/SSHAgent.cpp index 0fe555021..20284c685 100644 --- a/src/sshagent/SSHAgent.cpp +++ b/src/sshagent/SSHAgent.cpp @@ -387,7 +387,7 @@ bool SSHAgent::checkIdentity(const OpenSSHKey& key, bool& loaded) loaded = false; - for (const auto it : list) { + for (const auto& it : list) { if (*it == key) { loaded = true; break; diff --git a/tests/gui/TestGui.cpp b/tests/gui/TestGui.cpp index f47a013eb..ec65dbba1 100644 --- a/tests/gui/TestGui.cpp +++ b/tests/gui/TestGui.cpp @@ -189,7 +189,7 @@ void TestGui::testSettingsDefaultTabOrder() QTest::keyClick(settingsWidget, Qt::Key::Key_Escape); // check database settings default tab order - triggerAction("actionChangeDatabaseSettings"); + triggerAction("actionDatabaseSettings"); auto* dbSettingsWidget = m_mainWindow->findChild(); QVERIFY(dbSettingsWidget->isVisible()); QCOMPARE(dbSettingsWidget->findChild("categoryList")->currentCategory(), 0); @@ -1257,7 +1257,7 @@ void TestGui::testSave() void TestGui::testDatabaseSettings() { m_db->metadata()->setName("testDatabaseSettings"); - triggerAction("actionChangeDatabaseSettings"); + triggerAction("actionDatabaseSettings"); auto* dbSettingsDialog = m_dbWidget->findChild("databaseSettingsDialog"); auto* transformRoundsSpinBox = dbSettingsDialog->findChild("transformRoundsSpinBox"); auto advancedToggle = dbSettingsDialog->findChild("advancedSettingsToggle");