From 4091d0768f542fc9b6d4c505618ba79a57f4fd92 Mon Sep 17 00:00:00 2001 From: Henk de Bot Date: Sat, 16 May 2026 01:34:36 +0200 Subject: [PATCH 1/3] refactor(test/mainwindow): use QDir::filePath() for .gpg-id path construction QDir(dir).filePath(name) handles separator normalisation intrinsically and is more idiomatic Qt than manual string concatenation + cleanPath. Co-Authored-By: Claude Sonnet 4.6 --- tests/auto/mainwindow/tst_mainwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/mainwindow/tst_mainwindow.cpp b/tests/auto/mainwindow/tst_mainwindow.cpp index 9d5566529..77e218cd7 100644 --- a/tests/auto/mainwindow/tst_mainwindow.cpp +++ b/tests/auto/mainwindow/tst_mainwindow.cpp @@ -65,7 +65,7 @@ void tst_mainwindow::initTestCase() { QVERIFY2(m_storeDir.isValid(), "temp store dir must be created"); // Minimal valid pass store: just a .gpg-id file - QFile gpgId(QDir::cleanPath(m_storeDir.path() + QStringLiteral("/.gpg-id"))); + QFile gpgId(QDir(m_storeDir.path()).filePath(QStringLiteral(".gpg-id"))); QVERIFY2(gpgId.open(QIODevice::WriteOnly), ".gpg-id must be writable"); gpgId.write("0000000000000000\n"); gpgId.close(); From 3fe3ba803d9b7aa7dd76105e1b55d8a9bbbcee3c Mon Sep 17 00:00:00 2001 From: "coderabbitai[bot]" <136622811+coderabbitai[bot]@users.noreply.github.com> Date: Fri, 15 May 2026 23:38:51 +0000 Subject: [PATCH 2/3] fix: apply CodeRabbit auto-fixes Fixed 1 file(s) based on 1 unresolved review comment. Co-authored-by: CodeRabbit --- tests/auto/mainwindow/tst_mainwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/mainwindow/tst_mainwindow.cpp b/tests/auto/mainwindow/tst_mainwindow.cpp index 77e218cd7..8838aff39 100644 --- a/tests/auto/mainwindow/tst_mainwindow.cpp +++ b/tests/auto/mainwindow/tst_mainwindow.cpp @@ -65,7 +65,7 @@ void tst_mainwindow::initTestCase() { QVERIFY2(m_storeDir.isValid(), "temp store dir must be created"); // Minimal valid pass store: just a .gpg-id file - QFile gpgId(QDir(m_storeDir.path()).filePath(QStringLiteral(".gpg-id"))); + QFile gpgId(QDir::cleanPath(QDir(m_storeDir.path()).filePath(QStringLiteral(".gpg-id")))); QVERIFY2(gpgId.open(QIODevice::WriteOnly), ".gpg-id must be writable"); gpgId.write("0000000000000000\n"); gpgId.close(); From bfbbedf0dc3e9564e72dca8931aac928be7baf2e Mon Sep 17 00:00:00 2001 From: Henk de Bot Date: Sat, 16 May 2026 01:42:15 +0200 Subject: [PATCH 3/3] style: apply clang-format to tst_mainwindow.cpp Co-Authored-By: Claude Sonnet 4.6 --- tests/auto/mainwindow/tst_mainwindow.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/auto/mainwindow/tst_mainwindow.cpp b/tests/auto/mainwindow/tst_mainwindow.cpp index 8838aff39..b55b7f1ae 100644 --- a/tests/auto/mainwindow/tst_mainwindow.cpp +++ b/tests/auto/mainwindow/tst_mainwindow.cpp @@ -65,7 +65,8 @@ void tst_mainwindow::initTestCase() { QVERIFY2(m_storeDir.isValid(), "temp store dir must be created"); // Minimal valid pass store: just a .gpg-id file - QFile gpgId(QDir::cleanPath(QDir(m_storeDir.path()).filePath(QStringLiteral(".gpg-id")))); + QFile gpgId(QDir::cleanPath( + QDir(m_storeDir.path()).filePath(QStringLiteral(".gpg-id")))); QVERIFY2(gpgId.open(QIODevice::WriteOnly), ".gpg-id must be writable"); gpgId.write("0000000000000000\n"); gpgId.close();