From efc3ca52c338a6b8fca8c523dec86f2c9e84f1c0 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Fri, 17 Mar 2017 15:29:28 +0100 Subject: emitNotification function --- examples/mailtransportresource/mailtransportresource.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'examples/mailtransportresource') 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: } if (!MailTransport::sendMessage(msg, settings.server.toUtf8(), settings.username.toUtf8(), settings.password.toUtf8(), settings.cacert.toUtf8(), options)) { SinkWarning() << "Failed to send message: " << mail; - //Emit failure notification - Sink::Notification n; - n.type = Notification::Warning; - n.message = "Failed to send message."; - n.code = Notification::TransmissionFailed; - emit notify(n); + emitNotification(Notification::Warning, Notification::TransmissionFailed, "Failed to send message."); return KAsync::error("Failed to send the message."); } else { - //Emit success notification - Sink::Notification n; - n.type = Notification::Info; - n.message = "Message successfully sent."; - n.code = Notification::TransmissionSucceeded; - emit notify(n); + emitNotification(Notification::Info, Notification::TransmissionSucceeded, "Message successfully sent."); } } syncStore().writeValue(mail.identifier(), "sent"); -- cgit v1.2.3