summaryrefslogtreecommitdiffstats
path: root/framework
diff options
context:
space:
mode:
Diffstat (limited to 'framework')
-rw-r--r--framework/domain/messageparser.h4
-rw-r--r--framework/domain/messageparser_new.cpp17
2 files changed, 20 insertions, 1 deletions
diff --git a/framework/domain/messageparser.h b/framework/domain/messageparser.h
index 036cff7d..aeeed93c 100644
--- a/framework/domain/messageparser.h
+++ b/framework/domain/messageparser.h
@@ -113,7 +113,9 @@ public:
113 ContentsRole, 113 ContentsRole,
114 ContentRole, 114 ContentRole,
115 IsEmbededRole, 115 IsEmbededRole,
116 SecurityLevelRole 116 SecurityLevelRole,
117 EncryptionErrorType,
118 EncryptionErrorString
117 }; 119 };
118 120
119 QHash<int, QByteArray> roleNames() const Q_DECL_OVERRIDE; 121 QHash<int, QByteArray> roleNames() const Q_DECL_OVERRIDE;
diff --git a/framework/domain/messageparser_new.cpp b/framework/domain/messageparser_new.cpp
index 8afd5956..b95a6472 100644
--- a/framework/domain/messageparser_new.cpp
+++ b/framework/domain/messageparser_new.cpp
@@ -306,6 +306,8 @@ QHash<int, QByteArray> NewModel::roleNames() const
306 roles[ContentRole] = "content"; 306 roles[ContentRole] = "content";
307 roles[IsEmbededRole] = "embeded"; 307 roles[IsEmbededRole] = "embeded";
308 roles[SecurityLevelRole] = "securityLevel"; 308 roles[SecurityLevelRole] = "securityLevel";
309 roles[EncryptionErrorType] = "errorType";
310 roles[EncryptionErrorString] = "errorString";
309 return roles; 311 return roles;
310} 312}
311 313
@@ -374,6 +376,21 @@ QVariant NewModel::data(const QModelIndex &index, int role) const
374 return QStringLiteral("GREEN"); 376 return QStringLiteral("GREEN");
375 case IsEmbededRole: 377 case IsEmbededRole:
376 return data(index.parent(), IsEmbededRole); 378 return data(index.parent(), IsEmbededRole);
379 case EncryptionErrorType:
380 {
381 switch(encryption->errorType()) {
382 case Encryption::NoError:
383 return QString();
384 case Encryption::PassphraseError:
385 return QStringLiteral("PassphraseError");
386 case Encryption::KeyMissing:
387 return QStringLiteral("KeyMissing");
388 default:
389 return QStringLiteral("UnknownError");
390 }
391 }
392 case EncryptionErrorString:
393 return encryption->errorString();
377 } 394 }
378 } else if (_data->userType() == qMetaTypeId<Part *>()) { 395 } else if (_data->userType() == qMetaTypeId<Part *>()) {
379 const auto part = _data->value<Part *>(); 396 const auto part = _data->value<Part *>();