diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-07-06 09:58:34 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-07-06 09:58:34 +0200 |
commit | abc90b737074d93f73490a77e1eb1e1666dac375 (patch) | |
tree | 2c79c2996401e7732d94ba3d0b623c8290484f9f /examples/dummyresource | |
parent | a9f3692a0bceb796d10952307f87fdb77abadbf7 (diff) | |
download | sink-abc90b737074d93f73490a77e1eb1e1666dac375.tar.gz sink-abc90b737074d93f73490a77e1eb1e1666dac375.zip |
Test the resource status
Diffstat (limited to 'examples/dummyresource')
-rw-r--r-- | examples/dummyresource/resourcefactory.cpp | 13 | ||||
-rw-r--r-- | examples/dummyresource/resourcefactory.h | 1 |
2 files changed, 14 insertions, 0 deletions
diff --git a/examples/dummyresource/resourcefactory.cpp b/examples/dummyresource/resourcefactory.cpp index 2bd52cc..21a76ad 100644 --- a/examples/dummyresource/resourcefactory.cpp +++ b/examples/dummyresource/resourcefactory.cpp | |||
@@ -23,6 +23,7 @@ | |||
23 | #include "entitybuffer.h" | 23 | #include "entitybuffer.h" |
24 | #include "pipeline.h" | 24 | #include "pipeline.h" |
25 | #include "dummycalendar_generated.h" | 25 | #include "dummycalendar_generated.h" |
26 | #include "notification_generated.h" | ||
26 | #include "mail_generated.h" | 27 | #include "mail_generated.h" |
27 | #include "createentity_generated.h" | 28 | #include "createentity_generated.h" |
28 | #include "domainadaptor.h" | 29 | #include "domainadaptor.h" |
@@ -144,6 +145,18 @@ DummyResource::~DummyResource() | |||
144 | 145 | ||
145 | } | 146 | } |
146 | 147 | ||
148 | KAsync::Job<void> DummyResource::synchronizeWithSource() | ||
149 | { | ||
150 | Trace() << "Synchronize with source and sending a notification about it"; | ||
151 | Sink::Notification n; | ||
152 | n.id = "connected"; | ||
153 | n.type = Sink::Notification::Status; | ||
154 | n.message = "We're connected"; | ||
155 | n.code = Sink::ApplicationDomain::ConnectedStatus; | ||
156 | emit notify(n); | ||
157 | return GenericResource::synchronizeWithSource(); | ||
158 | } | ||
159 | |||
147 | KAsync::Job<void> DummyResource::inspect(int inspectionType, const QByteArray &inspectionId, const QByteArray &domainType, const QByteArray &entityId, const QByteArray &property, const QVariant &expectedValue) | 160 | KAsync::Job<void> DummyResource::inspect(int inspectionType, const QByteArray &inspectionId, const QByteArray &domainType, const QByteArray &entityId, const QByteArray &property, const QVariant &expectedValue) |
148 | { | 161 | { |
149 | 162 | ||
diff --git a/examples/dummyresource/resourcefactory.h b/examples/dummyresource/resourcefactory.h index 1c51b00..a7d0281 100644 --- a/examples/dummyresource/resourcefactory.h +++ b/examples/dummyresource/resourcefactory.h | |||
@@ -35,6 +35,7 @@ public: | |||
35 | DummyResource(const QByteArray &instanceIdentifier, const QSharedPointer<Sink::Pipeline> &pipeline = QSharedPointer<Sink::Pipeline>()); | 35 | DummyResource(const QByteArray &instanceIdentifier, const QSharedPointer<Sink::Pipeline> &pipeline = QSharedPointer<Sink::Pipeline>()); |
36 | virtual ~DummyResource(); | 36 | virtual ~DummyResource(); |
37 | 37 | ||
38 | KAsync::Job<void> synchronizeWithSource() Q_DECL_OVERRIDE; | ||
38 | KAsync::Job<void> inspect(int inspectionType, const QByteArray &inspectionId, const QByteArray &domainType, const QByteArray &entityId, const QByteArray &property, const QVariant &expectedValue) Q_DECL_OVERRIDE; | 39 | KAsync::Job<void> inspect(int inspectionType, const QByteArray &inspectionId, const QByteArray &domainType, const QByteArray &entityId, const QByteArray &property, const QVariant &expectedValue) Q_DECL_OVERRIDE; |
39 | }; | 40 | }; |
40 | 41 | ||