summaryrefslogtreecommitdiffstats
path: root/common/domain/applicationdomaintype.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'common/domain/applicationdomaintype.cpp')
-rw-r--r--common/domain/applicationdomaintype.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/common/domain/applicationdomaintype.cpp b/common/domain/applicationdomaintype.cpp
index fd88570..99f14a1 100644
--- a/common/domain/applicationdomaintype.cpp
+++ b/common/domain/applicationdomaintype.cpp
@@ -115,10 +115,8 @@ void copyBuffer(Sink::ApplicationDomain::BufferAdaptor &buffer, Sink::Applicatio
115 for (const auto &property : propertiesToCopy) { 115 for (const auto &property : propertiesToCopy) {
116 const auto value = buffer.getProperty(property); 116 const auto value = buffer.getProperty(property);
117 if (copyBlobs && value.canConvert<BLOB>()) { 117 if (copyBlobs && value.canConvert<BLOB>()) {
118 auto oldPath = value.value<BLOB>().value; 118 const auto oldPath = value.value<BLOB>().value;
119 //FIXME: This is neither pretty nor save if we have multiple modifications of the same property (the first modification will remove the file). 119 const auto newPath = Sink::temporaryFileLocation() + "/" + QUuid::createUuid().toString();
120 //At least if the modification fails the file will be removed once the entity is removed.
121 auto newPath = oldPath + "copy";
122 QFile::copy(oldPath, newPath); 120 QFile::copy(oldPath, newPath);
123 memoryAdaptor.setProperty(property, QVariant::fromValue(BLOB{newPath})); 121 memoryAdaptor.setProperty(property, QVariant::fromValue(BLOB{newPath}));
124 } else if (pruneReferences && value.canConvert<Reference>()) { 122 } else if (pruneReferences && value.canConvert<Reference>()) {