diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-01-30 01:10:37 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-01-30 01:10:37 +0100 |
commit | bf00b2c3a0fbfbdcbd7c5f4ab519049dc02c1263 (patch) | |
tree | 1facb41649496418c5a2120391917e28302f8270 /common/clientapi.cpp | |
parent | e7743002a75d83e24de94f712fac0f0b61ab0ca3 (diff) | |
download | sink-bf00b2c3a0fbfbdcbd7c5f4ab519049dc02c1263.tar.gz sink-bf00b2c3a0fbfbdcbd7c5f4ab519049dc02c1263.zip |
Shutdown command for synchronizers, used by the dummyresourcetest.
Otherwise the synchronizer keeps a Storage object alive, while the tests
deletes the db. This causes subsequent writes to fail in the next test.
Diffstat (limited to 'common/clientapi.cpp')
-rw-r--r-- | common/clientapi.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/common/clientapi.cpp b/common/clientapi.cpp index 2a4b603..260b6b8 100644 --- a/common/clientapi.cpp +++ b/common/clientapi.cpp | |||
@@ -1,5 +1,7 @@ | |||
1 | 1 | ||
2 | #include "clientapi.h" | 2 | #include "clientapi.h" |
3 | #include "resourceaccess.h" | ||
4 | #include "commands.h" | ||
3 | 5 | ||
4 | namespace async | 6 | namespace async |
5 | { | 7 | { |
@@ -35,4 +37,14 @@ QString getTypeName<Todo>() | |||
35 | 37 | ||
36 | } // namespace Domain | 38 | } // namespace Domain |
37 | 39 | ||
40 | void Store::shutdown(const QString &identifier) | ||
41 | { | ||
42 | Akonadi2::ResourceAccess resourceAccess(identifier); | ||
43 | resourceAccess.open(); | ||
44 | resourceAccess.sendCommand(Akonadi2::Commands::ShutdownCommand).then<void>([](Async::Future<void> &f){ | ||
45 | //TODO wait for disconnect | ||
46 | f.setFinished(); | ||
47 | }).exec().waitForFinished(); | ||
48 | } | ||
49 | |||
38 | } // namespace Akonadi2 | 50 | } // namespace Akonadi2 |