summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSandro Knauß <[email protected]>2017-11-22 12:25:27 +0100
committerSandro Knauß <[email protected]>2017-11-27 18:38:09 +0100
commit5c07b4c1773355a2f08a8835c1a28c03f43aaf64 (patch)
tree937109d3349212a0bf8e95f1f71a3cdf67cd6c3d
parenta842fa0c5591d43d6432989667be7e9d52a29a7d (diff)
always show keydetails from mimepart
-rw-r--r--plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeyformatter.cpp22
1 files changed, 4 insertions, 18 deletions
diff --git a/plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeyformatter.cpp b/plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeyformatter.cpp
index ce706c2..d95dd44 100644
--- a/plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeyformatter.cpp
+++ b/plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeyformatter.cpp
@@ -93,24 +93,10 @@ bool ApplicationPGPKeyFormatter::render(const MimeTreeParser::MessagePartPtr &ms
block.setProperty("importUrl", mp->makeLink(QStringLiteral("pgpkey")) + QStringLiteral("?action=import"));
block.setProperty("searchRunning", mp->searchRunning());
const auto key = mp->key();
- if (key.isNull()) {
- block.setProperty("uid", mp->userID());
- block.setProperty("fingerprint", mp->fingerprint());
- block.setProperty("created", mp->keyDate().toString(Qt::SystemLocaleDate));
- } else {
- const auto uid = key.userID(0);
- if (uid.email() && *uid.email() && uid.name() && *uid.name()) {
- block.setProperty("uid", QStringLiteral("%1 <%2>").arg(QString::fromUtf8(uid.name()),
- QString::fromUtf8(uid.email())));
- } else if (uid.name() && *uid.name()) {
- block.setProperty("uid", QString::fromUtf8(uid.name()));
- } else if (uid.email() && *uid.email()) {
- block.setProperty("uid", QString::fromUtf8(uid.email()));
- } else {
- block.setProperty("uid", i18n("Unknown identity"));
- }
- block.setProperty("created", QDateTime::fromTime_t(key.subkey(0).creationTime()).toString(Qt::SystemLocaleDate));
- block.setProperty("fingerprint", QString::fromLatin1(key.primaryFingerprint()));
+ block.setProperty("uid", mp->userID());
+ block.setProperty("fingerprint", mp->fingerprint());
+ block.setProperty("created", mp->keyDate().toString(Qt::SystemLocaleDate));
+ if (!key.isNull()) {
block.setProperty("keyUrl", QStringLiteral("kmail:showCertificate#GpgME ### gpgme ### %1").arg(QString::fromLatin1(key.keyID())));
}