diff options
-rw-r--r-- | accounts/imap/tests/settingstest.cpp | 4 | ||||
-rw-r--r-- | accounts/maildir/maildircontroller.cpp | 2 | ||||
-rw-r--r-- | accounts/maildir/tests/settingstest.cpp | 4 | ||||
-rw-r--r-- | framework/accounts/accountfactory.cpp | 2 | ||||
-rw-r--r-- | framework/accounts/gmailcontroller.cpp | 2 | ||||
-rw-r--r-- | framework/accounts/kolabnowcontroller.cpp | 2 | ||||
-rw-r--r-- | framework/accounts/maildircontroller.cpp | 4 | ||||
-rw-r--r-- | framework/actions/actionhandler.cpp | 2 | ||||
-rw-r--r-- | framework/actions/actionhandler.h | 2 | ||||
-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 |
12 files changed, 21 insertions, 21 deletions
diff --git a/accounts/imap/tests/settingstest.cpp b/accounts/imap/tests/settingstest.cpp index 2fbc9b7b..69d93079 100644 --- a/accounts/imap/tests/settingstest.cpp +++ b/accounts/imap/tests/settingstest.cpp | |||
@@ -43,7 +43,7 @@ private slots: | |||
43 | settings.setProperty("emailAddress", emailAddress); | 43 | settings.setProperty("emailAddress", emailAddress); |
44 | settings.save(); | 44 | settings.save(); |
45 | 45 | ||
46 | Sink::Store::fetchAll<Sink::ApplicationDomain::SinkResource>(Sink::Query()).syncThen<void, QList<Sink::ApplicationDomain::SinkResource::Ptr>>([](const QList<Sink::ApplicationDomain::SinkResource::Ptr> &resources) { | 46 | Sink::Store::fetchAll<Sink::ApplicationDomain::SinkResource>(Sink::Query()).then([](const QList<Sink::ApplicationDomain::SinkResource::Ptr> &resources) { |
47 | QCOMPARE(resources.size(), 2); | 47 | QCOMPARE(resources.size(), 2); |
48 | }) | 48 | }) |
49 | .exec().waitForFinished(); | 49 | .exec().waitForFinished(); |
@@ -76,7 +76,7 @@ private slots: | |||
76 | settings.remove(); | 76 | settings.remove(); |
77 | } | 77 | } |
78 | 78 | ||
79 | Sink::Store::fetchAll<Sink::ApplicationDomain::SinkResource>(Sink::Query()).syncThen<void, QList<Sink::ApplicationDomain::SinkResource::Ptr>>([](const QList<Sink::ApplicationDomain::SinkResource::Ptr> &resources) { | 79 | Sink::Store::fetchAll<Sink::ApplicationDomain::SinkResource>(Sink::Query()).then([](const QList<Sink::ApplicationDomain::SinkResource::Ptr> &resources) { |
80 | QCOMPARE(resources.size(), 0); | 80 | QCOMPARE(resources.size(), 0); |
81 | }) | 81 | }) |
82 | .exec().waitForFinished(); | 82 | .exec().waitForFinished(); |
diff --git a/accounts/maildir/maildircontroller.cpp b/accounts/maildir/maildircontroller.cpp index dc34d59a..fa211284 100644 --- a/accounts/maildir/maildircontroller.cpp +++ b/accounts/maildir/maildircontroller.cpp | |||
@@ -85,7 +85,7 @@ void MaildirController::loadAccount(const QByteArray &id) | |||
85 | { | 85 | { |
86 | Q_ASSERT(!mAccountIdentifier.isEmpty()); | 86 | Q_ASSERT(!mAccountIdentifier.isEmpty()); |
87 | Store::fetchOne<SinkAccount>(Query().filter(mAccountIdentifier)) | 87 | Store::fetchOne<SinkAccount>(Query().filter(mAccountIdentifier)) |
88 | .syncThen<void, SinkAccount>([this](const SinkAccount &account) { | 88 | .then([this](const SinkAccount &account) { |
89 | mIcon = account.getIcon(); | 89 | mIcon = account.getIcon(); |
90 | mName = account.getName(); | 90 | mName = account.getName(); |
91 | emit nameChanged(); | 91 | emit nameChanged(); |
diff --git a/accounts/maildir/tests/settingstest.cpp b/accounts/maildir/tests/settingstest.cpp index 47cb3b35..bf041e3c 100644 --- a/accounts/maildir/tests/settingstest.cpp +++ b/accounts/maildir/tests/settingstest.cpp | |||
@@ -39,7 +39,7 @@ private slots: | |||
39 | settings.setProperty("emailAddress", emailAddress); | 39 | settings.setProperty("emailAddress", emailAddress); |
40 | settings.save(); | 40 | settings.save(); |
41 | 41 | ||
42 | Sink::Store::fetchAll<Sink::ApplicationDomain::SinkResource>(Sink::Query()).syncThen<void, QList<Sink::ApplicationDomain::SinkResource::Ptr>>([](const QList<Sink::ApplicationDomain::SinkResource::Ptr> &resources) { | 42 | Sink::Store::fetchAll<Sink::ApplicationDomain::SinkResource>(Sink::Query()).then([](const QList<Sink::ApplicationDomain::SinkResource::Ptr> &resources) { |
43 | QCOMPARE(resources.size(), 2); | 43 | QCOMPARE(resources.size(), 2); |
44 | }) | 44 | }) |
45 | .exec().waitForFinished(); | 45 | .exec().waitForFinished(); |
@@ -70,7 +70,7 @@ private slots: | |||
70 | settings.remove(); | 70 | settings.remove(); |
71 | } | 71 | } |
72 | 72 | ||
73 | Sink::Store::fetchAll<Sink::ApplicationDomain::SinkResource>(Sink::Query()).syncThen<void, QList<Sink::ApplicationDomain::SinkResource::Ptr>>([](const QList<Sink::ApplicationDomain::SinkResource::Ptr> &resources) { | 73 | Sink::Store::fetchAll<Sink::ApplicationDomain::SinkResource>(Sink::Query()).then([](const QList<Sink::ApplicationDomain::SinkResource::Ptr> &resources) { |
74 | QCOMPARE(resources.size(), 0); | 74 | QCOMPARE(resources.size(), 0); |
75 | }) | 75 | }) |
76 | .exec().waitForFinished(); | 76 | .exec().waitForFinished(); |
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) | |||
44 | { | 44 | { |
45 | mAccountId = accountId; | 45 | mAccountId = accountId; |
46 | Sink::Store::fetchOne<Sink::ApplicationDomain::SinkAccount>(Sink::Query().filter(accountId.toUtf8())) | 46 | Sink::Store::fetchOne<Sink::ApplicationDomain::SinkAccount>(Sink::Query().filter(accountId.toUtf8())) |
47 | .syncThen<void, Sink::ApplicationDomain::SinkAccount>([this](const Sink::ApplicationDomain::SinkAccount &account) { | 47 | .then([this](const Sink::ApplicationDomain::SinkAccount &account) { |
48 | mAccountType = account.getProperty("type").toByteArray(); | 48 | mAccountType = account.getProperty("type").toByteArray(); |
49 | loadPackage(); | 49 | loadPackage(); |
50 | }).exec(); | 50 | }).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) { | |||
80 | m_accountId = id; | 80 | m_accountId = id; |
81 | 81 | ||
82 | Store::fetchOne<SinkAccount>(Query().filter(m_accountId)) | 82 | Store::fetchOne<SinkAccount>(Query().filter(m_accountId)) |
83 | .syncThen<void, SinkAccount>([this](const SinkAccount &account) { | 83 | .then([this](const SinkAccount &account) { |
84 | setName(account.getName()); | 84 | setName(account.getName()); |
85 | }).exec(); | 85 | }).exec(); |
86 | 86 | ||
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) { | |||
80 | m_accountId = id; | 80 | m_accountId = id; |
81 | 81 | ||
82 | Store::fetchOne<SinkAccount>(Query().filter(m_accountId)) | 82 | Store::fetchOne<SinkAccount>(Query().filter(m_accountId)) |
83 | .syncThen<void, SinkAccount>([this](const SinkAccount &account) { | 83 | .then([this](const SinkAccount &account) { |
84 | setName(account.getName()); | 84 | setName(account.getName()); |
85 | }).exec(); | 85 | }).exec(); |
86 | 86 | ||
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) { | |||
65 | clear(); | 65 | clear(); |
66 | 66 | ||
67 | Store::fetchOne<SinkAccount>(Query().filter(m_accountId)) | 67 | Store::fetchOne<SinkAccount>(Query().filter(m_accountId)) |
68 | .syncThen<void, SinkAccount>([this](const SinkAccount &account) { | 68 | .then([this](const SinkAccount &account) { |
69 | setIcon(account.getIcon()); | 69 | setIcon(account.getIcon()); |
70 | setName(account.getName()); | 70 | setName(account.getName()); |
71 | }).exec(); | 71 | }).exec(); |
72 | 72 | ||
73 | Store::fetchOne<SinkResource>(Query().filter<SinkResource::Account>(m_accountId).containsFilter<SinkResource::Capabilities>(ResourceCapabilities::Mail::storage)) | 73 | Store::fetchOne<SinkResource>(Query().filter<SinkResource::Account>(m_accountId).containsFilter<SinkResource::Capabilities>(ResourceCapabilities::Mail::storage)) |
74 | .syncThen<void, SinkResource>([this](const SinkResource &resource) { | 74 | .then([this](const SinkResource &resource) { |
75 | m_resourceId = resource.identifier(); | 75 | m_resourceId = resource.identifier(); |
76 | setPath(resource.getProperty("path").toString()); | 76 | setPath(resource.getProperty("path").toString()); |
77 | }).exec(); | 77 | }).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) | |||
138 | handlerFunction(context); | 138 | handlerFunction(context); |
139 | result.setDone(); | 139 | result.setDone(); |
140 | } else { | 140 | } else { |
141 | jobHandlerFunction(context).syncThen<void>([=](const KAsync::Error &error) { | 141 | jobHandlerFunction(context).then([=](const KAsync::Error &error) { |
142 | auto modifyableResult = result; | 142 | auto modifyableResult = result; |
143 | if (error) { | 143 | if (error) { |
144 | qWarning() << "Job failed: " << error.errorCode << error.errorMessage; | 144 | 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: | |||
73 | ActionResult result; | 73 | ActionResult result; |
74 | auto wrapper = ContextType{*c}; | 74 | auto wrapper = ContextType{*c}; |
75 | execute(wrapper) | 75 | execute(wrapper) |
76 | .template syncThen<void>([=](const KAsync::Error &error) { | 76 | .template then([=](const KAsync::Error &error) { |
77 | auto modifyableResult = result; | 77 | auto modifyableResult = result; |
78 | if (error) { | 78 | if (error) { |
79 | qWarning() << "Job failed: " << error.errorCode << error.errorMessage; | 79 | 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) | |||
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(); |