diff options
Diffstat (limited to 'framework/domain/settings/accountsettings.cpp')
-rw-r--r-- | framework/domain/settings/accountsettings.cpp | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/framework/domain/settings/accountsettings.cpp b/framework/domain/settings/accountsettings.cpp index f2c5a66f..067d1d79 100644 --- a/framework/domain/settings/accountsettings.cpp +++ b/framework/domain/settings/accountsettings.cpp | |||
@@ -19,6 +19,7 @@ | |||
19 | #include "accountsettings.h" | 19 | #include "accountsettings.h" |
20 | 20 | ||
21 | #include <sink/store.h> | 21 | #include <sink/store.h> |
22 | #include <sink/log.h> | ||
22 | #include <QDebug> | 23 | #include <QDebug> |
23 | #include <QDir> | 24 | #include <QDir> |
24 | #include <QUrl> | 25 | #include <QUrl> |
@@ -26,6 +27,8 @@ | |||
26 | using namespace Sink; | 27 | using namespace Sink; |
27 | using namespace Sink::ApplicationDomain; | 28 | using namespace Sink::ApplicationDomain; |
28 | 29 | ||
30 | SINK_DEBUG_AREA("accountsettings") | ||
31 | |||
29 | AccountSettings::AccountSettings(QObject *parent) | 32 | AccountSettings::AccountSettings(QObject *parent) |
30 | : QObject(parent) | 33 | : QObject(parent) |
31 | { | 34 | { |
@@ -181,7 +184,7 @@ void AccountSettings::loadMaildirResource() | |||
181 | emit pathChanged(); | 184 | emit pathChanged(); |
182 | } | 185 | } |
183 | }).onError([](const KAsync::Error &error) { | 186 | }).onError([](const KAsync::Error &error) { |
184 | qWarning() << "Failed to find the maildir resource: " << error.errorMessage; | 187 | SinkWarning() << "Failed to find the maildir resource: " << error.errorMessage; |
185 | }).exec(); | 188 | }).exec(); |
186 | } | 189 | } |
187 | 190 | ||
@@ -195,7 +198,7 @@ void AccountSettings::loadMailtransportResource() | |||
195 | mSmtpPassword = resource.getProperty("password").toString(); | 198 | mSmtpPassword = resource.getProperty("password").toString(); |
196 | emit smtpResourceChanged(); | 199 | emit smtpResourceChanged(); |
197 | }).onError([](const KAsync::Error &error) { | 200 | }).onError([](const KAsync::Error &error) { |
198 | qWarning() << "Failed to find the smtp resource: " << error.errorMessage; | 201 | SinkWarning() << "Failed to find the smtp resource: " << error.errorMessage; |
199 | }).exec(); | 202 | }).exec(); |
200 | } | 203 | } |
201 | 204 | ||
@@ -209,7 +212,7 @@ void AccountSettings::loadIdentity() | |||
209 | mEmailAddress = identity.getAddress(); | 212 | mEmailAddress = identity.getAddress(); |
210 | emit identityChanged(); | 213 | emit identityChanged(); |
211 | }).onError([](const KAsync::Error &error) { | 214 | }).onError([](const KAsync::Error &error) { |
212 | qWarning() << "Failed to find the identity resource: " << error.errorMessage; | 215 | SinkWarning() << "Failed to find the identity resource: " << error.errorMessage; |
213 | }).exec(); | 216 | }).exec(); |
214 | } | 217 | } |
215 | 218 | ||
@@ -225,7 +228,7 @@ static QByteArray saveResource(const QByteArray &accountIdentifier, const QByteA | |||
225 | } | 228 | } |
226 | Store::modify(resource) | 229 | Store::modify(resource) |
227 | .onError([](const KAsync::Error &error) { | 230 | .onError([](const KAsync::Error &error) { |
228 | qWarning() << "Error while modifying resource: " << error.errorMessage; | 231 | SinkWarning() << "Error while modifying resource: " << error.errorMessage; |
229 | }) | 232 | }) |
230 | .exec(); | 233 | .exec(); |
231 | } else { | 234 | } else { |
@@ -236,7 +239,7 @@ static QByteArray saveResource(const QByteArray &accountIdentifier, const QByteA | |||
236 | } | 239 | } |
237 | Store::create(resource) | 240 | Store::create(resource) |
238 | .onError([](const KAsync::Error &error) { | 241 | .onError([](const KAsync::Error &error) { |
239 | qWarning() << "Error while creating resource: " << error.errorMessage; | 242 | SinkWarning() << "Error while creating resource: " << error.errorMessage; |
240 | }) | 243 | }) |
241 | .exec(); | 244 | .exec(); |
242 | return newIdentifier; | 245 | return newIdentifier; |
@@ -277,7 +280,7 @@ void AccountSettings::saveIdentity() | |||
277 | identity.setAddress(mEmailAddress); | 280 | identity.setAddress(mEmailAddress); |
278 | Store::modify(identity) | 281 | Store::modify(identity) |
279 | .onError([](const KAsync::Error &error) { | 282 | .onError([](const KAsync::Error &error) { |
280 | qWarning() << "Error while modifying identity: " << error.errorMessage; | 283 | SinkWarning() << "Error while modifying identity: " << error.errorMessage; |
281 | }) | 284 | }) |
282 | .exec(); | 285 | .exec(); |
283 | } else { | 286 | } else { |
@@ -288,7 +291,7 @@ void AccountSettings::saveIdentity() | |||
288 | identity.setAddress(mEmailAddress); | 291 | identity.setAddress(mEmailAddress); |
289 | Store::create(identity) | 292 | Store::create(identity) |
290 | .onError([](const KAsync::Error &error) { | 293 | .onError([](const KAsync::Error &error) { |
291 | qWarning() << "Error while creating identity: " << error.errorMessage; | 294 | SinkWarning() << "Error while creating identity: " << error.errorMessage; |
292 | }) | 295 | }) |
293 | .exec(); | 296 | .exec(); |
294 | } | 297 | } |
@@ -297,12 +300,12 @@ void AccountSettings::saveIdentity() | |||
297 | void AccountSettings::removeResource(const QByteArray &identifier) | 300 | void AccountSettings::removeResource(const QByteArray &identifier) |
298 | { | 301 | { |
299 | if (identifier.isEmpty()) { | 302 | if (identifier.isEmpty()) { |
300 | qWarning() << "We're missing an identifier"; | 303 | SinkWarning() << "We're missing an identifier"; |
301 | } else { | 304 | } else { |
302 | SinkResource resource(identifier); | 305 | SinkResource resource(identifier); |
303 | Store::remove(resource) | 306 | Store::remove(resource) |
304 | .onError([](const KAsync::Error &error) { | 307 | .onError([](const KAsync::Error &error) { |
305 | qWarning() << "Error while removing resource: " << error.errorMessage; | 308 | SinkWarning() << "Error while removing resource: " << error.errorMessage; |
306 | }) | 309 | }) |
307 | .exec(); | 310 | .exec(); |
308 | } | 311 | } |
@@ -311,12 +314,12 @@ void AccountSettings::removeResource(const QByteArray &identifier) | |||
311 | void AccountSettings::removeAccount() | 314 | void AccountSettings::removeAccount() |
312 | { | 315 | { |
313 | if (mAccountIdentifier.isEmpty()) { | 316 | if (mAccountIdentifier.isEmpty()) { |
314 | qWarning() << "We're missing an identifier"; | 317 | SinkWarning() << "We're missing an identifier"; |
315 | } else { | 318 | } else { |
316 | SinkAccount account(mAccountIdentifier); | 319 | SinkAccount account(mAccountIdentifier); |
317 | Store::remove(account) | 320 | Store::remove(account) |
318 | .onError([](const KAsync::Error &error) { | 321 | .onError([](const KAsync::Error &error) { |
319 | qWarning() << "Error while removing account: " << error.errorMessage; | 322 | SinkWarning() << "Error while removing account: " << error.errorMessage; |
320 | }) | 323 | }) |
321 | .exec(); | 324 | .exec(); |
322 | } | 325 | } |
@@ -325,12 +328,12 @@ void AccountSettings::removeAccount() | |||
325 | void AccountSettings::removeIdentity() | 328 | void AccountSettings::removeIdentity() |
326 | { | 329 | { |
327 | if (mIdentityIdentifier.isEmpty()) { | 330 | if (mIdentityIdentifier.isEmpty()) { |
328 | qWarning() << "We're missing an identifier"; | 331 | SinkWarning() << "We're missing an identifier"; |
329 | } else { | 332 | } else { |
330 | Identity identity(mIdentityIdentifier); | 333 | Identity identity(mIdentityIdentifier); |
331 | Store::remove(identity) | 334 | Store::remove(identity) |
332 | .onError([](const KAsync::Error &error) { | 335 | .onError([](const KAsync::Error &error) { |
333 | qWarning() << "Error while removing identity: " << error.errorMessage; | 336 | SinkWarning() << "Error while removing identity: " << error.errorMessage; |
334 | }) | 337 | }) |
335 | .exec(); | 338 | .exec(); |
336 | } | 339 | } |