From fed67ae13d4b9c109449f6077cea328913a8548e Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Thu, 25 Feb 2016 16:40:54 +0100 Subject: An overly basic settings framework. and a settings view to mess around. --- framework/mail/composer.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'framework/mail/composer.cpp') diff --git a/framework/mail/composer.cpp b/framework/mail/composer.cpp index 1ec56347..4ef112fa 100644 --- a/framework/mail/composer.cpp +++ b/framework/mail/composer.cpp @@ -21,6 +21,7 @@ #include "composer.h" #include #include +#include #include #include #include @@ -127,12 +128,18 @@ void Composer::send() mail->subject(true)->fromUnicodeString(m_subject, "utf-8"); mail->setBody(m_body.toUtf8()); mail->assemble(); + + Kube::ApplicationContext settings; + auto account = settings.currentAccount(); + auto identity = account.primaryIdentity(); + auto transport = identity.transport(); + Kube::Context context; context.setProperty("message", QVariant::fromValue(mail)); - //TODO get from somewhere - context.setProperty("username", QVariant::fromValue(QByteArray("test@test.com"))); - context.setProperty("password", QVariant::fromValue(QByteArray("pass"))); - context.setProperty("server", QVariant::fromValue(QByteArray("smtp://smtp.gmail.com:587"))); + + context.setProperty("username", transport.username()); + context.setProperty("password", transport.password()); + context.setProperty("server", transport.server()); Kube::Action("org.kde.kube.actions.sendmail", context).execute(); clear(); -- cgit v1.2.3