diff options
-rw-r--r-- | common/pipeline.cpp | 5 | ||||
-rw-r--r-- | dummyresource/domainadaptor.cpp | 14 | ||||
-rw-r--r-- | dummyresource/resourcefactory.cpp | 7 | ||||
-rw-r--r-- | synchronizer/listener.cpp | 2 | ||||
-rw-r--r-- | tests/domainadaptortest.cpp | 14 |
5 files changed, 22 insertions, 20 deletions
diff --git a/common/pipeline.cpp b/common/pipeline.cpp index f321cf5..ed40699 100644 --- a/common/pipeline.cpp +++ b/common/pipeline.cpp | |||
@@ -30,6 +30,7 @@ | |||
30 | #include "createentity_generated.h" | 30 | #include "createentity_generated.h" |
31 | #include "entitybuffer.h" | 31 | #include "entitybuffer.h" |
32 | #include "async/src/async.h" | 32 | #include "async/src/async.h" |
33 | #include "log.h" | ||
33 | 34 | ||
34 | namespace Akonadi2 | 35 | namespace Akonadi2 |
35 | { | 36 | { |
@@ -95,7 +96,7 @@ void Pipeline::null() | |||
95 | 96 | ||
96 | Async::Job<void> Pipeline::newEntity(void const *command, size_t size) | 97 | Async::Job<void> Pipeline::newEntity(void const *command, size_t size) |
97 | { | 98 | { |
98 | qDebug() << "Pipeline: New Entity"; | 99 | Log() << "Pipeline: New Entity"; |
99 | 100 | ||
100 | //TODO toRFC4122 would probably be more efficient, but results in non-printable keys. | 101 | //TODO toRFC4122 would probably be more efficient, but results in non-printable keys. |
101 | const auto key = QUuid::createUuid().toString().toUtf8(); | 102 | const auto key = QUuid::createUuid().toString().toUtf8(); |
@@ -136,7 +137,7 @@ Async::Job<void> Pipeline::newEntity(void const *command, size_t size) | |||
136 | 137 | ||
137 | storage().write(key.data(), key.size(), fbb.GetBufferPointer(), fbb.GetSize()); | 138 | storage().write(key.data(), key.size(), fbb.GetBufferPointer(), fbb.GetSize()); |
138 | storage().setMaxRevision(newRevision); | 139 | storage().setMaxRevision(newRevision); |
139 | qDebug() << "Pipeline: wrote entity: "<< newRevision; | 140 | Log() << "Pipeline: wrote entity: "<< newRevision; |
140 | 141 | ||
141 | return Async::start<void>([this, key, entityType](Async::Future<void> &future) { | 142 | return Async::start<void>([this, key, entityType](Async::Future<void> &future) { |
142 | PipelineState state(this, NewPipeline, key, d->newPipeline[entityType], [&future]() { | 143 | PipelineState state(this, NewPipeline, key, d->newPipeline[entityType], [&future]() { |
diff --git a/dummyresource/domainadaptor.cpp b/dummyresource/domainadaptor.cpp index d902052..2182f9a 100644 --- a/dummyresource/domainadaptor.cpp +++ b/dummyresource/domainadaptor.cpp | |||
@@ -100,13 +100,13 @@ QSharedPointer<Akonadi2::Domain::BufferAdaptor> DummyEventAdaptorFactory::create | |||
100 | } | 100 | } |
101 | } | 101 | } |
102 | 102 | ||
103 | Akonadi2::Metadata const *metadataBuffer = 0; | 103 | // Akonadi2::Metadata const *metadataBuffer = 0; |
104 | if (auto metadataData = entity.metadata()) { | 104 | // if (auto metadataData = entity.metadata()) { |
105 | flatbuffers::Verifier verifyer(metadataData->Data(), metadataData->size()); | 105 | // flatbuffers::Verifier verifyer(metadataData->Data(), metadataData->size()); |
106 | if (Akonadi2::VerifyMetadataBuffer(verifyer)) { | 106 | // if (Akonadi2::VerifyMetadataBuffer(verifyer)) { |
107 | metadataBuffer = Akonadi2::GetMetadata(metadataData->Data()); | 107 | // metadataBuffer = Akonadi2::GetMetadata(metadataData->Data()); |
108 | } | 108 | // } |
109 | } | 109 | // } |
110 | 110 | ||
111 | Akonadi2::Domain::Buffer::Event const *localBuffer = 0; | 111 | Akonadi2::Domain::Buffer::Event const *localBuffer = 0; |
112 | if (auto localData = entity.local()) { | 112 | if (auto localData = entity.local()) { |
diff --git a/dummyresource/resourcefactory.cpp b/dummyresource/resourcefactory.cpp index 10c8eaf..9d702a8 100644 --- a/dummyresource/resourcefactory.cpp +++ b/dummyresource/resourcefactory.cpp | |||
@@ -170,7 +170,7 @@ private slots: | |||
170 | 170 | ||
171 | flatbuffers::Verifier verifyer(reinterpret_cast<const uint8_t *>(ptr), size); | 171 | flatbuffers::Verifier verifyer(reinterpret_cast<const uint8_t *>(ptr), size); |
172 | if (!Akonadi2::VerifyQueuedCommandBuffer(verifyer)) { | 172 | if (!Akonadi2::VerifyQueuedCommandBuffer(verifyer)) { |
173 | qWarning() << "invalid buffer"; | 173 | Warning() << "invalid buffer"; |
174 | callback(false); | 174 | callback(false); |
175 | return; | 175 | return; |
176 | } | 176 | } |
@@ -185,13 +185,13 @@ private slots: | |||
185 | callback(true); | 185 | callback(true); |
186 | }, | 186 | }, |
187 | [callback](int errorCode, QString errorMessage) { | 187 | [callback](int errorCode, QString errorMessage) { |
188 | Warning() << errorMessage; | 188 | Warning() << "Error while processing queue command: " << errorMessage; |
189 | callback(false); | 189 | callback(false); |
190 | } | 190 | } |
191 | ).exec(); | 191 | ).exec(); |
192 | }, | 192 | }, |
193 | [&future](const MessageQueue::Error &error) { | 193 | [&future](const MessageQueue::Error &error) { |
194 | Warning() << error.message; | 194 | Warning() << "Error while getting message from messagequeue: " << error.message; |
195 | future.setValue(false); | 195 | future.setValue(false); |
196 | future.setFinished(); | 196 | future.setFinished(); |
197 | } | 197 | } |
@@ -209,6 +209,7 @@ private slots: | |||
209 | [it, this](Async::Future<void> &future) { | 209 | [it, this](Async::Future<void> &future) { |
210 | auto queue = it->next(); | 210 | auto queue = it->next(); |
211 | processQueue(queue).then<void>([&future]() { | 211 | processQueue(queue).then<void>([&future]() { |
212 | Trace() << "Queue processed"; | ||
212 | future.setFinished(); | 213 | future.setFinished(); |
213 | }).exec(); | 214 | }).exec(); |
214 | } | 215 | } |
diff --git a/synchronizer/listener.cpp b/synchronizer/listener.cpp index 5165111..377c658 100644 --- a/synchronizer/listener.cpp +++ b/synchronizer/listener.cpp | |||
@@ -376,7 +376,7 @@ void Listener::loadResource() | |||
376 | Log() << QString("\tFacades: %1").arg(Akonadi2::FacadeFactory::instance().getFacade<Akonadi2::Domain::Event>(m_resourceName)->type()); | 376 | Log() << QString("\tFacades: %1").arg(Akonadi2::FacadeFactory::instance().getFacade<Akonadi2::Domain::Event>(m_resourceName)->type()); |
377 | m_resource->configurePipeline(m_pipeline); | 377 | m_resource->configurePipeline(m_pipeline); |
378 | } else { | 378 | } else { |
379 | Warning() << QString("Failed to load resource %1").arg(m_resourceName); | 379 | Error() << QString("Failed to load resource %1").arg(m_resourceName); |
380 | } | 380 | } |
381 | //TODO: on failure ... what? | 381 | //TODO: on failure ... what? |
382 | //Enter broken state? | 382 | //Enter broken state? |
diff --git a/tests/domainadaptortest.cpp b/tests/domainadaptortest.cpp index d1a9d26..cedbf94 100644 --- a/tests/domainadaptortest.cpp +++ b/tests/domainadaptortest.cpp | |||
@@ -74,13 +74,13 @@ public: | |||
74 | } | 74 | } |
75 | } | 75 | } |
76 | 76 | ||
77 | Akonadi2::Metadata const *metadataBuffer = 0; | 77 | // Akonadi2::Metadata const *metadataBuffer = 0; |
78 | if (auto metadataData = entity.metadata()) { | 78 | // if (auto metadataData = entity.metadata()) { |
79 | flatbuffers::Verifier verifyer(metadataData->Data(), metadataData->size()); | 79 | // flatbuffers::Verifier verifyer(metadataData->Data(), metadataData->size()); |
80 | if (Akonadi2::VerifyMetadataBuffer(verifyer)) { | 80 | // if (Akonadi2::VerifyMetadataBuffer(verifyer)) { |
81 | metadataBuffer = Akonadi2::GetMetadata(metadataData); | 81 | // metadataBuffer = Akonadi2::GetMetadata(metadataData); |
82 | } | 82 | // } |
83 | } | 83 | // } |
84 | 84 | ||
85 | Akonadi2::Domain::Buffer::Event const *localBuffer = 0; | 85 | Akonadi2::Domain::Buffer::Event const *localBuffer = 0; |
86 | if (auto localData = entity.local()) { | 86 | if (auto localData = entity.local()) { |