From 5b890c4bda394d8c83f089417706d334595f908f Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Sun, 11 Jun 2017 22:48:15 +0200 Subject: Translate the enum instead --- framework/src/domain/mime/partmodel.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'framework') diff --git a/framework/src/domain/mime/partmodel.cpp b/framework/src/domain/mime/partmodel.cpp index a87a60df..c6d7dcf5 100644 --- a/framework/src/domain/mime/partmodel.cpp +++ b/framework/src/domain/mime/partmodel.cpp @@ -182,8 +182,17 @@ QVariant PartModel::data(const QModelIndex &index, int role) const return messagePart->signatureState() != MimeTreeParser::KMMsgNotSigned; case EncryptionErrorType: return messagePart->error(); - case EncryptionErrorString: + case EncryptionErrorString: { + switch (messagePart->error()) { + case MimeTreeParser::MessagePart::NoKeyError: + return tr("No key available."); + case MimeTreeParser::MessagePart::PassphraseError: + return tr("Wrong passphrase."); + case MimeTreeParser::MessagePart::UnknownError: + break; + } return messagePart->errorString(); + } } } return QVariant(); -- cgit v1.2.3