summaryrefslogtreecommitdiffstats
path: root/examples/dummyresource/resourcefactory.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-11-28 23:04:59 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-11-28 23:04:59 +0100
commit3e7b8fe8b8cca75b546c8cac2c09ce231861f21b (patch)
tree36cf1849ff30a986de56d931d60ce1c88660ec83 /examples/dummyresource/resourcefactory.cpp
parent7fdcc36a1a352bb869020ade8a8aa697c3e8b80c (diff)
downloadsink-3e7b8fe8b8cca75b546c8cac2c09ce231861f21b.tar.gz
sink-3e7b8fe8b8cca75b546c8cac2c09ce231861f21b.zip
Used the CommandProcessor as central place for all command processing.
Diffstat (limited to 'examples/dummyresource/resourcefactory.cpp')
-rw-r--r--examples/dummyresource/resourcefactory.cpp19
1 files changed, 7 insertions, 12 deletions
diff --git a/examples/dummyresource/resourcefactory.cpp b/examples/dummyresource/resourcefactory.cpp
index 8e81c79..3565d57 100644
--- a/examples/dummyresource/resourcefactory.cpp
+++ b/examples/dummyresource/resourcefactory.cpp
@@ -113,6 +113,13 @@ class DummySynchronizer : public Sink::Synchronizer {
113 KAsync::Job<void> synchronizeWithSource(const Sink::QueryBase &) Q_DECL_OVERRIDE 113 KAsync::Job<void> synchronizeWithSource(const Sink::QueryBase &) Q_DECL_OVERRIDE
114 { 114 {
115 SinkLog() << " Synchronizing with the source"; 115 SinkLog() << " Synchronizing with the source";
116 SinkTrace() << "Synchronize with source and sending a notification about it";
117 Sink::Notification n;
118 n.id = "connected";
119 n.type = Sink::Notification::Status;
120 n.message = "We're connected";
121 n.code = Sink::ApplicationDomain::ConnectedStatus;
122 emit notify(n);
116 return KAsync::syncStart<void>([this]() { 123 return KAsync::syncStart<void>([this]() {
117 synchronize(ENTITY_TYPE_EVENT, DummyStore::instance().events(), [this](const QByteArray &ridBuffer, const QMap<QString, QVariant> &data) { 124 synchronize(ENTITY_TYPE_EVENT, DummyStore::instance().events(), [this](const QByteArray &ridBuffer, const QMap<QString, QVariant> &data) {
118 return createEvent(ridBuffer, data); 125 return createEvent(ridBuffer, data);
@@ -174,18 +181,6 @@ DummyResource::~DummyResource()
174 181
175} 182}
176 183
177KAsync::Job<void> DummyResource::synchronizeWithSource(const Sink::QueryBase &query)
178{
179 SinkTrace() << "Synchronize with source and sending a notification about it";
180 Sink::Notification n;
181 n.id = "connected";
182 n.type = Sink::Notification::Status;
183 n.message = "We're connected";
184 n.code = Sink::ApplicationDomain::ConnectedStatus;
185 emit notify(n);
186 return GenericResource::synchronizeWithSource(query);
187}
188
189DummyResourceFactory::DummyResourceFactory(QObject *parent) 184DummyResourceFactory::DummyResourceFactory(QObject *parent)
190 : Sink::ResourceFactory(parent) 185 : Sink::ResourceFactory(parent)
191{ 186{