diff options
Diffstat (limited to 'dummyresource/resourcefactory.cpp')
-rw-r--r-- | dummyresource/resourcefactory.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/dummyresource/resourcefactory.cpp b/dummyresource/resourcefactory.cpp index 6e06250..4ecebc0 100644 --- a/dummyresource/resourcefactory.cpp +++ b/dummyresource/resourcefactory.cpp | |||
@@ -324,11 +324,8 @@ void findByRemoteId(QSharedPointer<Akonadi2::Storage> storage, const QString &ri | |||
324 | void DummyResource::enqueueCommand(MessageQueue &mq, int commandId, const QByteArray &data) | 324 | void DummyResource::enqueueCommand(MessageQueue &mq, int commandId, const QByteArray &data) |
325 | { | 325 | { |
326 | m_fbb.Clear(); | 326 | m_fbb.Clear(); |
327 | auto commandData = m_fbb.CreateVector(reinterpret_cast<uint8_t const *>(data.data()), data.size()); | 327 | auto commandData = Akonadi2::EntityBuffer::appendAsVector(m_fbb, data.constData(), data.size()); |
328 | auto builder = Akonadi2::QueuedCommandBuilder(m_fbb); | 328 | auto buffer = Akonadi2::CreateQueuedCommand(m_fbb, commandId, commandData); |
329 | builder.add_commandId(commandId); | ||
330 | builder.add_command(commandData); | ||
331 | auto buffer = builder.Finish(); | ||
332 | Akonadi2::FinishQueuedCommandBuffer(m_fbb, buffer); | 329 | Akonadi2::FinishQueuedCommandBuffer(m_fbb, buffer); |
333 | mq.enqueue(m_fbb.GetBufferPointer(), m_fbb.GetSize()); | 330 | mq.enqueue(m_fbb.GetBufferPointer(), m_fbb.GetSize()); |
334 | } | 331 | } |
@@ -356,7 +353,7 @@ Async::Job<void> DummyResource::synchronizeWithSource(Akonadi2::Pipeline *pipeli | |||
356 | auto rid = m_fbb.CreateString(it.key().toStdString().c_str()); | 353 | auto rid = m_fbb.CreateString(it.key().toStdString().c_str()); |
357 | auto description = m_fbb.CreateString(it.key().toStdString().c_str()); | 354 | auto description = m_fbb.CreateString(it.key().toStdString().c_str()); |
358 | static uint8_t rawData[100]; | 355 | static uint8_t rawData[100]; |
359 | auto attachment = m_fbb.CreateVector(rawData, 100); | 356 | auto attachment = Akonadi2::EntityBuffer::appendAsVector(m_fbb, rawData, 100); |
360 | 357 | ||
361 | auto builder = DummyCalendar::DummyEventBuilder(m_fbb); | 358 | auto builder = DummyCalendar::DummyEventBuilder(m_fbb); |
362 | builder.add_summary(summary); | 359 | builder.add_summary(summary); |
@@ -371,7 +368,7 @@ Async::Job<void> DummyResource::synchronizeWithSource(Akonadi2::Pipeline *pipeli | |||
371 | flatbuffers::FlatBufferBuilder fbb; | 368 | flatbuffers::FlatBufferBuilder fbb; |
372 | //This is the resource type and not the domain type | 369 | //This is the resource type and not the domain type |
373 | auto type = fbb.CreateString("event"); | 370 | auto type = fbb.CreateString("event"); |
374 | auto delta = fbb.CreateVector<uint8_t>(entityFbb.GetBufferPointer(), entityFbb.GetSize()); | 371 | auto delta = Akonadi2::EntityBuffer::appendAsVector(m_fbb, entityFbb.GetBufferPointer(), entityFbb.GetSize()); |
375 | auto location = Akonadi2::Commands::CreateCreateEntity(fbb, type, delta); | 372 | auto location = Akonadi2::Commands::CreateCreateEntity(fbb, type, delta); |
376 | Akonadi2::Commands::FinishCreateEntityBuffer(fbb, location); | 373 | Akonadi2::Commands::FinishCreateEntityBuffer(fbb, location); |
377 | 374 | ||