From b6d5d206de4d02149c6530236154283bf834087a Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Thu, 13 Aug 2015 01:27:21 +0200 Subject: Untangled the include dependencies a bit. We no longer depend on clientapi.h from everywhere. --- examples/client/main.cpp | 4 ++-- examples/dummyresource/resourcefacade.cpp | 3 ++- examples/dummyresource/resourcefacade.h | 11 ++++++++--- examples/dummyresource/resourcefactory.cpp | 6 ++++-- 4 files changed, 16 insertions(+), 8 deletions(-) (limited to 'examples') 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 AkonadiListModel : public QAbstractListModel { public: - AkonadiListModel(const QSharedPointer > &emitter, const QByteArray &property) + AkonadiListModel(const QSharedPointer > &emitter, const QByteArray &property) :QAbstractListModel(), mEmitter(emitter) { @@ -116,7 +116,7 @@ public: } private: - QSharedPointer > mEmitter; + QSharedPointer > mEmitter; QStringList mStringList; }; 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 @@ #include "resourcefacade.h" #include +#include DummyResourceConfigFacade::DummyResourceConfigFacade() : Akonadi2::StoreFacade() @@ -64,7 +65,7 @@ KAsync::Job DummyResourceConfigFacade::remove(const Akonadi2::ApplicationD return KAsync::null(); } -KAsync::Job DummyResourceConfigFacade::load(const Akonadi2::Query &query, const QSharedPointer > &resultProvider) +KAsync::Job DummyResourceConfigFacade::load(const Akonadi2::Query &query, const QSharedPointer > &resultProvider) { //Read configuration and list all available instances. //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 @@ #pragma once -#include "common/clientapi.h" - #include +#include +#include +#include + +namespace Akonadi2 { + class Query; +} class QSettings; @@ -37,7 +42,7 @@ public: //Remove instance KAsync::Job remove(const Akonadi2::ApplicationDomain::AkonadiResource &domainObject) Q_DECL_OVERRIDE; //Read configuration and available instances - KAsync::Job load(const Akonadi2::Query &query, const QSharedPointer > &resultProvider) Q_DECL_OVERRIDE; + KAsync::Job load(const Akonadi2::Query &query, const QSharedPointer > &resultProvider) Q_DECL_OVERRIDE; private: QSharedPointer 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 @@ #include "log.h" #include "domain/event.h" #include "dummystore.h" +#include "definitions.h" +#include "facadefactory.h" //This is the resources entity type, and not the domain type #define ENTITY_TYPE_EVENT "event" @@ -46,7 +48,7 @@ DummyResource::DummyResource(const QByteArray &instanceIdentifier, const QShared Akonadi2::ApplicationDomain::Event event(resourceIdentifier, state.key(), -1, adaptor); Akonadi2::ApplicationDomain::TypeImplementation::index(event); - Index ridIndex(Akonadi2::Store::storageLocation(), resourceIdentifier + ".index.rid", Akonadi2::Storage::ReadWrite); + Index ridIndex(Akonadi2::storageLocation(), resourceIdentifier + ".index.rid", Akonadi2::Storage::ReadWrite); const auto rid = event.getProperty("remoteId"); if (rid.isValid()) { ridIndex.add(rid.toByteArray(), event.identifier()); @@ -62,7 +64,7 @@ KAsync::Job DummyResource::synchronizeWithSource() { return KAsync::start([this](KAsync::Future &f) { //TODO start transaction on index - Index uidIndex(Akonadi2::Store::storageLocation(), mResourceInstanceIdentifier + ".index.uid", Akonadi2::Storage::ReadOnly); + Index uidIndex(Akonadi2::storageLocation(), mResourceInstanceIdentifier + ".index.uid", Akonadi2::Storage::ReadOnly); const auto data = DummyStore::instance().data(); for (auto it = data.constBegin(); it != data.constEnd(); it++) { -- cgit v1.2.3