summaryrefslogtreecommitdiffstats
path: root/examples/dummyresource/resourcefactory.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-01-18 18:36:41 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-01-18 18:36:41 +0100
commit67e83aadde8db2bb1293cee61e8c6306a4ffcca0 (patch)
tree10531201cb5dca7617e17a4e4393bda20694c4ca /examples/dummyresource/resourcefactory.cpp
parenta857d9b36f80adf045cd195653cb2f8b91452981 (diff)
downloadsink-67e83aadde8db2bb1293cee61e8c6306a4ffcca0.tar.gz
sink-67e83aadde8db2bb1293cee61e8c6306a4ffcca0.zip
Working resource inspection
Diffstat (limited to 'examples/dummyresource/resourcefactory.cpp')
-rw-r--r--examples/dummyresource/resourcefactory.cpp10
1 files changed, 3 insertions, 7 deletions
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)
134 Akonadi2::Storage(Akonadi2::storageLocation(), instanceIdentifier + ".synchronization", Akonadi2::Storage::ReadWrite).removeFromDisk(); 134 Akonadi2::Storage(Akonadi2::storageLocation(), instanceIdentifier + ".synchronization", Akonadi2::Storage::ReadWrite).removeFromDisk();
135} 135}
136 136
137KAsync::Job<void> DummyResource::inspect(int inspectionType, const QByteArray &domainType, const QByteArray &entityId, const QByteArray &property, const QVariant &expectedValue) 137KAsync::Job<void> DummyResource::inspect(int inspectionType, const QByteArray &inspectionId, const QByteArray &domainType, const QByteArray &entityId, const QByteArray &property, const QVariant &expectedValue)
138{ 138{
139 139
140 Trace() << "Inspecting " << inspectionType << domainType << entityId << property << expectedValue; 140 Trace() << "Inspecting " << inspectionType << domainType << entityId << property << expectedValue;
141 if (property == "testInspection") { 141 if (property == "testInspection") {
142 Akonadi2::ResourceNotification n;
143 n.type = Akonadi2::NotificationType_Inspection;
144 if (expectedValue.toBool()) { 142 if (expectedValue.toBool()) {
145 //Success 143 //Success
146 n.code = 0; 144 return KAsync::null<void>();
147 emit notify(n);
148 } else { 145 } else {
149 //Failure 146 //Failure
150 n.code = 1; 147 return KAsync::error<void>(1, "Failed.");
151 emit notify(n);
152 } 148 }
153 } 149 }
154 return KAsync::null<void>(); 150 return KAsync::null<void>();