diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-01-12 12:54:14 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-01-12 12:54:14 +0100 |
commit | 859f30d21532644c3b90e79f6686aa7375046087 (patch) | |
tree | d01790bfed07916ccada9193650f56127cb3e715 /framework/domain | |
parent | 654092d41253ff993095b845a6c3e338a563547e (diff) | |
download | kube-859f30d21532644c3b90e79f6686aa7375046087.tar.gz kube-859f30d21532644c3b90e79f6686aa7375046087.zip |
syncThen is no longer necessary.
Diffstat (limited to 'framework/domain')
-rw-r--r-- | framework/domain/composercontroller.cpp | 6 | ||||
-rw-r--r-- | framework/domain/identitiesmodel.cpp | 2 | ||||
-rw-r--r-- | framework/domain/settings/accountsettings.cpp | 10 |
3 files changed, 9 insertions, 9 deletions
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) | |||
123 | { | 123 | { |
124 | Sink::Query query(*message.value<Sink::ApplicationDomain::Mail::Ptr>()); | 124 | Sink::Query query(*message.value<Sink::ApplicationDomain::Mail::Ptr>()); |
125 | query.request<Sink::ApplicationDomain::Mail::MimeMessage>(); | 125 | query.request<Sink::ApplicationDomain::Mail::MimeMessage>(); |
126 | Sink::Store::fetchOne<Sink::ApplicationDomain::Mail>(query).syncThen<void, Sink::ApplicationDomain::Mail>([this, loadAsDraft](const Sink::ApplicationDomain::Mail &mail) { | 126 | Sink::Store::fetchOne<Sink::ApplicationDomain::Mail>(query).then([this, loadAsDraft](const Sink::ApplicationDomain::Mail &mail) { |
127 | setExistingMail(mail); | 127 | setExistingMail(mail); |
128 | 128 | ||
129 | //TODO this should probably happen as reaction to the property being set. | 129 | //TODO this should probably happen as reaction to the property being set. |
@@ -233,7 +233,7 @@ void ComposerController::send() | |||
233 | } | 233 | } |
234 | return KAsync::error<void>(0, "Failed to find a MailTransport resource."); | 234 | return KAsync::error<void>(0, "Failed to find a MailTransport resource."); |
235 | }) | 235 | }) |
236 | .syncThen<void>([&] (const KAsync::Error &error) { | 236 | .then([&] (const KAsync::Error &error) { |
237 | emit done(); | 237 | emit done(); |
238 | }); | 238 | }); |
239 | run(job); | 239 | run(job); |
@@ -279,7 +279,7 @@ void ComposerController::saveAsDraft() | |||
279 | return Store::modify(existingMail); | 279 | return Store::modify(existingMail); |
280 | } | 280 | } |
281 | }(); | 281 | }(); |
282 | job = job.syncThen<void>([&] { | 282 | job = job.then([&] { |
283 | emit done(); | 283 | emit done(); |
284 | }); | 284 | }); |
285 | run(job); | 285 | 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) | |||
88 | setSourceModel(mModel.data()); | 88 | setSourceModel(mModel.data()); |
89 | 89 | ||
90 | Sink::Store::fetchAll<Sink::ApplicationDomain::SinkAccount>(Sink::Query()) | 90 | Sink::Store::fetchAll<Sink::ApplicationDomain::SinkAccount>(Sink::Query()) |
91 | .syncThen<void, QList<Sink::ApplicationDomain::SinkAccount::Ptr> >([this](const QList<Sink::ApplicationDomain::SinkAccount::Ptr> &accounts) { | 91 | .then([this](const QList<Sink::ApplicationDomain::SinkAccount::Ptr> &accounts) { |
92 | for (const auto &account : accounts) { | 92 | for (const auto &account : accounts) { |
93 | mAccountNames.insert(account->identifier(), account->getName()); | 93 | mAccountNames.insert(account->identifier(), account->getName()); |
94 | mAccountIcons.insert(account->identifier(), account->getIcon()); | 94 | 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() | |||
152 | { | 152 | { |
153 | Q_ASSERT(!mAccountIdentifier.isEmpty()); | 153 | Q_ASSERT(!mAccountIdentifier.isEmpty()); |
154 | Store::fetchOne<SinkAccount>(Query().filter(mAccountIdentifier)) | 154 | Store::fetchOne<SinkAccount>(Query().filter(mAccountIdentifier)) |
155 | .syncThen<void, SinkAccount>([this](const SinkAccount &account) { | 155 | .then([this](const SinkAccount &account) { |
156 | mIcon = account.getIcon(); | 156 | mIcon = account.getIcon(); |
157 | mName = account.getName(); | 157 | mName = account.getName(); |
158 | emit changed(); | 158 | emit changed(); |
@@ -162,7 +162,7 @@ void AccountSettings::loadAccount() | |||
162 | void AccountSettings::loadImapResource() | 162 | void AccountSettings::loadImapResource() |
163 | { | 163 | { |
164 | Store::fetchOne<SinkResource>(Query().filter<SinkResource::Account>(mAccountIdentifier).containsFilter<SinkResource::Capabilities>(ResourceCapabilities::Mail::storage)) | 164 | Store::fetchOne<SinkResource>(Query().filter<SinkResource::Account>(mAccountIdentifier).containsFilter<SinkResource::Capabilities>(ResourceCapabilities::Mail::storage)) |
165 | .syncThen<void, SinkResource>([this](const SinkResource &resource) { | 165 | .then([this](const SinkResource &resource) { |
166 | mImapIdentifier = resource.identifier(); | 166 | mImapIdentifier = resource.identifier(); |
167 | mImapServer = resource.getProperty("server").toString(); | 167 | mImapServer = resource.getProperty("server").toString(); |
168 | mImapUsername = resource.getProperty("username").toString(); | 168 | mImapUsername = resource.getProperty("username").toString(); |
@@ -176,7 +176,7 @@ void AccountSettings::loadImapResource() | |||
176 | void AccountSettings::loadMaildirResource() | 176 | void AccountSettings::loadMaildirResource() |
177 | { | 177 | { |
178 | Store::fetchOne<SinkResource>(Query().filter<SinkResource::Account>(mAccountIdentifier).containsFilter<SinkResource::Capabilities>(ResourceCapabilities::Mail::storage)) | 178 | Store::fetchOne<SinkResource>(Query().filter<SinkResource::Account>(mAccountIdentifier).containsFilter<SinkResource::Capabilities>(ResourceCapabilities::Mail::storage)) |
179 | .syncThen<void, SinkResource>([this](const SinkResource &resource) { | 179 | .then([this](const SinkResource &resource) { |
180 | mMaildirIdentifier = resource.identifier(); | 180 | mMaildirIdentifier = resource.identifier(); |
181 | auto path = resource.getProperty("path").toString(); | 181 | auto path = resource.getProperty("path").toString(); |
182 | if (mPath != path) { | 182 | if (mPath != path) { |
@@ -191,7 +191,7 @@ void AccountSettings::loadMaildirResource() | |||
191 | void AccountSettings::loadMailtransportResource() | 191 | void AccountSettings::loadMailtransportResource() |
192 | { | 192 | { |
193 | Store::fetchOne<SinkResource>(Query().filter<SinkResource::Account>(mAccountIdentifier).containsFilter<SinkResource::Capabilities>(ResourceCapabilities::Mail::transport)) | 193 | Store::fetchOne<SinkResource>(Query().filter<SinkResource::Account>(mAccountIdentifier).containsFilter<SinkResource::Capabilities>(ResourceCapabilities::Mail::transport)) |
194 | .syncThen<void, SinkResource>([this](const SinkResource &resource) { | 194 | .then([this](const SinkResource &resource) { |
195 | mMailtransportIdentifier = resource.identifier(); | 195 | mMailtransportIdentifier = resource.identifier(); |
196 | mSmtpServer = resource.getProperty("server").toString(); | 196 | mSmtpServer = resource.getProperty("server").toString(); |
197 | mSmtpUsername = resource.getProperty("username").toString(); | 197 | mSmtpUsername = resource.getProperty("username").toString(); |
@@ -206,7 +206,7 @@ void AccountSettings::loadIdentity() | |||
206 | { | 206 | { |
207 | //FIXME this assumes that we only ever have one identity per account | 207 | //FIXME this assumes that we only ever have one identity per account |
208 | Store::fetchOne<Identity>(Query().filter<Identity::Account>(mAccountIdentifier)) | 208 | Store::fetchOne<Identity>(Query().filter<Identity::Account>(mAccountIdentifier)) |
209 | .syncThen<void, Identity>([this](const Identity &identity) { | 209 | .then([this](const Identity &identity) { |
210 | mIdentityIdentifier = identity.identifier(); | 210 | mIdentityIdentifier = identity.identifier(); |
211 | mUsername = identity.getName(); | 211 | mUsername = identity.getName(); |
212 | mEmailAddress = identity.getAddress(); | 212 | mEmailAddress = identity.getAddress(); |