summaryrefslogtreecommitdiffstats
path: root/examples/dummyresource/resourcefactory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/dummyresource/resourcefactory.cpp')
-rw-r--r--examples/dummyresource/resourcefactory.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/examples/dummyresource/resourcefactory.cpp b/examples/dummyresource/resourcefactory.cpp
index 21a76ad..0f7463f 100644
--- a/examples/dummyresource/resourcefactory.cpp
+++ b/examples/dummyresource/resourcefactory.cpp
@@ -48,6 +48,8 @@
48#define ENTITY_TYPE_MAIL "mail" 48#define ENTITY_TYPE_MAIL "mail"
49#define ENTITY_TYPE_FOLDER "folder" 49#define ENTITY_TYPE_FOLDER "folder"
50 50
51SINK_DEBUG_AREA("dummyresource")
52
51class DummySynchronizer : public Sink::Synchronizer { 53class DummySynchronizer : public Sink::Synchronizer {
52 public: 54 public:
53 55
@@ -105,12 +107,12 @@ class DummySynchronizer : public Sink::Synchronizer {
105 auto entity = createEntity(remoteId, it.value()); 107 auto entity = createEntity(remoteId, it.value());
106 createOrModify(bufferType, remoteId, *entity); 108 createOrModify(bufferType, remoteId, *entity);
107 } 109 }
108 Trace() << "Sync of " << count << " entities of type " << bufferType << " done." << Sink::Log::TraceTime(time->elapsed()); 110 SinkTrace() << "Sync of " << count << " entities of type " << bufferType << " done." << Sink::Log::TraceTime(time->elapsed());
109 } 111 }
110 112
111 KAsync::Job<void> synchronizeWithSource() Q_DECL_OVERRIDE 113 KAsync::Job<void> synchronizeWithSource() Q_DECL_OVERRIDE
112 { 114 {
113 Log() << " Synchronizing with the source"; 115 SinkLog() << " Synchronizing with the source";
114 return KAsync::start<void>([this]() { 116 return KAsync::start<void>([this]() {
115 synchronize(ENTITY_TYPE_EVENT, DummyStore::instance().events(), [this](const QByteArray &ridBuffer, const QMap<QString, QVariant> &data) { 117 synchronize(ENTITY_TYPE_EVENT, DummyStore::instance().events(), [this](const QByteArray &ridBuffer, const QMap<QString, QVariant> &data) {
116 return createEvent(ridBuffer, data); 118 return createEvent(ridBuffer, data);
@@ -121,7 +123,7 @@ class DummySynchronizer : public Sink::Synchronizer {
121 synchronize(ENTITY_TYPE_FOLDER, DummyStore::instance().folders(), [this](const QByteArray &ridBuffer, const QMap<QString, QVariant> &data) { 123 synchronize(ENTITY_TYPE_FOLDER, DummyStore::instance().folders(), [this](const QByteArray &ridBuffer, const QMap<QString, QVariant> &data) {
122 return createFolder(ridBuffer, data); 124 return createFolder(ridBuffer, data);
123 }); 125 });
124 Log() << "Done Synchronizing"; 126 SinkLog() << "Done Synchronizing";
125 }); 127 });
126 } 128 }
127 129
@@ -147,7 +149,7 @@ DummyResource::~DummyResource()
147 149
148KAsync::Job<void> DummyResource::synchronizeWithSource() 150KAsync::Job<void> DummyResource::synchronizeWithSource()
149{ 151{
150 Trace() << "Synchronize with source and sending a notification about it"; 152 SinkTrace() << "Synchronize with source and sending a notification about it";
151 Sink::Notification n; 153 Sink::Notification n;
152 n.id = "connected"; 154 n.id = "connected";
153 n.type = Sink::Notification::Status; 155 n.type = Sink::Notification::Status;
@@ -160,7 +162,7 @@ KAsync::Job<void> DummyResource::synchronizeWithSource()
160KAsync::Job<void> DummyResource::inspect(int inspectionType, const QByteArray &inspectionId, const QByteArray &domainType, const QByteArray &entityId, const QByteArray &property, const QVariant &expectedValue) 162KAsync::Job<void> DummyResource::inspect(int inspectionType, const QByteArray &inspectionId, const QByteArray &domainType, const QByteArray &entityId, const QByteArray &property, const QVariant &expectedValue)
161{ 163{
162 164
163 Trace() << "Inspecting " << inspectionType << domainType << entityId << property << expectedValue; 165 SinkTrace() << "Inspecting " << inspectionType << domainType << entityId << property << expectedValue;
164 if (property == "testInspection") { 166 if (property == "testInspection") {
165 if (expectedValue.toBool()) { 167 if (expectedValue.toBool()) {
166 //Success 168 //Success