summaryrefslogtreecommitdiffstats
path: root/common/clientapi.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'common/clientapi.cpp')
-rw-r--r--common/clientapi.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/common/clientapi.cpp b/common/clientapi.cpp
index 5c0bcb8..deab962 100644
--- a/common/clientapi.cpp
+++ b/common/clientapi.cpp
@@ -25,6 +25,7 @@
25#include <QEventLoop> 25#include <QEventLoop>
26#include <QAbstractItemModel> 26#include <QAbstractItemModel>
27#include <QDir> 27#include <QDir>
28#include <QUuid>
28#include <functional> 29#include <functional>
29#include <memory> 30#include <memory>
30 31
@@ -289,10 +290,26 @@ KAsync::Job<QList<typename DomainType::Ptr> > Store::fetch(const Akonadi2::Query
289 }); 290 });
290} 291}
291 292
293template <class DomainType>
294KAsync::Job<void> Resources::inspect(const Inspection &inspectionCommand)
295{
296 auto resource = inspectionCommand.resourceIdentifier;
297
298 Trace() << "Sending inspection " << resource;
299 auto resourceAccess = QSharedPointer<Akonadi2::ResourceAccess>::create(resource);
300 resourceAccess->open();
301 auto id = QUuid::createUuid().toByteArray();
302 return resourceAccess->sendInspectionCommand(id, ApplicationDomain::getTypeName<DomainType>(), inspectionCommand.entityIdentifier, inspectionCommand.property, inspectionCommand.expectedValue)
303 .template then<void>([resourceAccess]() {
304 //TODO wait for inspection notification
305 });
306}
307
292#define REGISTER_TYPE(T) template KAsync::Job<void> Store::remove<T>(const T &domainObject); \ 308#define REGISTER_TYPE(T) template KAsync::Job<void> Store::remove<T>(const T &domainObject); \
293 template KAsync::Job<void> Store::create<T>(const T &domainObject); \ 309 template KAsync::Job<void> Store::create<T>(const T &domainObject); \
294 template KAsync::Job<void> Store::modify<T>(const T &domainObject); \ 310 template KAsync::Job<void> Store::modify<T>(const T &domainObject); \
295 template QSharedPointer<QAbstractItemModel> Store::loadModel<T>(Query query); \ 311 template QSharedPointer<QAbstractItemModel> Store::loadModel<T>(Query query); \
312 template KAsync::Job<void> Resources::inspect<T>(const Inspection &); \
296 template KAsync::Job<T> Store::fetchOne<T>(const Query &); \ 313 template KAsync::Job<T> Store::fetchOne<T>(const Query &); \
297 template KAsync::Job<QList<T::Ptr> > Store::fetchAll<T>(const Query &); \ 314 template KAsync::Job<QList<T::Ptr> > Store::fetchAll<T>(const Query &); \
298 template KAsync::Job<QList<T::Ptr> > Store::fetch<T>(const Query &, int); \ 315 template KAsync::Job<QList<T::Ptr> > Store::fetch<T>(const Query &, int); \