From 1eecf2f59c340685ef7e3e903958df38a3bc391b Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Mon, 16 Jul 2018 12:03:45 +0200 Subject: More encryption state fixes --- components/mailviewer/qml/MailDataModel.qml | 3 ++- framework/src/domain/mime/partmodel.cpp | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/components/mailviewer/qml/MailDataModel.qml b/components/mailviewer/qml/MailDataModel.qml index 279c0e95..c78896d3 100644 --- a/components/mailviewer/qml/MailDataModel.qml +++ b/components/mailviewer/qml/MailDataModel.qml @@ -68,6 +68,7 @@ DelegateModel { if (!signatureDetails.signatureIsGood && !signatureDetails.keyRevoked && !signatureDetails.keyExpired && !signatureDetails.keyIsTrusted) { details += qsTr("The signature is invalid.") + "\n" } + } return details } @@ -85,7 +86,7 @@ DelegateModel { color: getColor(model.encryptionSecurityLevel) backgroundOpacity: 0.5 visible: model.encrypted - tooltip: qsTr("This message is encrypted to the key: %1").arg(model.encryptionDetails.keyId); + tooltip: model.encryptionDetails.keyId == "" ? qsTr("This message is encrypted but we don't have the key for it.") : qsTr("This message is encrypted to the key: %1").arg(model.encryptionDetails.keyId); //FIXME make text copyable // Kube.SelectableItem { diff --git a/framework/src/domain/mime/partmodel.cpp b/framework/src/domain/mime/partmodel.cpp index 02ef2f6d..cbb0cb96 100644 --- a/framework/src/domain/mime/partmodel.cpp +++ b/framework/src/domain/mime/partmodel.cpp @@ -287,6 +287,9 @@ QVariant PartModel::data(const QModelIndex &index, int role) const auto encryption = messagePart->encryptionState(); bool messageIsEncrypted = encryption == MimeTreeParser::KMMsgPartiallyEncrypted || encryption == MimeTreeParser::KMMsgFullyEncrypted; + if (messagePart->error()) { + return "bad"; + } //All good if (messageIsEncrypted) { return "good"; -- cgit v1.2.3