summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/client/main.cpp4
-rw-r--r--examples/dummyresource/resourcefacade.cpp3
-rw-r--r--examples/dummyresource/resourcefacade.h11
-rw-r--r--examples/dummyresource/resourcefactory.cpp6
4 files changed, 16 insertions, 8 deletions
diff --git a/examples/client/main.cpp b/examples/client/main.cpp
index 9445599..a0ca51b 100644
--- a/examples/client/main.cpp
+++ b/examples/client/main.cpp
@@ -73,7 +73,7 @@ template<class T>
73class AkonadiListModel : public QAbstractListModel 73class AkonadiListModel : public QAbstractListModel
74{ 74{
75public: 75public:
76 AkonadiListModel(const QSharedPointer<async::ResultEmitter<T> > &emitter, const QByteArray &property) 76 AkonadiListModel(const QSharedPointer<Akonadi2::ResultEmitter<T> > &emitter, const QByteArray &property)
77 :QAbstractListModel(), 77 :QAbstractListModel(),
78 mEmitter(emitter) 78 mEmitter(emitter)
79 { 79 {
@@ -116,7 +116,7 @@ public:
116 } 116 }
117 117
118private: 118private:
119 QSharedPointer<async::ResultEmitter<T> > mEmitter; 119 QSharedPointer<Akonadi2::ResultEmitter<T> > mEmitter;
120 QStringList mStringList; 120 QStringList mStringList;
121}; 121};
122 122
diff --git a/examples/dummyresource/resourcefacade.cpp b/examples/dummyresource/resourcefacade.cpp
index 31c0b21..df805e4 100644
--- a/examples/dummyresource/resourcefacade.cpp
+++ b/examples/dummyresource/resourcefacade.cpp
@@ -20,6 +20,7 @@
20#include "resourcefacade.h" 20#include "resourcefacade.h"
21 21
22#include <QSettings> 22#include <QSettings>
23#include <QStandardPaths>
23 24
24DummyResourceConfigFacade::DummyResourceConfigFacade() 25DummyResourceConfigFacade::DummyResourceConfigFacade()
25 : Akonadi2::StoreFacade<Akonadi2::ApplicationDomain::AkonadiResource>() 26 : Akonadi2::StoreFacade<Akonadi2::ApplicationDomain::AkonadiResource>()
@@ -64,7 +65,7 @@ KAsync::Job<void> DummyResourceConfigFacade::remove(const Akonadi2::ApplicationD
64 return KAsync::null<void>(); 65 return KAsync::null<void>();
65} 66}
66 67
67KAsync::Job<void> DummyResourceConfigFacade::load(const Akonadi2::Query &query, const QSharedPointer<async::ResultProvider<typename Akonadi2::ApplicationDomain::AkonadiResource::Ptr> > &resultProvider) 68KAsync::Job<void> DummyResourceConfigFacade::load(const Akonadi2::Query &query, const QSharedPointer<Akonadi2::ResultProvider<typename Akonadi2::ApplicationDomain::AkonadiResource::Ptr> > &resultProvider)
68{ 69{
69 //Read configuration and list all available instances. 70 //Read configuration and list all available instances.
70 //This includes runtime information about runing instances etc. 71 //This includes runtime information about runing instances etc.
diff --git a/examples/dummyresource/resourcefacade.h b/examples/dummyresource/resourcefacade.h
index 5d0291c..5a5f46b 100644
--- a/examples/dummyresource/resourcefacade.h
+++ b/examples/dummyresource/resourcefacade.h
@@ -19,9 +19,14 @@
19 19
20#pragma once 20#pragma once
21 21
22#include "common/clientapi.h"
23
24#include <Async/Async> 22#include <Async/Async>
23#include <common/domain/applicationdomaintype.h>
24#include <common/resultprovider.h>
25#include <common/facadeinterface.h>
26
27namespace Akonadi2 {
28 class Query;
29}
25 30
26class QSettings; 31class QSettings;
27 32
@@ -37,7 +42,7 @@ public:
37 //Remove instance 42 //Remove instance
38 KAsync::Job<void> remove(const Akonadi2::ApplicationDomain::AkonadiResource &domainObject) Q_DECL_OVERRIDE; 43 KAsync::Job<void> remove(const Akonadi2::ApplicationDomain::AkonadiResource &domainObject) Q_DECL_OVERRIDE;
39 //Read configuration and available instances 44 //Read configuration and available instances
40 KAsync::Job<void> load(const Akonadi2::Query &query, const QSharedPointer<async::ResultProvider<typename Akonadi2::ApplicationDomain::AkonadiResource::Ptr> > &resultProvider) Q_DECL_OVERRIDE; 45 KAsync::Job<void> load(const Akonadi2::Query &query, const QSharedPointer<Akonadi2::ResultProvider<typename Akonadi2::ApplicationDomain::AkonadiResource::Ptr> > &resultProvider) Q_DECL_OVERRIDE;
41 46
42private: 47private:
43 QSharedPointer<QSettings> getSettings(); 48 QSharedPointer<QSettings> getSettings();
diff --git a/examples/dummyresource/resourcefactory.cpp b/examples/dummyresource/resourcefactory.cpp
index e9bf6cd..e029308 100644
--- a/examples/dummyresource/resourcefactory.cpp
+++ b/examples/dummyresource/resourcefactory.cpp
@@ -31,6 +31,8 @@
31#include "log.h" 31#include "log.h"
32#include "domain/event.h" 32#include "domain/event.h"
33#include "dummystore.h" 33#include "dummystore.h"
34#include "definitions.h"
35#include "facadefactory.h"
34 36
35//This is the resources entity type, and not the domain type 37//This is the resources entity type, and not the domain type
36#define ENTITY_TYPE_EVENT "event" 38#define ENTITY_TYPE_EVENT "event"
@@ -46,7 +48,7 @@ DummyResource::DummyResource(const QByteArray &instanceIdentifier, const QShared
46 Akonadi2::ApplicationDomain::Event event(resourceIdentifier, state.key(), -1, adaptor); 48 Akonadi2::ApplicationDomain::Event event(resourceIdentifier, state.key(), -1, adaptor);
47 Akonadi2::ApplicationDomain::TypeImplementation<Akonadi2::ApplicationDomain::Event>::index(event); 49 Akonadi2::ApplicationDomain::TypeImplementation<Akonadi2::ApplicationDomain::Event>::index(event);
48 50
49 Index ridIndex(Akonadi2::Store::storageLocation(), resourceIdentifier + ".index.rid", Akonadi2::Storage::ReadWrite); 51 Index ridIndex(Akonadi2::storageLocation(), resourceIdentifier + ".index.rid", Akonadi2::Storage::ReadWrite);
50 const auto rid = event.getProperty("remoteId"); 52 const auto rid = event.getProperty("remoteId");
51 if (rid.isValid()) { 53 if (rid.isValid()) {
52 ridIndex.add(rid.toByteArray(), event.identifier()); 54 ridIndex.add(rid.toByteArray(), event.identifier());
@@ -62,7 +64,7 @@ KAsync::Job<void> DummyResource::synchronizeWithSource()
62{ 64{
63 return KAsync::start<void>([this](KAsync::Future<void> &f) { 65 return KAsync::start<void>([this](KAsync::Future<void> &f) {
64 //TODO start transaction on index 66 //TODO start transaction on index
65 Index uidIndex(Akonadi2::Store::storageLocation(), mResourceInstanceIdentifier + ".index.uid", Akonadi2::Storage::ReadOnly); 67 Index uidIndex(Akonadi2::storageLocation(), mResourceInstanceIdentifier + ".index.uid", Akonadi2::Storage::ReadOnly);
66 68
67 const auto data = DummyStore::instance().data(); 69 const auto data = DummyStore::instance().data();
68 for (auto it = data.constBegin(); it != data.constEnd(); it++) { 70 for (auto it = data.constBegin(); it != data.constEnd(); it++) {