summaryrefslogtreecommitdiffstats
path: root/accounts
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-04-29 14:26:30 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-04-29 14:28:53 +0200
commit53e988faa295f245dea4f69249ecb165e245a9c3 (patch)
tree78c45e89e7bba5f4bb5a22dbe498561c98b7df34 /accounts
parent90a5016995f43a5f65b7877dc206092af581f29e (diff)
downloadkube-53e988faa295f245dea4f69249ecb165e245a9c3.tar.gz
kube-53e988faa295f245dea4f69249ecb165e245a9c3.zip
Avoid assembling uid ourselves
Diffstat (limited to 'accounts')
-rw-r--r--accounts/maildir/maildirsettings.cpp16
1 files changed, 4 insertions, 12 deletions
diff --git a/accounts/maildir/maildirsettings.cpp b/accounts/maildir/maildirsettings.cpp
index e47b834f..96b75a1e 100644
--- a/accounts/maildir/maildirsettings.cpp
+++ b/accounts/maildir/maildirsettings.cpp
@@ -22,7 +22,6 @@
22 22
23#include <sink/store.h> 23#include <sink/store.h>
24#include <QDebug> 24#include <QDebug>
25#include <QUuid>
26#include <QDir> 25#include <QDir>
27#include <QUrl> 26#include <QUrl>
28 27
@@ -177,12 +176,9 @@ void MaildirSettings::save()
177 }) 176 })
178 .exec(); 177 .exec();
179 } else { 178 } else {
180 const auto resourceIdentifier = "org.kde.maildir." + QUuid::createUuid().toByteArray(); 179 auto resource = Sink::ApplicationDomain::ApplicationDomainType::createEntity<Sink::ApplicationDomain::SinkResource>();
181 mIdentifier = resourceIdentifier; 180 mIdentifier = resource.identifier();
182
183 Sink::ApplicationDomain::SinkResource resource;
184 resource.setProperty("path", property("path")); 181 resource.setProperty("path", property("path"));
185 resource.setProperty("identifier", resourceIdentifier);
186 resource.setProperty("type", "org.kde.maildir"); 182 resource.setProperty("type", "org.kde.maildir");
187 resource.setProperty("account", mAccountIdentifier); 183 resource.setProperty("account", mAccountIdentifier);
188 Sink::Store::create(resource).then<void>([]() {}, 184 Sink::Store::create(resource).then<void>([]() {},
@@ -202,12 +198,8 @@ void MaildirSettings::save()
202 }) 198 })
203 .exec(); 199 .exec();
204 } else { 200 } else {
205 //FIXME we shouldn't have to do this magic 201 auto resource = Sink::ApplicationDomain::ApplicationDomainType::createEntity<Sink::ApplicationDomain::SinkResource>();
206 const auto resourceIdentifier = "org.kde.mailtransport." + QUuid::createUuid().toByteArray(); 202 mMailtransportIdentifier = resource.identifier();
207 mMailtransportIdentifier = resourceIdentifier;
208
209 Sink::ApplicationDomain::SinkResource resource;
210 resource.setProperty("identifier", resourceIdentifier);
211 resource.setProperty("type", "org.kde.mailtransport"); 203 resource.setProperty("type", "org.kde.mailtransport");
212 resource.setProperty("account", mAccountIdentifier); 204 resource.setProperty("account", mAccountIdentifier);
213 resource.setProperty("server", mSmtpServer); 205 resource.setProperty("server", mSmtpServer);