diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-03-12 15:29:11 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-03-12 15:29:11 +0100 |
commit | bd9c640bf83b6a430cd4d7e91376aab7222ce07a (patch) | |
tree | 0537a3707b0883837864760d6092aba9be437e0c /accounts/maildir | |
parent | 680fd8bed732fcafd98ae1c410ba5473e38d18c1 (diff) | |
download | kube-bd9c640bf83b6a430cd4d7e91376aab7222ce07a.tar.gz kube-bd9c640bf83b6a430cd4d7e91376aab7222ce07a.zip |
Set the accountId on the settings component.
Diffstat (limited to 'accounts/maildir')
-rw-r--r-- | accounts/maildir/maildirsettings.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/accounts/maildir/maildirsettings.cpp b/accounts/maildir/maildirsettings.cpp index a2e2e96e..58ff77fd 100644 --- a/accounts/maildir/maildirsettings.cpp +++ b/accounts/maildir/maildirsettings.cpp | |||
@@ -49,10 +49,14 @@ QByteArray MaildirSettings::identifier() const | |||
49 | 49 | ||
50 | void MaildirSettings::setAccountIdentifier(const QByteArray &id) | 50 | void MaildirSettings::setAccountIdentifier(const QByteArray &id) |
51 | { | 51 | { |
52 | if (id.isEmpty()) { | ||
53 | return; | ||
54 | } | ||
52 | mAccountIdentifier = id; | 55 | mAccountIdentifier = id; |
56 | Q_ASSERT(!id.isEmpty()); | ||
53 | Kube::Account account(id); | 57 | Kube::Account account(id); |
54 | account.property("maildirResource").toByteArray(); | 58 | auto maildirResource = account.property("maildirResource").toByteArray(); |
55 | setIdentifier(account.property("maildirResource").toByteArray()); | 59 | setIdentifier(maildirResource); |
56 | } | 60 | } |
57 | 61 | ||
58 | QByteArray MaildirSettings::accountIdentifier() const | 62 | QByteArray MaildirSettings::accountIdentifier() const |
@@ -88,6 +92,7 @@ void MaildirSettings::save() | |||
88 | resource.setProperty("identifier", resourceIdentifier); | 92 | resource.setProperty("identifier", resourceIdentifier); |
89 | resource.setProperty("type", "org.kde.maildir"); | 93 | resource.setProperty("type", "org.kde.maildir"); |
90 | Sink::Store::create(resource).exec(); | 94 | Sink::Store::create(resource).exec(); |
95 | Q_ASSERT(!mAccountIdentifier.isEmpty()); | ||
91 | Kube::Account account(mAccountIdentifier); | 96 | Kube::Account account(mAccountIdentifier); |
92 | account.setProperty("maildirResource", resourceIdentifier); | 97 | account.setProperty("maildirResource", resourceIdentifier); |
93 | account.save(); | 98 | account.save(); |