diff options
-rw-r--r-- | accounts/imap/imapsettings.cpp | 10 | ||||
-rw-r--r-- | accounts/maildir/maildirsettings.cpp | 10 |
2 files changed, 18 insertions, 2 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) { |
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 | ||
233 | void MaildirSettings::remove() | 233 | void 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) { |