summaryrefslogtreecommitdiffstats
path: root/common/domain/applicationdomaintype.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-09-13 12:42:31 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-09-13 12:42:31 +0200
commitc12a9a09da59b9e418316dba02e6215cb55e47ee (patch)
tree05498d9a42e399bcca787f40c1fc473fb09e680e /common/domain/applicationdomaintype.cpp
parent55fe06979ceebe67553135b43aa47e70d931304b (diff)
parentebdb89b8bb482bbb5ecd544c3d38bef35fc7d820 (diff)
downloadsink-0.4.0.tar.gz
sink-0.4.0.zip
Merge commit 'ebdb89b8bb482bbb5ecd544c3d38bef35fc7d820'v0.4.0
Diffstat (limited to 'common/domain/applicationdomaintype.cpp')
-rw-r--r--common/domain/applicationdomaintype.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/common/domain/applicationdomaintype.cpp b/common/domain/applicationdomaintype.cpp
index 3718f77..ee70c35 100644
--- a/common/domain/applicationdomaintype.cpp
+++ b/common/domain/applicationdomaintype.cpp
@@ -34,7 +34,13 @@ QDebug Sink::ApplicationDomain::operator<< (QDebug d, const Sink::ApplicationDom
34QDebug Sink::ApplicationDomain::operator<< (QDebug d, const Sink::ApplicationDomain::ApplicationDomainType &type) 34QDebug Sink::ApplicationDomain::operator<< (QDebug d, const Sink::ApplicationDomain::ApplicationDomainType &type)
35{ 35{
36 d << "ApplicationDomainType(\n"; 36 d << "ApplicationDomainType(\n";
37 auto properties = type.mAdaptor->availableProperties(); 37 auto properties = [&] {
38 if (!type.changedProperties().isEmpty()) {
39 return type.changedProperties();
40 } else {
41 return type.mAdaptor->availableProperties();
42 }
43 }();
38 std::sort(properties.begin(), properties.end()); 44 std::sort(properties.begin(), properties.end());
39 d << " " << "Id: " << "\t" << type.identifier() << "\n"; 45 d << " " << "Id: " << "\t" << type.identifier() << "\n";
40 d << " " << "Resource: " << "\t" << type.resourceInstanceIdentifier() << "\n"; 46 d << " " << "Resource: " << "\t" << type.resourceInstanceIdentifier() << "\n";
@@ -216,8 +222,13 @@ QVariant ApplicationDomainType::getProperty(const QByteArray &key) const
216void ApplicationDomainType::setProperty(const QByteArray &key, const QVariant &value) 222void ApplicationDomainType::setProperty(const QByteArray &key, const QVariant &value)
217{ 223{
218 Q_ASSERT(mAdaptor); 224 Q_ASSERT(mAdaptor);
219 mChangeSet->insert(key); 225 auto existing = mAdaptor->getProperty(key);
220 mAdaptor->setProperty(key, value); 226 if (existing.isValid() && existing == value) {
227 SinkTrace() << "Tried to set property that is still the same: " << key << value;
228 } else {
229 mChangeSet->insert(key);
230 mAdaptor->setProperty(key, value);
231 }
221} 232}
222 233
223void ApplicationDomainType::setResource(const QByteArray &identifier) 234void ApplicationDomainType::setResource(const QByteArray &identifier)