diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-06-11 21:35:30 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-06-11 22:49:58 +0200 |
commit | 96f080e433029790a628913e2e6c5179f78ee925 (patch) | |
tree | 3d20b0e493787851bbe9f8a4ada8932520b4392b | |
parent | d3d1b06c212b289dabee7566ad0d1ac6cd40dfe1 (diff) | |
download | kube-96f080e433029790a628913e2e6c5179f78ee925.tar.gz kube-96f080e433029790a628913e2e6c5179f78ee925.zip |
Better error message
-rw-r--r-- | framework/src/domain/mime/mimetreeparser/messagepart.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/framework/src/domain/mime/mimetreeparser/messagepart.cpp b/framework/src/domain/mime/mimetreeparser/messagepart.cpp index df4dfeac..303268e5 100644 --- a/framework/src/domain/mime/mimetreeparser/messagepart.cpp +++ b/framework/src/domain/mime/mimetreeparser/messagepart.cpp | |||
@@ -46,6 +46,7 @@ | |||
46 | #include <KLocalizedString> | 46 | #include <KLocalizedString> |
47 | 47 | ||
48 | #include <QTextCodec> | 48 | #include <QTextCodec> |
49 | #include <sstream> | ||
49 | 50 | ||
50 | using namespace MimeTreeParser; | 51 | using namespace MimeTreeParser; |
51 | 52 | ||
@@ -1141,9 +1142,10 @@ bool EncryptedMessagePart::okDecryptMIME(KMime::Content &data) | |||
1141 | 1142 | ||
1142 | mDecryptRecipients = decryptResult.recipients(); | 1143 | mDecryptRecipients = decryptResult.recipients(); |
1143 | bDecryptionOk = !decryptResult.error(); | 1144 | bDecryptionOk = !decryptResult.error(); |
1144 | // std::stringstream ss; | 1145 | |
1145 | // ss << decryptResult << '\n' << verifyResult; | 1146 | std::stringstream ss; |
1146 | // qCDebug(MIMETREEPARSER_LOG) << ss.str().c_str(); | 1147 | ss << decryptResult << '\n' << verifyResult; |
1148 | qWarning() << ss.str().c_str(); | ||
1147 | 1149 | ||
1148 | if (!bDecryptionOk && mMetaData.isSigned) { | 1150 | if (!bDecryptionOk && mMetaData.isSigned) { |
1149 | //Only a signed part | 1151 | //Only a signed part |
@@ -1178,8 +1180,11 @@ bool EncryptedMessagePart::okDecryptMIME(KMime::Content &data) | |||
1178 | mMetaData.errorText = i18n("No appropriate crypto plug-in was found."); | 1180 | mMetaData.errorText = i18n("No appropriate crypto plug-in was found."); |
1179 | } else if (cannotDecrypt) { | 1181 | } else if (cannotDecrypt) { |
1180 | mMetaData.errorText = i18n("Crypto plug-in \"%1\" cannot decrypt messages.", mCryptoProto->name()); | 1182 | mMetaData.errorText = i18n("Crypto plug-in \"%1\" cannot decrypt messages.", mCryptoProto->name()); |
1183 | } else if(mNoSecKey) { | ||
1184 | mMetaData.errorText = i18n("Crypto plug-in \"%1\" could not decrypt the data. ", mCryptoProto->name()) | ||
1185 | + i18n("No key found for recepients."); | ||
1181 | } else if (!passphraseError()) { | 1186 | } else if (!passphraseError()) { |
1182 | mMetaData.errorText = i18n("Crypto plug-in \"%1\" could not decrypt the data.", mCryptoProto->name()) | 1187 | mMetaData.errorText = i18n("Crypto plug-in \"%1\" could not decrypt the data. ", mCryptoProto->name()) |
1183 | + i18n("Error: %1", mMetaData.errorText); | 1188 | + i18n("Error: %1", mMetaData.errorText); |
1184 | } | 1189 | } |
1185 | } | 1190 | } |