diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-12-06 19:18:34 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-12-06 19:18:34 +0100 |
commit | 62c7b07c0d62f8f03e22556bf62ed90d267c6d2e (patch) | |
tree | 4b2789845333f63a0e3d97c34d877ad0d6f7d1ed /examples/maildirresource/facade.cpp | |
parent | 6fac57b35a9a87e667e49be464a52c585c6dd66e (diff) | |
download | sink-62c7b07c0d62f8f03e22556bf62ed90d267c6d2e.tar.gz sink-62c7b07c0d62f8f03e22556bf62ed90d267c6d2e.zip |
Fixed maildirresource
Diffstat (limited to 'examples/maildirresource/facade.cpp')
-rw-r--r-- | examples/maildirresource/facade.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/maildirresource/facade.cpp b/examples/maildirresource/facade.cpp index ba53c5f..d26b86c 100644 --- a/examples/maildirresource/facade.cpp +++ b/examples/maildirresource/facade.cpp | |||
@@ -28,10 +28,10 @@ MaildirResourceMailFacade::MaildirResourceMailFacade(const Sink::ResourceContext | |||
28 | : Sink::GenericFacade<Sink::ApplicationDomain::Mail>(context) | 28 | : Sink::GenericFacade<Sink::ApplicationDomain::Mail>(context) |
29 | { | 29 | { |
30 | mResultTransformation = [](Sink::ApplicationDomain::ApplicationDomainType &value) { | 30 | mResultTransformation = [](Sink::ApplicationDomain::ApplicationDomainType &value) { |
31 | if (value.hasProperty("mimeMessage")) { | 31 | if (value.hasProperty(Sink::ApplicationDomain::Mail::MimeMessage::name)) { |
32 | const auto property = value.getProperty("mimeMessage"); | 32 | auto mail = Sink::ApplicationDomain::Mail{value}; |
33 | const auto mimeMessage = mail.getMimeMessagePath(); | ||
33 | //Transform the mime message property into the actual path on disk. | 34 | //Transform the mime message property into the actual path on disk. |
34 | const auto mimeMessage = property.toString(); | ||
35 | auto parts = mimeMessage.split('/'); | 35 | auto parts = mimeMessage.split('/'); |
36 | auto key = parts.takeLast(); | 36 | auto key = parts.takeLast(); |
37 | const auto folderPath = parts.join('/'); | 37 | const auto folderPath = parts.join('/'); |
@@ -42,9 +42,9 @@ MaildirResourceMailFacade::MaildirResourceMailFacade(const Sink::ResourceContext | |||
42 | const QFileInfoList list = dir.entryInfoList(QStringList() << (key+"*"), QDir::Files); | 42 | const QFileInfoList list = dir.entryInfoList(QStringList() << (key+"*"), QDir::Files); |
43 | if (list.size() != 1) { | 43 | if (list.size() != 1) { |
44 | SinkWarning_("", "maildirfacade") << "Failed to find message " << path << key << list.size(); | 44 | SinkWarning_("", "maildirfacade") << "Failed to find message " << path << key << list.size(); |
45 | value.setProperty("mimeMessage", QVariant()); | 45 | mail.setProperty(Sink::ApplicationDomain::Mail::MimeMessage::name, QVariant()); |
46 | } else { | 46 | } else { |
47 | value.setProperty("mimeMessage", list.at(0).filePath()); | 47 | mail.setMimeMessagePath(list.at(0).filePath()); |
48 | } | 48 | } |
49 | } | 49 | } |
50 | value.setChangedProperties(QSet<QByteArray>()); | 50 | value.setChangedProperties(QSet<QByteArray>()); |