summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/asyncutils.h2
-rw-r--r--common/commandprocessor.cpp2
-rw-r--r--common/queryrunner.cpp2
-rw-r--r--common/resourcefacade.cpp6
-rw-r--r--common/synchronizer.cpp8
-rw-r--r--common/test.cpp2
6 files changed, 11 insertions, 11 deletions
diff --git a/common/asyncutils.h b/common/asyncutils.h
index 7b62eb2..67b5928 100644
--- a/common/asyncutils.h
+++ b/common/asyncutils.h
@@ -39,7 +39,7 @@ KAsync::Job<T> run(const std::function<T()> &f, bool runAsync = true)
39 }); 39 });
40 }); 40 });
41 } else { 41 } else {
42 return KAsync::syncStart<T>([f]() { 42 return KAsync::start<T>([f]() {
43 return f(); 43 return f();
44 }); 44 });
45 } 45 }
diff --git a/common/commandprocessor.cpp b/common/commandprocessor.cpp
index 5d5261f..33e2f81 100644
--- a/common/commandprocessor.cpp
+++ b/common/commandprocessor.cpp
@@ -227,7 +227,7 @@ KAsync::Job<qint64> CommandProcessor::processQueuedCommand(const QByteArray &dat
227KAsync::Job<void> CommandProcessor::processQueue(MessageQueue *queue) 227KAsync::Job<void> CommandProcessor::processQueue(MessageQueue *queue)
228{ 228{
229 auto time = QSharedPointer<QTime>::create(); 229 auto time = QSharedPointer<QTime>::create();
230 return KAsync::syncStart<void>([this]() { mPipeline->startTransaction(); }) 230 return KAsync::start([this]() { mPipeline->startTransaction(); })
231 .then(KAsync::doWhile( 231 .then(KAsync::doWhile(
232 [this, queue, time]() -> KAsync::Job<KAsync::ControlFlowFlag> { 232 [this, queue, time]() -> KAsync::Job<KAsync::ControlFlowFlag> {
233 return queue->dequeueBatch(sBatchSize, 233 return queue->dequeueBatch(sBatchSize,
diff --git a/common/queryrunner.cpp b/common/queryrunner.cpp
index cb3687f..802fc48 100644
--- a/common/queryrunner.cpp
+++ b/common/queryrunner.cpp
@@ -125,7 +125,7 @@ QueryRunner<DomainType>::QueryRunner(const Sink::Query &query, const Sink::Resou
125 return KAsync::null(); 125 return KAsync::null();
126 } 126 }
127 Q_ASSERT(!mQueryInProgress); 127 Q_ASSERT(!mQueryInProgress);
128 return KAsync::syncStart<void>([&] { 128 return KAsync::start([&] {
129 mQueryInProgress = true; 129 mQueryInProgress = true;
130 }) 130 })
131 .then(async::run<ReplayResult>([=]() { 131 .then(async::run<ReplayResult>([=]() {
diff --git a/common/resourcefacade.cpp b/common/resourcefacade.cpp
index 13cad64..4a8037d 100644
--- a/common/resourcefacade.cpp
+++ b/common/resourcefacade.cpp
@@ -196,7 +196,7 @@ KAsync::Job<void> LocalStorageFacade<DomainType>::create(const DomainType &domai
196{ 196{
197 auto configStoreIdentifier = mIdentifier; 197 auto configStoreIdentifier = mIdentifier;
198 auto typeName = mTypeName; 198 auto typeName = mTypeName;
199 return KAsync::syncStart<void>([domainObject, configStoreIdentifier, typeName]() { 199 return KAsync::start([domainObject, configStoreIdentifier, typeName]() {
200 const QByteArray type = domainObject.getProperty(typeName).toByteArray(); 200 const QByteArray type = domainObject.getProperty(typeName).toByteArray();
201 const QByteArray providedIdentifier = domainObject.identifier().isEmpty() ? domainObject.getProperty("identifier").toByteArray() : domainObject.identifier(); 201 const QByteArray providedIdentifier = domainObject.identifier().isEmpty() ? domainObject.getProperty("identifier").toByteArray() : domainObject.identifier();
202 const QByteArray identifier = providedIdentifier.isEmpty() ? ResourceConfig::newIdentifier(type) : providedIdentifier; 202 const QByteArray identifier = providedIdentifier.isEmpty() ? ResourceConfig::newIdentifier(type) : providedIdentifier;
@@ -222,7 +222,7 @@ KAsync::Job<void> LocalStorageFacade<DomainType>::modify(const DomainType &domai
222{ 222{
223 auto configStoreIdentifier = mIdentifier; 223 auto configStoreIdentifier = mIdentifier;
224 auto typeName = mTypeName; 224 auto typeName = mTypeName;
225 return KAsync::syncStart<void>([domainObject, configStoreIdentifier, typeName]() { 225 return KAsync::start([domainObject, configStoreIdentifier, typeName]() {
226 const QByteArray identifier = domainObject.identifier(); 226 const QByteArray identifier = domainObject.identifier();
227 if (identifier.isEmpty()) { 227 if (identifier.isEmpty()) {
228 SinkWarning() << "We need an \"identifier\" property to identify the entity to configure."; 228 SinkWarning() << "We need an \"identifier\" property to identify the entity to configure.";
@@ -263,7 +263,7 @@ KAsync::Job<void> LocalStorageFacade<DomainType>::remove(const DomainType &domai
263{ 263{
264 auto configStoreIdentifier = mIdentifier; 264 auto configStoreIdentifier = mIdentifier;
265 auto typeName = mTypeName; 265 auto typeName = mTypeName;
266 return KAsync::syncStart<void>([domainObject, configStoreIdentifier, typeName]() { 266 return KAsync::start([domainObject, configStoreIdentifier, typeName]() {
267 const QByteArray identifier = domainObject.identifier(); 267 const QByteArray identifier = domainObject.identifier();
268 if (identifier.isEmpty()) { 268 if (identifier.isEmpty()) {
269 SinkWarning() << "We need an \"identifier\" property to identify the entity to configure"; 269 SinkWarning() << "We need an \"identifier\" property to identify the entity to configure";
diff --git a/common/synchronizer.cpp b/common/synchronizer.cpp
index 57c5d90..b147615 100644
--- a/common/synchronizer.cpp
+++ b/common/synchronizer.cpp
@@ -289,7 +289,7 @@ void Synchronizer::flushComplete(const QByteArray &flushId)
289KAsync::Job<void> Synchronizer::processRequest(const SyncRequest &request) 289KAsync::Job<void> Synchronizer::processRequest(const SyncRequest &request)
290{ 290{
291 if (request.options & SyncRequest::RequestFlush) { 291 if (request.options & SyncRequest::RequestFlush) {
292 return KAsync::syncStart<void>([=] { 292 return KAsync::start([=] {
293 //Trigger a flush and record original request without flush option 293 //Trigger a flush and record original request without flush option
294 auto modifiedRequest = request; 294 auto modifiedRequest = request;
295 modifiedRequest.options = SyncRequest::NoOptions; 295 modifiedRequest.options = SyncRequest::NoOptions;
@@ -309,7 +309,7 @@ KAsync::Job<void> Synchronizer::processRequest(const SyncRequest &request)
309 enqueueCommand(Sink::Commands::FlushCommand, BufferUtils::extractBuffer(fbb)); 309 enqueueCommand(Sink::Commands::FlushCommand, BufferUtils::extractBuffer(fbb));
310 }); 310 });
311 } else if (request.requestType == Synchronizer::SyncRequest::Synchronization) { 311 } else if (request.requestType == Synchronizer::SyncRequest::Synchronization) {
312 return KAsync::syncStart<void>([this, request] { 312 return KAsync::start([this, request] {
313 Sink::Notification n; 313 Sink::Notification n;
314 n.id = request.requestId; 314 n.id = request.requestId;
315 n.type = Notification::Status; 315 n.type = Notification::Status;
@@ -343,7 +343,7 @@ KAsync::Job<void> Synchronizer::processRequest(const SyncRequest &request)
343 } 343 }
344 }); 344 });
345 } else if (request.requestType == Synchronizer::SyncRequest::Flush) { 345 } else if (request.requestType == Synchronizer::SyncRequest::Flush) {
346 return KAsync::syncStart<void>([=] { 346 return KAsync::start([=] {
347 Q_ASSERT(!request.requestId.isEmpty()); 347 Q_ASSERT(!request.requestId.isEmpty());
348 //FIXME it looks like this is emitted before the replay actually finishes 348 //FIXME it looks like this is emitted before the replay actually finishes
349 if (request.flushType == Flush::FlushReplayQueue) { 349 if (request.flushType == Flush::FlushReplayQueue) {
@@ -387,7 +387,7 @@ KAsync::Job<void> Synchronizer::processSyncQueue()
387 } 387 }
388 388
389 const auto request = mSyncRequestQueue.takeFirst(); 389 const auto request = mSyncRequestQueue.takeFirst();
390 return KAsync::syncStart<void>([this] { 390 return KAsync::start([this] {
391 mMessageQueue->startTransaction(); 391 mMessageQueue->startTransaction();
392 mEntityStore->startTransaction(Sink::Storage::DataStore::ReadOnly); 392 mEntityStore->startTransaction(Sink::Storage::DataStore::ReadOnly);
393 mSyncInProgress = true; 393 mSyncInProgress = true;
diff --git a/common/test.cpp b/common/test.cpp
index 387fcda..90586ba 100644
--- a/common/test.cpp
+++ b/common/test.cpp
@@ -168,7 +168,7 @@ public:
168 } 168 }
169 resultProvider->initialResultSetComplete(parent, true); 169 resultProvider->initialResultSetComplete(parent, true);
170 }); 170 });
171 auto job = KAsync::syncStart<void>([query, resultProvider]() {}); 171 auto job = KAsync::start([query, resultProvider]() {});
172 return qMakePair(job, emitter); 172 return qMakePair(job, emitter);
173 } 173 }
174 174