diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-07-12 17:31:28 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-07-12 17:31:28 +0200 |
commit | 1213815b42e94f41817b79fc9e311742a330d9ae (patch) | |
tree | ba1cfc35e46207f1039d8c2ce6da68a2885a9e23 /accounts/imap/imapsettings.cpp | |
parent | 1a3af7c1c7fc85cbf743ce5d69ff6eae9151ba95 (diff) | |
download | kube-1213815b42e94f41817b79fc9e311742a330d9ae.tar.gz kube-1213815b42e94f41817b79fc9e311742a330d9ae.zip |
Remove account also if no resources are available
Diffstat (limited to 'accounts/imap/imapsettings.cpp')
-rw-r--r-- | accounts/imap/imapsettings.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/accounts/imap/imapsettings.cpp b/accounts/imap/imapsettings.cpp index 6e45b197..fcef8971 100644 --- a/accounts/imap/imapsettings.cpp +++ b/accounts/imap/imapsettings.cpp | |||
@@ -222,7 +222,7 @@ void ImapSettings::save() | |||
222 | 222 | ||
223 | void ImapSettings::remove() | 223 | void ImapSettings::remove() |
224 | { | 224 | { |
225 | if (mIdentifier.isEmpty()) { | 225 | if (mMailtransportIdentifier.isEmpty()) { |
226 | qWarning() << "We're missing an identifier"; | 226 | qWarning() << "We're missing an identifier"; |
227 | } else { | 227 | } else { |
228 | Sink::ApplicationDomain::SinkResource mailTransportResource("", mMailtransportIdentifier, 0, QSharedPointer<Sink::ApplicationDomain::MemoryBufferAdaptor>::create()); | 228 | Sink::ApplicationDomain::SinkResource mailTransportResource("", mMailtransportIdentifier, 0, QSharedPointer<Sink::ApplicationDomain::MemoryBufferAdaptor>::create()); |
@@ -231,14 +231,22 @@ void ImapSettings::remove() | |||
231 | qWarning() << "Error while removing resource: " << errorMessage; | 231 | qWarning() << "Error while removing resource: " << errorMessage; |
232 | }) | 232 | }) |
233 | .exec(); | 233 | .exec(); |
234 | } | ||
234 | 235 | ||
236 | if (mIdentifier.isEmpty()) { | ||
237 | qWarning() << "We're missing an identifier"; | ||
238 | } else { | ||
235 | Sink::ApplicationDomain::SinkResource resource("", mIdentifier, 0, QSharedPointer<Sink::ApplicationDomain::MemoryBufferAdaptor>::create()); | 239 | Sink::ApplicationDomain::SinkResource resource("", mIdentifier, 0, QSharedPointer<Sink::ApplicationDomain::MemoryBufferAdaptor>::create()); |
236 | Sink::Store::remove(resource).then<void>([]() {}, | 240 | Sink::Store::remove(resource).then<void>([]() {}, |
237 | [](int errorCode, const QString &errorMessage) { | 241 | [](int errorCode, const QString &errorMessage) { |
238 | qWarning() << "Error while removing resource: " << errorMessage; | 242 | qWarning() << "Error while removing resource: " << errorMessage; |
239 | }) | 243 | }) |
240 | .exec(); | 244 | .exec(); |
245 | } | ||
241 | 246 | ||
247 | if (mAccountIdentifier.isEmpty()) { | ||
248 | qWarning() << "We're missing an identifier"; | ||
249 | } else { | ||
242 | Sink::ApplicationDomain::SinkAccount account("", mAccountIdentifier, 0, QSharedPointer<Sink::ApplicationDomain::MemoryBufferAdaptor>::create()); | 250 | Sink::ApplicationDomain::SinkAccount account("", mAccountIdentifier, 0, QSharedPointer<Sink::ApplicationDomain::MemoryBufferAdaptor>::create()); |
243 | Sink::Store::remove(account).then<void>([]() {}, | 251 | Sink::Store::remove(account).then<void>([]() {}, |
244 | [](int errorCode, const QString &errorMessage) { | 252 | [](int errorCode, const QString &errorMessage) { |