diff options
-rw-r--r-- | common/facade.cpp | 2 | ||||
-rw-r--r-- | common/resourceaccess.cpp | 5 | ||||
-rw-r--r-- | common/resourceaccess.h | 4 |
3 files changed, 6 insertions, 5 deletions
diff --git a/common/facade.cpp b/common/facade.cpp index cdd06f9..1045dac 100644 --- a/common/facade.cpp +++ b/common/facade.cpp | |||
@@ -64,7 +64,7 @@ KAsync::Job<void> GenericFacade<DomainType>::create(const DomainType &domainObje | |||
64 | } | 64 | } |
65 | flatbuffers::FlatBufferBuilder entityFbb; | 65 | flatbuffers::FlatBufferBuilder entityFbb; |
66 | mDomainTypeAdaptorFactory->createBuffer(domainObject, entityFbb); | 66 | mDomainTypeAdaptorFactory->createBuffer(domainObject, entityFbb); |
67 | return mResourceAccess->sendCreateCommand(bufferTypeForDomainType(), BufferUtils::extractBuffer(entityFbb)); | 67 | return mResourceAccess->sendCreateCommand(domainObject.identifier(), bufferTypeForDomainType(), BufferUtils::extractBuffer(entityFbb)); |
68 | } | 68 | } |
69 | 69 | ||
70 | template <class DomainType> | 70 | template <class DomainType> |
diff --git a/common/resourceaccess.cpp b/common/resourceaccess.cpp index 33820af..458694f 100644 --- a/common/resourceaccess.cpp +++ b/common/resourceaccess.cpp | |||
@@ -293,13 +293,14 @@ KAsync::Job<void> ResourceAccess::synchronizeResource(bool sourceSync, bool loca | |||
293 | return sendCommand(Commands::SynchronizeCommand, fbb); | 293 | return sendCommand(Commands::SynchronizeCommand, fbb); |
294 | } | 294 | } |
295 | 295 | ||
296 | KAsync::Job<void> ResourceAccess::sendCreateCommand(const QByteArray &resourceBufferType, const QByteArray &buffer) | 296 | KAsync::Job<void> ResourceAccess::sendCreateCommand(const QByteArray &uid, const QByteArray &resourceBufferType, const QByteArray &buffer) |
297 | { | 297 | { |
298 | flatbuffers::FlatBufferBuilder fbb; | 298 | flatbuffers::FlatBufferBuilder fbb; |
299 | auto entityId = fbb.CreateString(uid.constData()); | ||
299 | // This is the resource buffer type and not the domain type | 300 | // This is the resource buffer type and not the domain type |
300 | auto type = fbb.CreateString(resourceBufferType.constData()); | 301 | auto type = fbb.CreateString(resourceBufferType.constData()); |
301 | auto delta = Sink::EntityBuffer::appendAsVector(fbb, buffer.constData(), buffer.size()); | 302 | auto delta = Sink::EntityBuffer::appendAsVector(fbb, buffer.constData(), buffer.size()); |
302 | auto location = Sink::Commands::CreateCreateEntity(fbb, 0, type, delta); | 303 | auto location = Sink::Commands::CreateCreateEntity(fbb, entityId, type, delta); |
303 | Sink::Commands::FinishCreateEntityBuffer(fbb, location); | 304 | Sink::Commands::FinishCreateEntityBuffer(fbb, location); |
304 | open(); | 305 | open(); |
305 | return sendCommand(Sink::Commands::CreateEntityCommand, fbb); | 306 | return sendCommand(Sink::Commands::CreateEntityCommand, fbb); |
diff --git a/common/resourceaccess.h b/common/resourceaccess.h index 60f29e9..b9eaacd 100644 --- a/common/resourceaccess.h +++ b/common/resourceaccess.h | |||
@@ -50,7 +50,7 @@ public: | |||
50 | virtual KAsync::Job<void> sendCommand(int commandId, flatbuffers::FlatBufferBuilder &fbb) = 0; | 50 | virtual KAsync::Job<void> sendCommand(int commandId, flatbuffers::FlatBufferBuilder &fbb) = 0; |
51 | virtual KAsync::Job<void> synchronizeResource(bool remoteSync, bool localSync) = 0; | 51 | virtual KAsync::Job<void> synchronizeResource(bool remoteSync, bool localSync) = 0; |
52 | 52 | ||
53 | virtual KAsync::Job<void> sendCreateCommand(const QByteArray &resourceBufferType, const QByteArray &buffer) | 53 | virtual KAsync::Job<void> sendCreateCommand(const QByteArray &uid, const QByteArray &resourceBufferType, const QByteArray &buffer) |
54 | { | 54 | { |
55 | return KAsync::null<void>(); | 55 | return KAsync::null<void>(); |
56 | }; | 56 | }; |
@@ -97,7 +97,7 @@ public: | |||
97 | KAsync::Job<void> sendCommand(int commandId) Q_DECL_OVERRIDE; | 97 | KAsync::Job<void> sendCommand(int commandId) Q_DECL_OVERRIDE; |
98 | KAsync::Job<void> sendCommand(int commandId, flatbuffers::FlatBufferBuilder &fbb) Q_DECL_OVERRIDE; | 98 | KAsync::Job<void> sendCommand(int commandId, flatbuffers::FlatBufferBuilder &fbb) Q_DECL_OVERRIDE; |
99 | KAsync::Job<void> synchronizeResource(bool remoteSync, bool localSync) Q_DECL_OVERRIDE; | 99 | KAsync::Job<void> synchronizeResource(bool remoteSync, bool localSync) Q_DECL_OVERRIDE; |
100 | KAsync::Job<void> sendCreateCommand(const QByteArray &resourceBufferType, const QByteArray &buffer) Q_DECL_OVERRIDE; | 100 | KAsync::Job<void> sendCreateCommand(const QByteArray &uid, const QByteArray &resourceBufferType, const QByteArray &buffer) Q_DECL_OVERRIDE; |
101 | KAsync::Job<void> | 101 | KAsync::Job<void> |
102 | sendModifyCommand(const QByteArray &uid, qint64 revision, const QByteArray &resourceBufferType, const QByteArrayList &deletedProperties, const QByteArray &buffer) Q_DECL_OVERRIDE; | 102 | sendModifyCommand(const QByteArray &uid, qint64 revision, const QByteArray &resourceBufferType, const QByteArrayList &deletedProperties, const QByteArray &buffer) Q_DECL_OVERRIDE; |
103 | KAsync::Job<void> sendDeleteCommand(const QByteArray &uid, qint64 revision, const QByteArray &resourceBufferType) Q_DECL_OVERRIDE; | 103 | KAsync::Job<void> sendDeleteCommand(const QByteArray &uid, qint64 revision, const QByteArray &resourceBufferType) Q_DECL_OVERRIDE; |