diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-12-06 19:17:12 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-12-06 19:17:12 +0100 |
commit | 6fac57b35a9a87e667e49be464a52c585c6dd66e (patch) | |
tree | 2d5ecce4894a159fc68ba776addff2322be6b7be /common/specialpurposepreprocessor.cpp | |
parent | 4de82d8eafdf0ed9fe48f6bc6627c14332f0fc3c (diff) | |
download | sink-6fac57b35a9a87e667e49be464a52c585c6dd66e.tar.gz sink-6fac57b35a9a87e667e49be464a52c585c6dd66e.zip |
Support for sent mail folder
Diffstat (limited to 'common/specialpurposepreprocessor.cpp')
-rw-r--r-- | common/specialpurposepreprocessor.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/common/specialpurposepreprocessor.cpp b/common/specialpurposepreprocessor.cpp index b3a6bab..ce1a218 100644 --- a/common/specialpurposepreprocessor.cpp +++ b/common/specialpurposepreprocessor.cpp | |||
@@ -13,9 +13,10 @@ static QHash<QByteArray, QString> specialPurposeFolders() | |||
13 | //FIXME localize | 13 | //FIXME localize |
14 | //TODO inbox | 14 | //TODO inbox |
15 | //TODO use standardized values | 15 | //TODO use standardized values |
16 | hash.insert("drafts", "Drafts"); | 16 | hash.insert(ApplicationDomain::SpecialPurpose::Mail::drafts, "Drafts"); |
17 | hash.insert("trash", "Trash"); | 17 | hash.insert(ApplicationDomain::SpecialPurpose::Mail::trash, "Trash"); |
18 | hash.insert("inbox", "Inbox"); | 18 | hash.insert(ApplicationDomain::SpecialPurpose::Mail::inbox, "Inbox"); |
19 | hash.insert(ApplicationDomain::SpecialPurpose::Mail::sent, "Sent"); | ||
19 | return hash; | 20 | return hash; |
20 | } | 21 | } |
21 | 22 | ||
@@ -73,12 +74,15 @@ QByteArray SpecialPurposeProcessor::ensureFolder(const QByteArray &specialPurpos | |||
73 | 74 | ||
74 | void SpecialPurposeProcessor::moveToFolder(Sink::ApplicationDomain::ApplicationDomainType &newEntity) | 75 | void SpecialPurposeProcessor::moveToFolder(Sink::ApplicationDomain::ApplicationDomainType &newEntity) |
75 | { | 76 | { |
76 | if (newEntity.getProperty("trash").toBool()) { | 77 | if (newEntity.getProperty(ApplicationDomain::Mail::Trash::name).toBool()) { |
77 | newEntity.setProperty("folder", ensureFolder("trash")); | 78 | newEntity.setProperty("folder", ensureFolder(ApplicationDomain::SpecialPurpose::Mail::trash)); |
78 | return; | 79 | return; |
79 | } | 80 | } |
80 | if (newEntity.getProperty("draft").toBool()) { | 81 | if (newEntity.getProperty(ApplicationDomain::Mail::Draft::name).toBool()) { |
81 | newEntity.setProperty("folder", ensureFolder("drafts")); | 82 | newEntity.setProperty("folder", ensureFolder(ApplicationDomain::SpecialPurpose::Mail::drafts)); |
83 | } | ||
84 | if (newEntity.getProperty(ApplicationDomain::Mail::Sent::name).toBool()) { | ||
85 | newEntity.setProperty("folder", ensureFolder(ApplicationDomain::SpecialPurpose::Mail::sent)); | ||
82 | } | 86 | } |
83 | } | 87 | } |
84 | 88 | ||