Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/keepassxreboot/keepassxc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/Config.cpp6
-rw-r--r--src/core/Database.cpp7
-rw-r--r--src/core/PasswordHealth.cpp2
-rw-r--r--src/crypto/ssh/bcrypt_pbkdf.cpp2
-rw-r--r--src/format/KdbxXmlReader.cpp10
-rw-r--r--src/gui/MainWindow.cpp25
-rw-r--r--src/gui/MainWindow.h3
-rw-r--r--src/gui/MainWindow.ui24
-rw-r--r--src/gui/PasswordGeneratorWidget.cpp29
-rw-r--r--src/gui/PasswordGeneratorWidget.h5
-rw-r--r--src/gui/PasswordGeneratorWidget.ui28
-rw-r--r--src/gui/entry/EntryModel.cpp18
-rw-r--r--src/gui/reports/ReportsWidgetHealthcheck.cpp3
-rw-r--r--src/gui/reports/ReportsWidgetHealthcheck.ui3
-rw-r--r--src/gui/reports/ReportsWidgetHibp.cpp1
-rw-r--r--src/gui/reports/ReportsWidgetHibp.ui3
-rw-r--r--src/keeshare/ShareImport.cpp6
-rw-r--r--src/sshagent/SSHAgent.cpp2
-rw-r--r--tests/gui/TestGui.cpp4
19 files changed, 101 insertions, 80 deletions
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<Config::ConfigKey, ConfigDirective> 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<Config::ConfigKey, ConfigDirective> 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<Config::ConfigKey, ConfigDirective> 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<Config::ConfigKey, ConfigDirective> 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<PasswordHealth> 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<QString, QString> 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 @@
<height>600</height>
</rect>
</property>
+ <property name="minimumSize">
+ <size>
+ <width>800</width>
+ <height>0</height>
+ </size>
+ </property>
<property name="windowTitle">
<string notr="true">KeePassXC</string>
</property>
@@ -229,9 +235,9 @@
<property name="title">
<string>&amp;Import</string>
</property>
- <addaction name="actionImportKeePass1"/>
- <addaction name="actionImportOpVault"/>
<addaction name="actionImportCsv"/>
+ <addaction name="actionImportOpVault"/>
+ <addaction name="actionImportKeePass1"/>
</widget>
<widget class="QMenu" name="menuExport">
<property name="title">
@@ -248,9 +254,9 @@
<addaction name="actionDatabaseSaveBackup"/>
<addaction name="actionDatabaseClose"/>
<addaction name="separator"/>
- <addaction name="actionChangeMasterKey"/>
<addaction name="actionReports"/>
- <addaction name="actionChangeDatabaseSettings"/>
+ <addaction name="actionDatabaseSettings"/>
+ <addaction name="actionChangeMasterKey"/>
<addaction name="separator"/>
<addaction name="actionDatabaseMerge"/>
<addaction name="menuImport"/>
@@ -381,9 +387,9 @@
<addaction name="actionEntryCopyURL"/>
<addaction name="actionEntryAutoType"/>
<addaction name="separator"/>
- <addaction name="actionPasswordGenerator"/>
<addaction name="actionLockDatabases"/>
<addaction name="separator"/>
+ <addaction name="actionPasswordGenerator"/>
<addaction name="actionSettings"/>
<addaction name="separator"/>
</widget>
@@ -550,7 +556,7 @@
<bool>false</bool>
</property>
<property name="text">
- <string>&amp;Reports...</string>
+ <string>&amp;Database Reports...</string>
</property>
<property name="toolTip">
<string>Statistics, health check, etc.</string>
@@ -559,7 +565,7 @@
<enum>QAction::NoRole</enum>
</property>
</action>
- <action name="actionChangeDatabaseSettings">
+ <action name="actionDatabaseSettings">
<property name="enabled">
<bool>false</bool>
</property>
@@ -711,7 +717,7 @@
<bool>false</bool>
</property>
<property name="text">
- <string>&amp;Export to CSV File…</string>
+ <string>&amp;CSV File…</string>
</property>
</action>
<action name="actionExportHtml">
@@ -719,7 +725,7 @@
<bool>false</bool>
</property>
<property name="text">
- <string>&amp;Export to HTML File…</string>
+ <string>&amp;HTML File…</string>
</property>
</action>
<action name="actionImportKeePass1">
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<PassphraseGenerator::PassphraseWordCase>(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<PasswordGenerator> m_passwordGenerator;
const QScopedPointer<PassphraseGenerator> m_dicewareGenerator;
const QScopedPointer<Ui::PasswordGeneratorWidget> 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 {
<property name="accessibleName">
<string>Additional characters</string>
</property>
- <property name="clearButtonEnabled">
- <bool>true</bool>
- </property>
</widget>
</item>
<item row="1" column="1">
@@ -895,9 +892,6 @@ QProgressBar::chunk {
<property name="accessibleName">
<string>Excluded characters</string>
</property>
- <property name="clearButtonEnabled">
- <bool>true</bool>
- </property>
</widget>
</item>
<item row="1" column="0">
@@ -1152,6 +1146,9 @@ QProgressBar::chunk {
<property name="text">
<string>Close</string>
</property>
+ <property name="shortcut">
+ <string>Esc</string>
+ </property>
</widget>
</item>
<item>
@@ -1159,6 +1156,9 @@ QProgressBar::chunk {
<property name="text">
<string>Apply Password</string>
</property>
+ <property name="shortcut">
+ <string>Ctrl+S</string>
+ </property>
<property name="default">
<bool>true</bool>
</property>
@@ -1183,6 +1183,22 @@ QProgressBar::chunk {
</spacer>
</item>
</layout>
+ <action name="clearInclude">
+ <property name="text">
+ <string>Clear</string>
+ </property>
+ <property name="toolTip">
+ <string>Clear</string>
+ </property>
+ </action>
+ <action name="clearExclude">
+ <property name="text">
+ <string>Clear</string>
+ </property>
+ <property name="toolTip">
+ <string>Clear</string>
+ </property>
+ </action>
</widget>
<customwidgets>
<customwidget>
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 @@
<property name="sortingEnabled">
<bool>false</bool>
</property>
- <attribute name="horizontalHeaderVisible">
- <bool>false</bool>
- </attribute>
<attribute name="horizontalHeaderStretchLastSection">
<bool>true</bool>
</attribute>
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 @@
<property name="sortingEnabled">
<bool>false</bool>
</property>
- <attribute name="horizontalHeaderVisible">
- <bool>false</bool>
- </attribute>
<attribute name="horizontalHeaderStretchLastSection">
<bool>true</bool>
</attribute>
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<DatabaseSettingsDialog*>();
QVERIFY(dbSettingsWidget->isVisible());
QCOMPARE(dbSettingsWidget->findChild<CategoryListWidget*>("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<QWidget*>("databaseSettingsDialog");
auto* transformRoundsSpinBox = dbSettingsDialog->findChild<QSpinBox*>("transformRoundsSpinBox");
auto advancedToggle = dbSettingsDialog->findChild<QCheckBox*>("advancedSettingsToggle");