summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2015-04-02 17:17:16 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2015-04-02 17:17:16 +0200
commit93f224b1f6ca0a69a5c4610466baa43b43d042e3 (patch)
tree6c6d5063e2814a8630f173b45ea954687b819907
parent4707e725cefbf58b9f66c860680e94e6bdb9001f (diff)
downloadsink-93f224b1f6ca0a69a5c4610466baa43b43d042e3.tar.gz
sink-93f224b1f6ca0a69a5c4610466baa43b43d042e3.zip
async simplifications
-rw-r--r--common/clientapi.cpp5
-rw-r--r--common/clientapi.h3
2 files changed, 2 insertions, 6 deletions
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)
36 Akonadi2::ResourceAccess resourceAccess(identifier); 36 Akonadi2::ResourceAccess resourceAccess(identifier);
37 //FIXME this starts the resource, just to shut it down again if it's not running in the first place. 37 //FIXME this starts the resource, just to shut it down again if it's not running in the first place.
38 resourceAccess.open(); 38 resourceAccess.open();
39 resourceAccess.sendCommand(Akonadi2::Commands::ShutdownCommand).then<void>([](Async::Future<void> &f){ 39 resourceAccess.sendCommand(Akonadi2::Commands::ShutdownCommand).exec().waitForFinished();
40 //TODO wait for disconnect
41 f.setFinished();
42 }).exec().waitForFinished();
43} 40}
44 41
45} // namespace Akonadi2 42} // 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:
438 }).exec(); 438 }).exec();
439 }); 439 });
440 } 440 }
441 job.then<void>([/* eventloop, */resultSet](Async::Future<void> &future) { 441 job.then<void>([resultSet]() {
442 qDebug() << "Query complete"; 442 qDebug() << "Query complete";
443 resultSet->complete(); 443 resultSet->complete();
444 future.setFinished();
445 }).exec().waitForFinished(); //We use the eventloop provided by waitForFinished to keep the thread alive until all is done 444 }).exec().waitForFinished(); //We use the eventloop provided by waitForFinished to keep the thread alive until all is done
446 }); 445 });
447 return resultSet->emitter(); 446 return resultSet->emitter();