diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-12-02 21:32:56 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-12-02 21:32:56 +0100 |
commit | 41006b5cab7b0260f8abc42aa2d2e959a013764e (patch) | |
tree | fe8be353228233f45119964cbab4b578b496ac85 /common/resourceaccess.cpp | |
parent | 222cd83d659c3ff12380ecc5afd3cb29283e9ccd (diff) | |
download | sink-41006b5cab7b0260f8abc42aa2d2e959a013764e.tar.gz sink-41006b5cab7b0260f8abc42aa2d2e959a013764e.zip |
interresource move
Diffstat (limited to 'common/resourceaccess.cpp')
-rw-r--r-- | common/resourceaccess.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/common/resourceaccess.cpp b/common/resourceaccess.cpp index b46e8b2..81715e5 100644 --- a/common/resourceaccess.cpp +++ b/common/resourceaccess.cpp | |||
@@ -323,16 +323,16 @@ KAsync::Job<void> ResourceAccess::sendCreateCommand(const QByteArray &uid, const | |||
323 | } | 323 | } |
324 | 324 | ||
325 | KAsync::Job<void> | 325 | KAsync::Job<void> |
326 | ResourceAccess::sendModifyCommand(const QByteArray &uid, qint64 revision, const QByteArray &resourceBufferType, const QByteArrayList &deletedProperties, const QByteArray &buffer, const QByteArrayList &changedProperties) | 326 | ResourceAccess::sendModifyCommand(const QByteArray &uid, qint64 revision, const QByteArray &resourceBufferType, const QByteArrayList &deletedProperties, const QByteArray &buffer, const QByteArrayList &changedProperties, const QByteArray &newResource, bool remove) |
327 | { | 327 | { |
328 | flatbuffers::FlatBufferBuilder fbb; | 328 | flatbuffers::FlatBufferBuilder fbb; |
329 | auto entityId = fbb.CreateString(uid.constData()); | 329 | auto entityId = fbb.CreateString(uid.constData()); |
330 | // This is the resource buffer type and not the domain type | ||
331 | auto type = fbb.CreateString(resourceBufferType.constData()); | 330 | auto type = fbb.CreateString(resourceBufferType.constData()); |
332 | auto modifiedProperties = BufferUtils::toVector(fbb, changedProperties); | 331 | auto modifiedProperties = BufferUtils::toVector(fbb, changedProperties); |
333 | auto deletions = BufferUtils::toVector(fbb, deletedProperties); | 332 | auto deletions = BufferUtils::toVector(fbb, deletedProperties); |
334 | auto delta = Sink::EntityBuffer::appendAsVector(fbb, buffer.constData(), buffer.size()); | 333 | auto delta = Sink::EntityBuffer::appendAsVector(fbb, buffer.constData(), buffer.size()); |
335 | auto location = Sink::Commands::CreateModifyEntity(fbb, revision, entityId, deletions, type, delta, true, modifiedProperties); | 334 | auto resource = newResource.isEmpty() ? 0 : fbb.CreateString(newResource.constData()); |
335 | auto location = Sink::Commands::CreateModifyEntity(fbb, revision, entityId, deletions, type, delta, true, modifiedProperties, resource, remove); | ||
336 | Sink::Commands::FinishModifyEntityBuffer(fbb, location); | 336 | Sink::Commands::FinishModifyEntityBuffer(fbb, location); |
337 | open(); | 337 | open(); |
338 | return sendCommand(Sink::Commands::ModifyEntityCommand, fbb); | 338 | return sendCommand(Sink::Commands::ModifyEntityCommand, fbb); |
@@ -342,7 +342,6 @@ KAsync::Job<void> ResourceAccess::sendDeleteCommand(const QByteArray &uid, qint6 | |||
342 | { | 342 | { |
343 | flatbuffers::FlatBufferBuilder fbb; | 343 | flatbuffers::FlatBufferBuilder fbb; |
344 | auto entityId = fbb.CreateString(uid.constData()); | 344 | auto entityId = fbb.CreateString(uid.constData()); |
345 | // This is the resource buffer type and not the domain type | ||
346 | auto type = fbb.CreateString(resourceBufferType.constData()); | 345 | auto type = fbb.CreateString(resourceBufferType.constData()); |
347 | auto location = Sink::Commands::CreateDeleteEntity(fbb, revision, entityId, type); | 346 | auto location = Sink::Commands::CreateDeleteEntity(fbb, revision, entityId, type); |
348 | Sink::Commands::FinishDeleteEntityBuffer(fbb, location); | 347 | Sink::Commands::FinishDeleteEntityBuffer(fbb, location); |