From 67e83aadde8db2bb1293cee61e8c6306a4ffcca0 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Mon, 18 Jan 2016 18:36:41 +0100 Subject: Working resource inspection --- examples/dummyresource/resourcefactory.cpp | 10 +++------- examples/dummyresource/resourcefactory.h | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) (limited to 'examples') diff --git a/examples/dummyresource/resourcefactory.cpp b/examples/dummyresource/resourcefactory.cpp index 27d5f17..c43b5e6 100644 --- a/examples/dummyresource/resourcefactory.cpp +++ b/examples/dummyresource/resourcefactory.cpp @@ -134,21 +134,17 @@ void DummyResource::removeFromDisk(const QByteArray &instanceIdentifier) Akonadi2::Storage(Akonadi2::storageLocation(), instanceIdentifier + ".synchronization", Akonadi2::Storage::ReadWrite).removeFromDisk(); } -KAsync::Job DummyResource::inspect(int inspectionType, const QByteArray &domainType, const QByteArray &entityId, const QByteArray &property, const QVariant &expectedValue) +KAsync::Job DummyResource::inspect(int inspectionType, const QByteArray &inspectionId, const QByteArray &domainType, const QByteArray &entityId, const QByteArray &property, const QVariant &expectedValue) { Trace() << "Inspecting " << inspectionType << domainType << entityId << property << expectedValue; if (property == "testInspection") { - Akonadi2::ResourceNotification n; - n.type = Akonadi2::NotificationType_Inspection; if (expectedValue.toBool()) { //Success - n.code = 0; - emit notify(n); + return KAsync::null(); } else { //Failure - n.code = 1; - emit notify(n); + return KAsync::error(1, "Failed."); } } return KAsync::null(); diff --git a/examples/dummyresource/resourcefactory.h b/examples/dummyresource/resourcefactory.h index 3f67187..634829e 100644 --- a/examples/dummyresource/resourcefactory.h +++ b/examples/dummyresource/resourcefactory.h @@ -40,7 +40,7 @@ public: KAsync::Job synchronizeWithSource(Akonadi2::Storage &mainStore, Akonadi2::Storage &synchronizationStore) Q_DECL_OVERRIDE; using GenericResource::synchronizeWithSource; static void removeFromDisk(const QByteArray &instanceIdentifier); - KAsync::Job inspect(int inspectionType, const QByteArray &domainType, const QByteArray &entityId, const QByteArray &property, const QVariant &expectedValue) Q_DECL_OVERRIDE; + KAsync::Job inspect(int inspectionType, const QByteArray &inspectionId, const QByteArray &domainType, const QByteArray &entityId, const QByteArray &property, const QVariant &expectedValue) Q_DECL_OVERRIDE; private: KAsync::Job replay(Akonadi2::Storage &synchronizationStore, const QByteArray &type, const QByteArray &key, const QByteArray &value) Q_DECL_OVERRIDE; Akonadi2::ApplicationDomain::Event::Ptr createEvent(const QByteArray &rid, const QMap &data, Akonadi2::Storage::Transaction &); -- cgit v1.2.3