summaryrefslogtreecommitdiffstats
path: root/accounts/maildir
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-07-12 17:31:28 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-07-12 17:31:28 +0200
commit1213815b42e94f41817b79fc9e311742a330d9ae (patch)
treeba1cfc35e46207f1039d8c2ce6da68a2885a9e23 /accounts/maildir
parent1a3af7c1c7fc85cbf743ce5d69ff6eae9151ba95 (diff)
downloadkube-1213815b42e94f41817b79fc9e311742a330d9ae.tar.gz
kube-1213815b42e94f41817b79fc9e311742a330d9ae.zip
Remove account also if no resources are available
Diffstat (limited to 'accounts/maildir')
-rw-r--r--accounts/maildir/maildirsettings.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/accounts/maildir/maildirsettings.cpp b/accounts/maildir/maildirsettings.cpp
index 5125bbe7..5c1fb177 100644
--- a/accounts/maildir/maildirsettings.cpp
+++ b/accounts/maildir/maildirsettings.cpp
@@ -232,7 +232,7 @@ void MaildirSettings::save()
232 232
233void MaildirSettings::remove() 233void MaildirSettings::remove()
234{ 234{
235 if (mIdentifier.isEmpty()) { 235 if (mMailtransportIdentifier.isEmpty()) {
236 qWarning() << "We're missing an identifier"; 236 qWarning() << "We're missing an identifier";
237 } else { 237 } else {
238 Sink::ApplicationDomain::SinkResource mailTransportResource("", mMailtransportIdentifier, 0, QSharedPointer<Sink::ApplicationDomain::MemoryBufferAdaptor>::create()); 238 Sink::ApplicationDomain::SinkResource mailTransportResource("", mMailtransportIdentifier, 0, QSharedPointer<Sink::ApplicationDomain::MemoryBufferAdaptor>::create());
@@ -241,14 +241,22 @@ void MaildirSettings::remove()
241 qWarning() << "Error while removing resource: " << errorMessage; 241 qWarning() << "Error while removing resource: " << errorMessage;
242 }) 242 })
243 .exec(); 243 .exec();
244 }
244 245
246 if (mIdentifier.isEmpty()) {
247 qWarning() << "We're missing an identifier";
248 } else {
245 Sink::ApplicationDomain::SinkResource resource("", mIdentifier, 0, QSharedPointer<Sink::ApplicationDomain::MemoryBufferAdaptor>::create()); 249 Sink::ApplicationDomain::SinkResource resource("", mIdentifier, 0, QSharedPointer<Sink::ApplicationDomain::MemoryBufferAdaptor>::create());
246 Sink::Store::remove(resource).then<void>([]() {}, 250 Sink::Store::remove(resource).then<void>([]() {},
247 [](int errorCode, const QString &errorMessage) { 251 [](int errorCode, const QString &errorMessage) {
248 qWarning() << "Error while removing resource: " << errorMessage; 252 qWarning() << "Error while removing resource: " << errorMessage;
249 }) 253 })
250 .exec(); 254 .exec();
255 }
251 256
257 if (mAccountIdentifier.isEmpty()) {
258 qWarning() << "We're missing an identifier";
259 } else {
252 Sink::ApplicationDomain::SinkAccount account("", mAccountIdentifier, 0, QSharedPointer<Sink::ApplicationDomain::MemoryBufferAdaptor>::create()); 260 Sink::ApplicationDomain::SinkAccount account("", mAccountIdentifier, 0, QSharedPointer<Sink::ApplicationDomain::MemoryBufferAdaptor>::create());
253 Sink::Store::remove(account).then<void>([]() {}, 261 Sink::Store::remove(account).then<void>([]() {},
254 [](int errorCode, const QString &errorMessage) { 262 [](int errorCode, const QString &errorMessage) {