summaryrefslogtreecommitdiffstats
path: root/common/storage
diff options
context:
space:
mode:
Diffstat (limited to 'common/storage')
-rw-r--r--common/storage/entitystore.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/common/storage/entitystore.cpp b/common/storage/entitystore.cpp
index 4fe7e3b..18c788a 100644
--- a/common/storage/entitystore.cpp
+++ b/common/storage/entitystore.cpp
@@ -249,23 +249,19 @@ bool EntityStore::add(const QByteArray &type, ApplicationDomainType entity, bool
249 249
250ApplicationDomain::ApplicationDomainType EntityStore::applyDiff(const QByteArray &type, const ApplicationDomainType &current, const ApplicationDomainType &diff, const QByteArrayList &deletions) const 250ApplicationDomain::ApplicationDomainType EntityStore::applyDiff(const QByteArray &type, const ApplicationDomainType &current, const ApplicationDomainType &diff, const QByteArrayList &deletions) const
251{ 251{
252 SinkTraceCtx(d->logCtx) << "Applying diff: " << current.availableProperties() << "Deletions: " << deletions << "Changeset: " << diff.changedProperties();
252 auto newEntity = *ApplicationDomainType::getInMemoryRepresentation<ApplicationDomainType>(current, current.availableProperties()); 253 auto newEntity = *ApplicationDomainType::getInMemoryRepresentation<ApplicationDomainType>(current, current.availableProperties());
253 254
254 SinkTraceCtx(d->logCtx) << "Modified entity: " << newEntity;
255
256 // Apply diff 255 // Apply diff
257 //SinkTrace() << "Applying changed properties: " << changeset;
258 for (const auto &property : diff.changedProperties()) { 256 for (const auto &property : diff.changedProperties()) {
259 const auto value = diff.getProperty(property); 257 const auto value = diff.getProperty(property);
260 if (value.isValid()) { 258 if (value.isValid()) {
261 //SinkTrace() << "Setting property: " << property;
262 newEntity.setProperty(property, value); 259 newEntity.setProperty(property, value);
263 } 260 }
264 } 261 }
265 262
266 // Remove deletions 263 // Remove deletions
267 for (const auto &property : deletions) { 264 for (const auto &property : deletions) {
268 //SinkTrace() << "Removing property: " << property;
269 newEntity.setProperty(property, QVariant()); 265 newEntity.setProperty(property, QVariant());
270 } 266 }
271 return newEntity; 267 return newEntity;