summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-03-17 15:29:28 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-03-17 15:29:28 +0100
commitefc3ca52c338a6b8fca8c523dec86f2c9e84f1c0 (patch)
tree6d090e5b23ec06dd3f42931cc3995dc19e820d53 /examples
parentf4cba9977d46bd94b19586e31f1bea250f211c0c (diff)
downloadsink-efc3ca52c338a6b8fca8c523dec86f2c9e84f1c0.tar.gz
sink-efc3ca52c338a6b8fca8c523dec86f2c9e84f1c0.zip
emitNotification function
Diffstat (limited to 'examples')
-rw-r--r--examples/mailtransportresource/mailtransportresource.cpp14
1 files changed, 2 insertions, 12 deletions
diff --git a/examples/mailtransportresource/mailtransportresource.cpp b/examples/mailtransportresource/mailtransportresource.cpp
index a6460f1..72fe59d 100644
--- a/examples/mailtransportresource/mailtransportresource.cpp
+++ b/examples/mailtransportresource/mailtransportresource.cpp
@@ -81,20 +81,10 @@ public:
81 } 81 }
82 if (!MailTransport::sendMessage(msg, settings.server.toUtf8(), settings.username.toUtf8(), settings.password.toUtf8(), settings.cacert.toUtf8(), options)) { 82 if (!MailTransport::sendMessage(msg, settings.server.toUtf8(), settings.username.toUtf8(), settings.password.toUtf8(), settings.cacert.toUtf8(), options)) {
83 SinkWarning() << "Failed to send message: " << mail; 83 SinkWarning() << "Failed to send message: " << mail;
84 //Emit failure notification 84 emitNotification(Notification::Warning, Notification::TransmissionFailed, "Failed to send message.");
85 Sink::Notification n;
86 n.type = Notification::Warning;
87 n.message = "Failed to send message.";
88 n.code = Notification::TransmissionFailed;
89 emit notify(n);
90 return KAsync::error("Failed to send the message."); 85 return KAsync::error("Failed to send the message.");
91 } else { 86 } else {
92 //Emit success notification 87 emitNotification(Notification::Info, Notification::TransmissionSucceeded, "Message successfully sent.");
93 Sink::Notification n;
94 n.type = Notification::Info;
95 n.message = "Message successfully sent.";
96 n.code = Notification::TransmissionSucceeded;
97 emit notify(n);
98 } 88 }
99 } 89 }
100 syncStore().writeValue(mail.identifier(), "sent"); 90 syncStore().writeValue(mail.identifier(), "sent");