From 961b3c5775a805eae02718884cfa9dedc8188897 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Mon, 9 Oct 2017 16:10:12 +0200 Subject: Ensure we copy all blobs when copying to another resource --- common/pipeline.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'common') diff --git a/common/pipeline.cpp b/common/pipeline.cpp index f29c7db..0cdedee 100644 --- a/common/pipeline.cpp +++ b/common/pipeline.cpp @@ -295,9 +295,11 @@ KAsync::Job Pipeline::modifiedEntity(void const *command, size_t size) //The entity is either being copied or moved if (newEntity.resourceInstanceIdentifier() != d->resourceContext.resourceInstanceIdentifier) { - SinkTraceCtx(d->logCtx) << "Moving entity to new resource " << newEntity.identifier() << newEntity.resourceInstanceIdentifier(); - newEntity.setChangedProperties(newEntity.availableProperties().toSet()); - return create(bufferType, newEntity) + auto copy = *ApplicationDomain::ApplicationDomainType::getInMemoryCopy(newEntity, newEntity.availableProperties()); + copy.setResource(newEntity.resourceInstanceIdentifier()); + copy.setChangedProperties(copy.availableProperties().toSet()); + SinkTraceCtx(d->logCtx) << "Moving entity to new resource " << copy.identifier() << copy.resourceInstanceIdentifier(); + return create(bufferType, copy) .then([=](const KAsync::Error &error) { if (!error) { SinkTraceCtx(d->logCtx) << "Move of " << current.identifier() << "was successfull"; -- cgit v1.2.3