diff options
Diffstat (limited to 'examples/maildirresource/facade.cpp')
-rw-r--r-- | examples/maildirresource/facade.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/maildirresource/facade.cpp b/examples/maildirresource/facade.cpp index 13ceaaf..5ea3d98 100644 --- a/examples/maildirresource/facade.cpp +++ b/examples/maildirresource/facade.cpp | |||
@@ -28,6 +28,7 @@ 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 | Sink::Log::Context ctx{"maildirfacade"}; | ||
31 | if (value.hasProperty(Sink::ApplicationDomain::Mail::MimeMessage::name)) { | 32 | if (value.hasProperty(Sink::ApplicationDomain::Mail::MimeMessage::name)) { |
32 | auto mail = Sink::ApplicationDomain::Mail{value}; | 33 | auto mail = Sink::ApplicationDomain::Mail{value}; |
33 | const auto mimeMessage = mail.getMimeMessagePath(); | 34 | const auto mimeMessage = mail.getMimeMessagePath(); |
@@ -37,11 +38,11 @@ MaildirResourceMailFacade::MaildirResourceMailFacade(const Sink::ResourceContext | |||
37 | const auto folderPath = parts.join('/'); | 38 | const auto folderPath = parts.join('/'); |
38 | const auto path = folderPath + "/cur/"; | 39 | const auto path = folderPath + "/cur/"; |
39 | 40 | ||
40 | SinkTrace_("", "maildirfacade") << "Looking for mail in: " << path << key; | 41 | SinkTraceCtx(ctx) << "Looking for mail in: " << path << key; |
41 | QDir dir(path); | 42 | QDir dir(path); |
42 | const QFileInfoList list = dir.entryInfoList(QStringList() << (key+"*"), QDir::Files); | 43 | const QFileInfoList list = dir.entryInfoList(QStringList() << (key+"*"), QDir::Files); |
43 | if (list.size() != 1) { | 44 | if (list.size() != 1) { |
44 | SinkWarning_("", "maildirfacade") << "Failed to find message " << path << key << list.size(); | 45 | SinkErrorCtx(ctx) << "Failed to find message. Directory: " << path << "Key: " << key << "Number of matching files: " << list.size(); |
45 | mail.setProperty(Sink::ApplicationDomain::Mail::MimeMessage::name, QVariant()); | 46 | mail.setProperty(Sink::ApplicationDomain::Mail::MimeMessage::name, QVariant()); |
46 | } else { | 47 | } else { |
47 | mail.setMimeMessagePath(list.at(0).filePath()); | 48 | mail.setMimeMessagePath(list.at(0).filePath()); |