diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-02-25 16:40:54 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-02-25 16:40:54 +0100 |
commit | fed67ae13d4b9c109449f6077cea328913a8548e (patch) | |
tree | 057d19f9412b2120df749259d393b18c1d5cfb24 /framework/mail | |
parent | 0aba0c3fc68712383774263d0906f8e996e1e9c0 (diff) | |
download | kube-fed67ae13d4b9c109449f6077cea328913a8548e.tar.gz kube-fed67ae13d4b9c109449f6077cea328913a8548e.zip |
An overly basic settings framework.
and a settings view to mess around.
Diffstat (limited to 'framework/mail')
-rw-r--r-- | framework/mail/CMakeLists.txt | 2 | ||||
-rw-r--r-- | framework/mail/composer.cpp | 15 |
2 files changed, 12 insertions, 5 deletions
diff --git a/framework/mail/CMakeLists.txt b/framework/mail/CMakeLists.txt index 7215427b..54a031cc 100644 --- a/framework/mail/CMakeLists.txt +++ b/framework/mail/CMakeLists.txt | |||
@@ -24,7 +24,7 @@ add_library(mailplugin SHARED ${mailplugin_SRCS}) | |||
24 | 24 | ||
25 | qt5_use_modules(mailplugin Core Quick Qml) | 25 | qt5_use_modules(mailplugin Core Quick Qml) |
26 | 26 | ||
27 | target_link_libraries(mailplugin actionplugin sink KF5::Otp KF5::Codecs ${CURL_LIBRARIES}) | 27 | target_link_libraries(mailplugin actionplugin settingsplugin sink KF5::Otp KF5::Codecs ${CURL_LIBRARIES}) |
28 | 28 | ||
29 | install(TARGETS mailplugin DESTINATION ${QML_INSTALL_DIR}/org/kde/kube/mail) | 29 | install(TARGETS mailplugin DESTINATION ${QML_INSTALL_DIR}/org/kde/kube/mail) |
30 | install(FILES qmldir DESTINATION ${QML_INSTALL_DIR}/org/kde/kube/mail) | 30 | install(FILES qmldir DESTINATION ${QML_INSTALL_DIR}/org/kde/kube/mail) |
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 @@ | |||
21 | #include "composer.h" | 21 | #include "composer.h" |
22 | #include <actions/context.h> | 22 | #include <actions/context.h> |
23 | #include <actions/action.h> | 23 | #include <actions/action.h> |
24 | #include <settings/settings.h> | ||
24 | #include <KMime/Message> | 25 | #include <KMime/Message> |
25 | #include <KCodecs/KEmailAddress> | 26 | #include <KCodecs/KEmailAddress> |
26 | #include <QVariant> | 27 | #include <QVariant> |
@@ -127,12 +128,18 @@ void Composer::send() | |||
127 | mail->subject(true)->fromUnicodeString(m_subject, "utf-8"); | 128 | mail->subject(true)->fromUnicodeString(m_subject, "utf-8"); |
128 | mail->setBody(m_body.toUtf8()); | 129 | mail->setBody(m_body.toUtf8()); |
129 | mail->assemble(); | 130 | mail->assemble(); |
131 | |||
132 | Kube::ApplicationContext settings; | ||
133 | auto account = settings.currentAccount(); | ||
134 | auto identity = account.primaryIdentity(); | ||
135 | auto transport = identity.transport(); | ||
136 | |||
130 | Kube::Context context; | 137 | Kube::Context context; |
131 | context.setProperty("message", QVariant::fromValue(mail)); | 138 | context.setProperty("message", QVariant::fromValue(mail)); |
132 | //TODO get from somewhere | 139 | |
133 | context.setProperty("username", QVariant::fromValue(QByteArray("test@test.com"))); | 140 | context.setProperty("username", transport.username()); |
134 | context.setProperty("password", QVariant::fromValue(QByteArray("pass"))); | 141 | context.setProperty("password", transport.password()); |
135 | context.setProperty("server", QVariant::fromValue(QByteArray("smtp://smtp.gmail.com:587"))); | 142 | context.setProperty("server", transport.server()); |
136 | 143 | ||
137 | Kube::Action("org.kde.kube.actions.sendmail", context).execute(); | 144 | Kube::Action("org.kde.kube.actions.sendmail", context).execute(); |
138 | clear(); | 145 | clear(); |