From 859f30d21532644c3b90e79f6686aa7375046087 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Thu, 12 Jan 2017 12:54:14 +0100 Subject: syncThen is no longer necessary. --- framework/accounts/accountfactory.cpp | 2 +- framework/accounts/gmailcontroller.cpp | 2 +- framework/accounts/kolabnowcontroller.cpp | 2 +- framework/accounts/maildircontroller.cpp | 4 ++-- framework/actions/actionhandler.cpp | 2 +- framework/actions/actionhandler.h | 2 +- framework/domain/composercontroller.cpp | 6 +++--- framework/domain/identitiesmodel.cpp | 2 +- framework/domain/settings/accountsettings.cpp | 10 +++++----- 9 files changed, 16 insertions(+), 16 deletions(-) (limited to 'framework') diff --git a/framework/accounts/accountfactory.cpp b/framework/accounts/accountfactory.cpp index 182a0a1d..c590e4b6 100644 --- a/framework/accounts/accountfactory.cpp +++ b/framework/accounts/accountfactory.cpp @@ -44,7 +44,7 @@ void AccountFactory::setAccountId(const QString &accountId) { mAccountId = accountId; Sink::Store::fetchOne(Sink::Query().filter(accountId.toUtf8())) - .syncThen([this](const Sink::ApplicationDomain::SinkAccount &account) { + .then([this](const Sink::ApplicationDomain::SinkAccount &account) { mAccountType = account.getProperty("type").toByteArray(); loadPackage(); }).exec(); diff --git a/framework/accounts/gmailcontroller.cpp b/framework/accounts/gmailcontroller.cpp index bc644ae9..89877117 100644 --- a/framework/accounts/gmailcontroller.cpp +++ b/framework/accounts/gmailcontroller.cpp @@ -80,7 +80,7 @@ void GmailController::load(const QByteArray &id) { m_accountId = id; Store::fetchOne(Query().filter(m_accountId)) - .syncThen([this](const SinkAccount &account) { + .then([this](const SinkAccount &account) { setName(account.getName()); }).exec(); diff --git a/framework/accounts/kolabnowcontroller.cpp b/framework/accounts/kolabnowcontroller.cpp index 94ca2e01..5968dc26 100644 --- a/framework/accounts/kolabnowcontroller.cpp +++ b/framework/accounts/kolabnowcontroller.cpp @@ -80,7 +80,7 @@ void KolabNowController::load(const QByteArray &id) { m_accountId = id; Store::fetchOne(Query().filter(m_accountId)) - .syncThen([this](const SinkAccount &account) { + .then([this](const SinkAccount &account) { setName(account.getName()); }).exec(); diff --git a/framework/accounts/maildircontroller.cpp b/framework/accounts/maildircontroller.cpp index 481d43d8..c2e15eb8 100644 --- a/framework/accounts/maildircontroller.cpp +++ b/framework/accounts/maildircontroller.cpp @@ -65,13 +65,13 @@ void MaildirController::load(const QByteArray &id) { clear(); Store::fetchOne(Query().filter(m_accountId)) - .syncThen([this](const SinkAccount &account) { + .then([this](const SinkAccount &account) { setIcon(account.getIcon()); setName(account.getName()); }).exec(); Store::fetchOne(Query().filter(m_accountId).containsFilter(ResourceCapabilities::Mail::storage)) - .syncThen([this](const SinkResource &resource) { + .then([this](const SinkResource &resource) { m_resourceId = resource.identifier(); setPath(resource.getProperty("path").toString()); }).exec(); diff --git a/framework/actions/actionhandler.cpp b/framework/actions/actionhandler.cpp index eb7b3224..99fdf66a 100644 --- a/framework/actions/actionhandler.cpp +++ b/framework/actions/actionhandler.cpp @@ -138,7 +138,7 @@ ActionResult ActionHandlerHelper::execute(Context *context) handlerFunction(context); result.setDone(); } else { - jobHandlerFunction(context).syncThen([=](const KAsync::Error &error) { + jobHandlerFunction(context).then([=](const KAsync::Error &error) { auto modifyableResult = result; if (error) { qWarning() << "Job failed: " << error.errorCode << error.errorMessage; diff --git a/framework/actions/actionhandler.h b/framework/actions/actionhandler.h index 5ccf0ac7..c0e1b318 100644 --- a/framework/actions/actionhandler.h +++ b/framework/actions/actionhandler.h @@ -73,7 +73,7 @@ public: ActionResult result; auto wrapper = ContextType{*c}; execute(wrapper) - .template syncThen([=](const KAsync::Error &error) { + .template then([=](const KAsync::Error &error) { auto modifyableResult = result; if (error) { qWarning() << "Job failed: " << error.errorCode << error.errorMessage; diff --git a/framework/domain/composercontroller.cpp b/framework/domain/composercontroller.cpp index 9fb2c6f8..f1c04ea9 100644 --- a/framework/domain/composercontroller.cpp +++ b/framework/domain/composercontroller.cpp @@ -123,7 +123,7 @@ void ComposerController::loadMessage(const QVariant &message, bool loadAsDraft) { Sink::Query query(*message.value()); query.request(); - Sink::Store::fetchOne(query).syncThen([this, loadAsDraft](const Sink::ApplicationDomain::Mail &mail) { + Sink::Store::fetchOne(query).then([this, loadAsDraft](const Sink::ApplicationDomain::Mail &mail) { setExistingMail(mail); //TODO this should probably happen as reaction to the property being set. @@ -233,7 +233,7 @@ void ComposerController::send() } return KAsync::error(0, "Failed to find a MailTransport resource."); }) - .syncThen([&] (const KAsync::Error &error) { + .then([&] (const KAsync::Error &error) { emit done(); }); run(job); @@ -279,7 +279,7 @@ void ComposerController::saveAsDraft() return Store::modify(existingMail); } }(); - job = job.syncThen([&] { + job = job.then([&] { emit done(); }); run(job); diff --git a/framework/domain/identitiesmodel.cpp b/framework/domain/identitiesmodel.cpp index 33cc191c..49c08005 100644 --- a/framework/domain/identitiesmodel.cpp +++ b/framework/domain/identitiesmodel.cpp @@ -88,7 +88,7 @@ void IdentitiesModel::runQuery(const Sink::Query &query) setSourceModel(mModel.data()); Sink::Store::fetchAll(Sink::Query()) - .syncThen >([this](const QList &accounts) { + .then([this](const QList &accounts) { for (const auto &account : accounts) { mAccountNames.insert(account->identifier(), account->getName()); mAccountIcons.insert(account->identifier(), account->getIcon()); diff --git a/framework/domain/settings/accountsettings.cpp b/framework/domain/settings/accountsettings.cpp index 067d1d79..d7c8c1c0 100644 --- a/framework/domain/settings/accountsettings.cpp +++ b/framework/domain/settings/accountsettings.cpp @@ -152,7 +152,7 @@ void AccountSettings::loadAccount() { Q_ASSERT(!mAccountIdentifier.isEmpty()); Store::fetchOne(Query().filter(mAccountIdentifier)) - .syncThen([this](const SinkAccount &account) { + .then([this](const SinkAccount &account) { mIcon = account.getIcon(); mName = account.getName(); emit changed(); @@ -162,7 +162,7 @@ void AccountSettings::loadAccount() void AccountSettings::loadImapResource() { Store::fetchOne(Query().filter(mAccountIdentifier).containsFilter(ResourceCapabilities::Mail::storage)) - .syncThen([this](const SinkResource &resource) { + .then([this](const SinkResource &resource) { mImapIdentifier = resource.identifier(); mImapServer = resource.getProperty("server").toString(); mImapUsername = resource.getProperty("username").toString(); @@ -176,7 +176,7 @@ void AccountSettings::loadImapResource() void AccountSettings::loadMaildirResource() { Store::fetchOne(Query().filter(mAccountIdentifier).containsFilter(ResourceCapabilities::Mail::storage)) - .syncThen([this](const SinkResource &resource) { + .then([this](const SinkResource &resource) { mMaildirIdentifier = resource.identifier(); auto path = resource.getProperty("path").toString(); if (mPath != path) { @@ -191,7 +191,7 @@ void AccountSettings::loadMaildirResource() void AccountSettings::loadMailtransportResource() { Store::fetchOne(Query().filter(mAccountIdentifier).containsFilter(ResourceCapabilities::Mail::transport)) - .syncThen([this](const SinkResource &resource) { + .then([this](const SinkResource &resource) { mMailtransportIdentifier = resource.identifier(); mSmtpServer = resource.getProperty("server").toString(); mSmtpUsername = resource.getProperty("username").toString(); @@ -206,7 +206,7 @@ void AccountSettings::loadIdentity() { //FIXME this assumes that we only ever have one identity per account Store::fetchOne(Query().filter(mAccountIdentifier)) - .syncThen([this](const Identity &identity) { + .then([this](const Identity &identity) { mIdentityIdentifier = identity.identifier(); mUsername = identity.getName(); mEmailAddress = identity.getAddress(); -- cgit v1.2.3