diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-01-19 12:39:45 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-01-19 12:39:45 +0100 |
commit | d5b28efe4d7fc2a984243417d923ff5727234e94 (patch) | |
tree | 1546145760eb0fa2d8d606e3332e1bab92e63161 /common/pipeline.cpp | |
parent | 4922555a38af32fc94e56aeb208b9fda31dab1b2 (diff) | |
download | sink-d5b28efe4d7fc2a984243417d923ff5727234e94.tar.gz sink-d5b28efe4d7fc2a984243417d923ff5727234e94.zip |
Added bufferutils.h
Diffstat (limited to 'common/pipeline.cpp')
-rw-r--r-- | common/pipeline.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/common/pipeline.cpp b/common/pipeline.cpp index 06d8114..a087def 100644 --- a/common/pipeline.cpp +++ b/common/pipeline.cpp | |||
@@ -34,6 +34,7 @@ | |||
34 | #include "log.h" | 34 | #include "log.h" |
35 | #include "domain/applicationdomaintype.h" | 35 | #include "domain/applicationdomaintype.h" |
36 | #include "definitions.h" | 36 | #include "definitions.h" |
37 | #include "bufferutils.h" | ||
37 | 38 | ||
38 | namespace Akonadi2 | 39 | namespace Akonadi2 |
39 | { | 40 | { |
@@ -119,7 +120,7 @@ Storage &Pipeline::storage() const | |||
119 | 120 | ||
120 | void Pipeline::storeNewRevision(qint64 newRevision, const flatbuffers::FlatBufferBuilder &fbb, const QByteArray &bufferType, const QByteArray &uid) | 121 | void Pipeline::storeNewRevision(qint64 newRevision, const flatbuffers::FlatBufferBuilder &fbb, const QByteArray &bufferType, const QByteArray &uid) |
121 | { | 122 | { |
122 | d->transaction.openDatabase(bufferType + ".main").write(Akonadi2::Storage::assembleKey(uid, newRevision), QByteArray::fromRawData(reinterpret_cast<char const *>(fbb.GetBufferPointer()), fbb.GetSize()), | 123 | d->transaction.openDatabase(bufferType + ".main").write(Akonadi2::Storage::assembleKey(uid, newRevision), BufferUtils::extractBuffer(fbb), |
123 | [](const Akonadi2::Storage::Error &error) { | 124 | [](const Akonadi2::Storage::Error &error) { |
124 | Warning() << "Failed to write entity"; | 125 | Warning() << "Failed to write entity"; |
125 | } | 126 | } |
@@ -285,7 +286,7 @@ KAsync::Job<qint64> Pipeline::modifiedEntity(void const *command, size_t size) | |||
285 | //Remove deletions | 286 | //Remove deletions |
286 | if (modifyEntity->deletions()) { | 287 | if (modifyEntity->deletions()) { |
287 | for (const auto &property : *modifyEntity->deletions()) { | 288 | for (const auto &property : *modifyEntity->deletions()) { |
288 | newObject->setProperty(QByteArray::fromRawData(property->data(), property->size()), QVariant()); | 289 | newObject->setProperty(BufferUtils::extractBuffer(property), QVariant()); |
289 | } | 290 | } |
290 | } | 291 | } |
291 | 292 | ||