diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/clientapi.cpp | 12 | ||||
-rw-r--r-- | common/clientapi.h | 2 | ||||
-rw-r--r-- | common/commands.h | 1 |
3 files changed, 15 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 |
diff --git a/common/clientapi.h b/common/clientapi.h index 542039e..71317a1 100644 --- a/common/clientapi.h +++ b/common/clientapi.h | |||
@@ -488,6 +488,8 @@ public: | |||
488 | auto facade = FacadeFactory::instance().getFacade<DomainType>(resourceIdentifier); | 488 | auto facade = FacadeFactory::instance().getFacade<DomainType>(resourceIdentifier); |
489 | facade.remove(domainObject); | 489 | facade.remove(domainObject); |
490 | } | 490 | } |
491 | |||
492 | static void shutdown(const QString &resourceIdentifier); | ||
491 | }; | 493 | }; |
492 | 494 | ||
493 | } | 495 | } |
diff --git a/common/commands.h b/common/commands.h index c63bb47..26729dc 100644 --- a/common/commands.h +++ b/common/commands.h | |||
@@ -42,6 +42,7 @@ enum CommandIds { | |||
42 | ModifyEntityCommand, | 42 | ModifyEntityCommand, |
43 | CreateEntityCommand, | 43 | CreateEntityCommand, |
44 | SearchSourceCommand, // need a buffer definition for this, but relies on Query API | 44 | SearchSourceCommand, // need a buffer definition for this, but relies on Query API |
45 | ShutdownCommand, | ||
45 | CustomCommand = 0xffff | 46 | CustomCommand = 0xffff |
46 | }; | 47 | }; |
47 | 48 | ||