From 93f224b1f6ca0a69a5c4610466baa43b43d042e3 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Thu, 2 Apr 2015 17:17:16 +0200 Subject: async simplifications --- common/clientapi.cpp | 5 +---- common/clientapi.h | 3 +-- 2 files changed, 2 insertions(+), 6 deletions(-) (limited to 'common') diff --git a/common/clientapi.cpp b/common/clientapi.cpp index 10115da..6f0b421 100644 --- a/common/clientapi.cpp +++ b/common/clientapi.cpp @@ -36,10 +36,7 @@ void Store::shutdown(const QString &identifier) Akonadi2::ResourceAccess resourceAccess(identifier); //FIXME this starts the resource, just to shut it down again if it's not running in the first place. resourceAccess.open(); - resourceAccess.sendCommand(Akonadi2::Commands::ShutdownCommand).then([](Async::Future &f){ - //TODO wait for disconnect - f.setFinished(); - }).exec().waitForFinished(); + resourceAccess.sendCommand(Akonadi2::Commands::ShutdownCommand).exec().waitForFinished(); } } // namespace Akonadi2 diff --git a/common/clientapi.h b/common/clientapi.h index f015b56..63305ab 100644 --- a/common/clientapi.h +++ b/common/clientapi.h @@ -438,10 +438,9 @@ public: }).exec(); }); } - job.then([/* eventloop, */resultSet](Async::Future &future) { + job.then([resultSet]() { qDebug() << "Query complete"; resultSet->complete(); - future.setFinished(); }).exec().waitForFinished(); //We use the eventloop provided by waitForFinished to keep the thread alive until all is done }); return resultSet->emitter(); -- cgit v1.2.3