summaryrefslogtreecommitdiffstats
path: root/framework/domain/messageparser_new.cpp
diff options
context:
space:
mode:
authorSandro Knauß <sknauss@kde.org>2016-11-22 15:36:23 +0100
committerSandro Knauß <sknauss@kde.org>2016-11-23 16:38:21 +0100
commit2629a080ee31fbb4ec91b7fd12db2c6f647a3281 (patch)
tree9a43d9463b876fc06888a8d1f968a3405b62c275 /framework/domain/messageparser_new.cpp
parent3b5795ec482299655c497390496b28cebc8bd498 (diff)
downloadkube-2629a080ee31fbb4ec91b7fd12db2c6f647a3281.tar.gz
kube-2629a080ee31fbb4ec91b7fd12db2c6f647a3281.zip
Use ErrorType and ErrorString from Encryption
Diffstat (limited to 'framework/domain/messageparser_new.cpp')
-rw-r--r--framework/domain/messageparser_new.cpp17
1 files changed, 17 insertions, 0 deletions
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 *>();