From db9fc57a377113f9af33855ed3d0df0e1cf99558 Mon Sep 17 00:00:00 2001 From: Jonathan White Date: Tue, 8 Jun 2021 18:57:15 -0400 Subject: [PATCH 1/7] Fix compilation on macOS --- src/gui/osutils/macutils/AppKitImpl.mm | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/gui/osutils/macutils/AppKitImpl.mm b/src/gui/osutils/macutils/AppKitImpl.mm index 31362c8e62..fa52693b4f 100644 --- a/src/gui/osutils/macutils/AppKitImpl.mm +++ b/src/gui/osutils/macutils/AppKitImpl.mm @@ -17,13 +17,8 @@ */ #import "AppKitImpl.h" -#include "AppKit.h" - -#import -#import -#import -#import -#import +#import +#import @implementation AppKitImpl From c661fa331fa5686a7f3c595233953cc2d5870c24 Mon Sep 17 00:00:00 2001 From: Jonathan White Date: Tue, 8 Jun 2021 18:50:14 -0400 Subject: [PATCH 2/7] Fix focusing search using Ctrl + F * Fixes #6600 - error exists only on master branch due to poor cherrypick merge --- src/gui/SearchWidget.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/gui/SearchWidget.cpp b/src/gui/SearchWidget.cpp index 4cf53a9acb..9498e4507c 100644 --- a/src/gui/SearchWidget.cpp +++ b/src/gui/SearchWidget.cpp @@ -51,9 +51,6 @@ SearchWidget::SearchWidget(QWidget* parent) connect(m_clearSearchTimer, SIGNAL(timeout()), SLOT(clearSearch())); connect(this, SIGNAL(escapePressed()), SLOT(clearSearch())); - new QShortcut(QKeySequence::Find, this, SLOT(searchFocus()), nullptr, Qt::ApplicationShortcut); - new QShortcut(Qt::Key_Escape, m_ui->searchEdit, SLOT(clear()), nullptr, Qt::ApplicationShortcut); - m_ui->searchEdit->setPlaceholderText(tr("Search (%1)...", "Search placeholder text, %1 is the keyboard shortcut") .arg(QKeySequence(QKeySequence::Find).toString(QKeySequence::NativeText))); m_ui->searchEdit->installEventFilter(this); From 9e2399adf4f797d3e76e794b6815de79f26c2bb6 Mon Sep 17 00:00:00 2001 From: Jonathan White Date: Tue, 8 Jun 2021 22:55:53 -0400 Subject: [PATCH 3/7] Resolve compiler warnings for unused return values * Fixes #1932 - See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425#c29 Adding a negation before the function call allows the (void) syntax to work properly. --- src/gui/Application.cpp | 4 ++-- tests/TestKeys.cpp | 2 +- tests/gui/TestGui.cpp | 13 +++---------- tests/gui/TestGui.h | 2 +- 4 files changed, 7 insertions(+), 14 deletions(-) diff --git a/src/gui/Application.cpp b/src/gui/Application.cpp index 973e290320..273b662ec6 100644 --- a/src/gui/Application.cpp +++ b/src/gui/Application.cpp @@ -235,7 +235,7 @@ void Application::handleUnixSignal(int sig) case SIGINT: case SIGTERM: { char buf = 0; - Q_UNUSED(::write(unixSignalSocket[0], &buf, sizeof(buf))); + Q_UNUSED(!::write(unixSignalSocket[0], &buf, sizeof(buf))); return; } case SIGHUP: @@ -247,7 +247,7 @@ void Application::quitBySignal() { m_unixSignalNotifier->setEnabled(false); char buf; - Q_UNUSED(::read(unixSignalSocket[1], &buf, sizeof(buf))); + Q_UNUSED(!::read(unixSignalSocket[1], &buf, sizeof(buf))); emit quitSignalReceived(); } #endif diff --git a/tests/TestKeys.cpp b/tests/TestKeys.cpp index cbbaae3982..9fa75f7951 100644 --- a/tests/TestKeys.cpp +++ b/tests/TestKeys.cpp @@ -235,7 +235,7 @@ void TestKeys::benchmarkTransformKey() QBENCHMARK { - Q_UNUSED(compositeKey->transform(kdf, result)); + Q_UNUSED(!compositeKey->transform(kdf, result)); }; } diff --git a/tests/gui/TestGui.cpp b/tests/gui/TestGui.cpp index 65ca319bca..0de8be3599 100644 --- a/tests/gui/TestGui.cpp +++ b/tests/gui/TestGui.cpp @@ -853,7 +853,7 @@ void TestGui::testTotp() void TestGui::testSearch() { // Add canned entries for consistent testing - Q_UNUSED(addCannedEntries()); + addCannedEntries(); auto* toolBar = m_mainWindow->findChild("toolBar"); @@ -1007,7 +1007,7 @@ void TestGui::testSearch() void TestGui::testDeleteEntry() { // Add canned entries for consistent testing - Q_UNUSED(addCannedEntries()); + addCannedEntries(); auto* groupView = m_dbWidget->findChild("groupView"); auto* entryView = m_dbWidget->findChild("entryView"); @@ -1673,10 +1673,8 @@ void TestGui::testAutoType() entryView->selectionModel()->clearSelection(); } -int TestGui::addCannedEntries() +void TestGui::addCannedEntries() { - int entries_added = 0; - // Find buttons auto* toolBar = m_mainWindow->findChild("toolBar"); QWidget* entryNewWidget = toolBar->widgetForAction(m_mainWindow->findChild("actionEntryNew")); @@ -1689,22 +1687,17 @@ int TestGui::addCannedEntries() QTest::keyClicks(titleEdit, "test"); auto* editEntryWidgetButtonBox = editEntryWidget->findChild("buttonBox"); QTest::mouseClick(editEntryWidgetButtonBox->button(QDialogButtonBox::Ok), Qt::LeftButton); - ++entries_added; // Add entry "something 2" QTest::mouseClick(entryNewWidget, Qt::LeftButton); QTest::keyClicks(titleEdit, "something 2"); QTest::keyClicks(passwordEdit, "something 2"); QTest::mouseClick(editEntryWidgetButtonBox->button(QDialogButtonBox::Ok), Qt::LeftButton); - ++entries_added; // Add entry "something 3" QTest::mouseClick(entryNewWidget, Qt::LeftButton); QTest::keyClicks(titleEdit, "something 3"); QTest::mouseClick(editEntryWidgetButtonBox->button(QDialogButtonBox::Ok), Qt::LeftButton); - ++entries_added; - - return entries_added; } void TestGui::checkDatabase(QString dbFileName) diff --git a/tests/gui/TestGui.h b/tests/gui/TestGui.h index 5bfc042655..b41e222271 100644 --- a/tests/gui/TestGui.h +++ b/tests/gui/TestGui.h @@ -72,7 +72,7 @@ private slots: void testTrayRestoreHide(); private: - int addCannedEntries(); + void addCannedEntries(); void checkDatabase(QString dbFileName = ""); void triggerAction(const QString& name); void dragAndDropGroup(const QModelIndex& sourceIndex, From 6422fe5ca5354c99906fde406dff1e28d911bf28 Mon Sep 17 00:00:00 2001 From: Jonathan White Date: Tue, 8 Jun 2021 19:03:07 -0400 Subject: [PATCH 4/7] Trim TOTP key input of whitespace prior to processing * Fixes #6599 --- src/gui/TotpSetupDialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/TotpSetupDialog.cpp b/src/gui/TotpSetupDialog.cpp index b350bedc42..1d403a17c2 100644 --- a/src/gui/TotpSetupDialog.cpp +++ b/src/gui/TotpSetupDialog.cpp @@ -46,7 +46,7 @@ void TotpSetupDialog::saveSettings() { // Secret key sanity check // Convert user input to all uppercase and remove '=' - auto key = m_ui->seedEdit->text().toUpper().remove(" ").remove("=").toLatin1(); + auto key = m_ui->seedEdit->text().toUpper().remove(" ").remove("=").trimmed().toLatin1(); auto sanitizedKey = Base32::sanitizeInput(key); // Use startsWith to ignore added '=' for padding at the end if (!sanitizedKey.startsWith(key)) { From 4bdc2539f9fea0f9ac2f15d82eb8bba111f0bc04 Mon Sep 17 00:00:00 2001 From: Jonathan White Date: Thu, 10 Jun 2021 23:17:49 -0400 Subject: [PATCH 5/7] Improve testdatabase performance --- tests/TestDatabase.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/TestDatabase.cpp b/tests/TestDatabase.cpp index c3a3a8c429..8ec4a1bd74 100644 --- a/tests/TestDatabase.cpp +++ b/tests/TestDatabase.cpp @@ -23,6 +23,7 @@ #include "config-keepassx-tests.h" #include "core/Metadata.h" +#include "core/Tools.h" #include "crypto/Crypto.h" #include "format/KeePass2Writer.h" #include "keys/PasswordKey.h" @@ -118,6 +119,9 @@ void TestDatabase::testSignals() QVERIFY(db->save(&error)); QCOMPARE(spySaved.count(), 1); + // Short delay to allow file system settling to reduce test failures + Tools::wait(100); + QSignalSpy spyFileChanged(db.data(), SIGNAL(databaseFileChanged())); QVERIFY(tempFile.copyFromFile(dbFileName)); QTRY_COMPARE(spyFileChanged.count(), 1); From faf48d0b0234dd3b1aab4ccda1a5cf0bcd253e8d Mon Sep 17 00:00:00 2001 From: Jonathan White Date: Fri, 11 Jun 2021 22:08:50 -0400 Subject: [PATCH 6/7] Version bump to 2.6.6 --- CHANGELOG.md | 9 +++++++++ CMakeLists.txt | 2 +- share/linux/org.keepassxc.KeePassXC.appdata.xml | 10 ++++++++++ snap/snapcraft.yaml | 2 +- 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e21063e5fd..948532f55f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 2.6.6 (2021-06-11) + +### Fixed + +- Fix focusing search when pressing hotkey [#6603] +- Trim whitespace from TOTP key input prior to processing [#6604] +- Fix building on macOS [#6598] +- Resolve compiler warnings for unused return values [#6607] + ## 2.6.5 (2021-06-07) ### Added diff --git a/CMakeLists.txt b/CMakeLists.txt index dd7861cf16..401ab6290f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -101,7 +101,7 @@ endif() set(KEEPASSXC_VERSION_MAJOR "2") set(KEEPASSXC_VERSION_MINOR "6") -set(KEEPASSXC_VERSION_PATCH "5") +set(KEEPASSXC_VERSION_PATCH "6") set(KEEPASSXC_VERSION "${KEEPASSXC_VERSION_MAJOR}.${KEEPASSXC_VERSION_MINOR}.${KEEPASSXC_VERSION_PATCH}") set(OVERRIDE_VERSION "" CACHE STRING "Override the KeePassXC Version for Snapshot builds") diff --git a/share/linux/org.keepassxc.KeePassXC.appdata.xml b/share/linux/org.keepassxc.KeePassXC.appdata.xml index fb9eb6f0c8..a91f7b6a48 100644 --- a/share/linux/org.keepassxc.KeePassXC.appdata.xml +++ b/share/linux/org.keepassxc.KeePassXC.appdata.xml @@ -50,6 +50,16 @@ + + +
    +
  • Fix focusing search when pressing hotkey [#6603]
  • +
  • Trim whitespace from TOTP key input prior to processing [#6604]
  • +
  • Fix building on macOS [#6598]
  • +
  • Resolve compiler warnings for unused return values [#6607]
  • +
+
+
    diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 822b103985..5cc73a1271 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -1,5 +1,5 @@ name: keepassxc -version: 2.6.5 +version: 2.6.6 grade: stable summary: Community-driven port of the Windows application “KeePass Password Safe” description: | From 596821ca0d1be143a16501bc978feeb801db6f79 Mon Sep 17 00:00:00 2001 From: Jonathan White Date: Fri, 11 Jun 2021 22:13:32 -0400 Subject: [PATCH 7/7] Update translations --- share/translations/keepassx_el.ts | 4 ++-- share/translations/keepassx_hu.ts | 16 ++++++++-------- share/translations/keepassx_zh_TW.ts | 16 ++++++++-------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/share/translations/keepassx_el.ts b/share/translations/keepassx_el.ts index ea0d138a5c..8d14def4ec 100644 --- a/share/translations/keepassx_el.ts +++ b/share/translations/keepassx_el.ts @@ -4705,11 +4705,11 @@ Expect some bugs and minor issues, this version is not meant for production use. Database &Security… - Βάση Δεδομένων & Ασφάλεια... + Ασφάλεια Βάσης Δεδομένων... Database &Reports... - Βάση Δεδομένων & Αναφορές... + Αναφορές Βάσης Δεδομένων... Statistics, health check, etc. diff --git a/share/translations/keepassx_hu.ts b/share/translations/keepassx_hu.ts index c14164f8fb..e5d65205d7 100644 --- a/share/translations/keepassx_hu.ts +++ b/share/translations/keepassx_hu.ts @@ -4405,15 +4405,15 @@ Valóban folytatható a művelet ezzel a fájllal? Generate a new key file or choose an existing one to protect your database. - + Új kulcsfájl generálása vagy egy meglévő kulcsfájl kijelölése az adatbázis védelméhez. Note: Do NOT use a file that may change as that will prevent you from unlocking your database. - + Megjegyzés: NEM szabad olyan fájlt használni, amely megváltozhat, mivel ez megakadályozza az adatbázis feloldását! Browse… - + Tallózás… @@ -5515,7 +5515,7 @@ Néhány hiba és kisebb nehézségek várhatóak, ezért ez a verzió nem aján Excluded characters: "0", "O", "1", "l", "I", "|", "G", "6", "B", "8", "﹒" - + Kihagyott karakterek: „0”, „O”, „1”, „l”, „I”, „|”, „G”, „6”, „B”, „8”, „﹒” @@ -6792,19 +6792,19 @@ Fontolja meg, hogy új kulcsfájlt állítson elő. Clearing the clipboard in %1 second(s)… - + Vágólap törlése %1 másodperc múlva…Vágólap törlése %1 másodperc múlva… lock all open databases - + Összes nyitott adatbázis zárolása Locked databases. - + Zárolt adatbázisok. Database failed to lock. - + Adatbázis-zárolás sikertelen. diff --git a/share/translations/keepassx_zh_TW.ts b/share/translations/keepassx_zh_TW.ts index d3e938f2b6..472a5be530 100644 --- a/share/translations/keepassx_zh_TW.ts +++ b/share/translations/keepassx_zh_TW.ts @@ -4404,15 +4404,15 @@ Are you sure you want to continue with this file? Generate a new key file or choose an existing one to protect your database. - + 產生新金鑰檔或選擇既有金鑰以保護您的資料庫。 Note: Do NOT use a file that may change as that will prevent you from unlocking your database. - + 注意:請勿使用可變動的檔案,否則將導致資料庫無法解鎖。 Browse… - + 瀏覽… @@ -5515,7 +5515,7 @@ Expect some bugs and minor issues, this version is not meant for production use. Excluded characters: "0", "O", "1", "l", "I", "|", "G", "6", "B", "8", "﹒" - + 排除以下字元:"0", "O", "1", "l", "I", "|", "G", "6", "B", "8", "﹒" @@ -6792,19 +6792,19 @@ Please consider generating a new key file. Clearing the clipboard in %1 second(s)… - + 將於 %1 秒後清空剪貼簿... lock all open databases - + 鎖定所有開啟的資料庫 Locked databases. - + 已鎖定的資料庫。 Database failed to lock. - + 資料庫鎖定失敗。