[pim/libkleo] /: Unify wording of signature verification result messages

Ingo Klöcker <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 9bac05ffc3c3a868092b95508968904b65e853d9 by Ingo Klöcker, on behalf of Ingo Klöcker.
Committed on 03/08/2026 at 14:47.
Pushed by kloecker into branch 'master'.

Unify wording of signature verification result messages

GnuPG-bug-id: 7786

M  +2    -2    autotests/formattingtest.cpp
M  +2    -1    src/utils/formatting.cpp

https://invent.kde.org/pim/libkleo/-/commit/9bac05ffc3c3a868092b95508968904b65e853d9

diff --git a/autotests/formattingtest.cpp b/autotests/formattingtest.cpp
index 9d3d3636..6587f301 100644
--- a/autotests/formattingtest.cpp
+++ b/autotests/formattingtest.cpp
@@ -457,7 +457,7 @@ private Q_SLOTS:
                "Signed by <a href=\"key:BA80E58FB5EC794D6396D47ADABA14732513A6D6\">Revoked Key &lt;[email protected]&gt; (DATE)</a> on DATETIME."_s;
         QTest::newRow("key-unknown")
             << Signature::Summary::KeyMissing << GPG_ERR_NO_PUBKEY << Signature::Validity::Unknown
-            << u"The signature cannot be verified because the corresponding certificate is not available. The data cannot be trusted. The signing "
+            << u"The data cannot be trusted. Reason: The signature cannot be verified because the corresponding certificate is not available. The signing "
                "certificate’s fingerprint is <a href=\"certificate:C8C6053CA0018BCB1C0D3C1AF9F33E35E1C16A17\">"
                "C8C6 053C A001 8BCB 1C0D  3C1A F9F3 3E35 E1C1 6A17</a>."_s;
 #if GPGME_VERSION_NUMBER >= 0x020103
@@ -529,7 +529,7 @@ private Q_SLOTS:
         QCOMPARE(verificationResult.numSignatures(), 1);
 
         const QString result = Formatting::prettyDataSignature(verificationResult.signature(0), {});
-        const auto expected = u"The signature cannot be verified because the corresponding certificate is not available. The data cannot be trusted."_s;
+        const auto expected = u"The data cannot be trusted. Reason: The signature cannot be verified because the corresponding certificate is not available."_s;
         QCOMPARE(result, expected);
     }
 
diff --git a/src/utils/formatting.cpp b/src/utils/formatting.cpp
index dc6b191c..84e84686 100644
--- a/src/utils/formatting.cpp
+++ b/src/utils/formatting.cpp
@@ -1817,7 +1817,8 @@ QString Kleo::Formatting::prettyDataSignature(const GpgME::Signature &sig, const
 
     // Key missing
     if ((sig.summary() & GpgME::Signature::KeyMissing)) {
-        QString text = i18nc("@info", "The signature cannot be verified because the corresponding certificate is not available. The data cannot be trusted.");
+        const QString reason = i18nc("@info", "The signature cannot be verified because the corresponding certificate is not available.");
+        QString text = i18nc("@info", "The data cannot be trusted. Reason: %1", reason);
         // TODO: Print signing certificate’s issuer and S/N for missing S/MIME certificate once we get this data from gpgsm.
         if (sig.fingerprint()) {
             text += u' ';
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.