diff options
Diffstat (limited to 'common/entitybuffer.cpp')
-rw-r--r-- | common/entitybuffer.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/common/entitybuffer.cpp b/common/entitybuffer.cpp index c5d6bce..aa5847c 100644 --- a/common/entitybuffer.cpp +++ b/common/entitybuffer.cpp | |||
@@ -23,36 +23,36 @@ const Akonadi2::Entity &EntityBuffer::entity() | |||
23 | return *mEntity; | 23 | return *mEntity; |
24 | } | 24 | } |
25 | 25 | ||
26 | const flatbuffers::Vector<uint8_t>* EntityBuffer::resourceBuffer() | 26 | const uint8_t* EntityBuffer::resourceBuffer() |
27 | { | 27 | { |
28 | if (!mEntity) { | 28 | if (!mEntity) { |
29 | qDebug() << "no buffer"; | 29 | qDebug() << "no buffer"; |
30 | return nullptr; | 30 | return nullptr; |
31 | } | 31 | } |
32 | return mEntity->resource(); | 32 | return mEntity->resource()->Data(); |
33 | } | 33 | } |
34 | 34 | ||
35 | const flatbuffers::Vector<uint8_t>* EntityBuffer::metadataBuffer() | 35 | const uint8_t* EntityBuffer::metadataBuffer() |
36 | { | 36 | { |
37 | if (!mEntity) { | 37 | if (!mEntity) { |
38 | return nullptr; | 38 | return nullptr; |
39 | } | 39 | } |
40 | return mEntity->metadata(); | 40 | return mEntity->metadata()->Data(); |
41 | } | 41 | } |
42 | 42 | ||
43 | const flatbuffers::Vector<uint8_t>* EntityBuffer::localBuffer() | 43 | const uint8_t* EntityBuffer::localBuffer() |
44 | { | 44 | { |
45 | if (!mEntity) { | 45 | if (!mEntity) { |
46 | return nullptr; | 46 | return nullptr; |
47 | } | 47 | } |
48 | return mEntity->local(); | 48 | return mEntity->local()->Data(); |
49 | } | 49 | } |
50 | 50 | ||
51 | void EntityBuffer::extractResourceBuffer(void *dataValue, int dataSize, const std::function<void(const flatbuffers::Vector<uint8_t> *)> &handler) | 51 | void EntityBuffer::extractResourceBuffer(void *dataValue, int dataSize, const std::function<void(const uint8_t *, size_t size)> &handler) |
52 | { | 52 | { |
53 | Akonadi2::EntityBuffer buffer(dataValue, dataSize); | 53 | Akonadi2::EntityBuffer buffer(dataValue, dataSize); |
54 | if (auto resourceData = buffer.resourceBuffer()) { | 54 | if (auto resourceData = buffer.entity().resource()) { |
55 | handler(resourceData); | 55 | handler(resourceData->Data(), resourceData->size()); |
56 | } | 56 | } |
57 | } | 57 | } |
58 | 58 | ||