aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Krus <mike.krus@kdab.com>2017-08-23 11:21:32 +0100
committerMike Krus <mike.krus@kdab.com>2017-09-12 20:17:36 +0000
commit55cbf95a777e6e38aff43197368aaddc9b63735b (patch)
tree01a0b4b9acc4391a651d0cbcc88c380bd8da886e
parentbbc11fc1b4bbf975bf3e97d9fd8bf07c8197703b (diff)
Fix for overriding zoned features
Initialize the pointer to the service object for zoned child features (doesn’t do the full registration as it doesn’t need to connect to change requests). This is needed to be able to identify all instances of front end classes which are talking to the same backend. Also always update the client side value even if overriding is on. Change-Id: I2d756106c14536936451f61a502a13a1bb28e8dd Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com>
-rw-r--r--src/ivicore/qiviabstractzonedfeature.cpp1
-rw-r--r--src/tools/ivigenerator/templates_frontend/interface.cpp.tpl8
2 files changed, 6 insertions, 3 deletions
diff --git a/src/ivicore/qiviabstractzonedfeature.cpp b/src/ivicore/qiviabstractzonedfeature.cpp
index 8dac558..8f5b7df 100644
--- a/src/ivicore/qiviabstractzonedfeature.cpp
+++ b/src/ivicore/qiviabstractzonedfeature.cpp
@@ -239,6 +239,7 @@ void QIviAbstractZonedFeature::initializeZones()
else
f = createZoneFeature(zone);
if (f) {
+ dynamic_cast<QIviAbstractZonedFeaturePrivate *>(f->d_ptr.data())->m_serviceObject = d->m_serviceObject;
d->m_zoneFeatures.append(f);
d->m_zoneFeatureList.append(QVariant::fromValue(f));
d->m_zoneFeatureMap.insert(f->zone(), QVariant::fromValue(f));
diff --git a/src/tools/ivigenerator/templates_frontend/interface.cpp.tpl b/src/tools/ivigenerator/templates_frontend/interface.cpp.tpl
index df80c57..d25706e 100644
--- a/src/tools/ivigenerator/templates_frontend/interface.cpp.tpl
+++ b/src/tools/ivigenerator/templates_frontend/interface.cpp.tpl
@@ -148,8 +148,10 @@ void {{class}}Private::on{{property|upperfirst}}Changed({{property|parameter_typ
f = q;
if (f->zone() != zone)
return;
- {{class}}Private::get(f)->m_{{property}} = {{property}};
- emit f->{{property}}Changed({{property}});
+ if ({{class}}Private::get(f)->m_{{property}} != {{property}}) {
+ {{class}}Private::get(f)->m_{{property}} = {{property}};
+ emit f->{{property}}Changed({{property}});
+ }
}
{% else %}
void {{class}}Private::on{{property|upperfirst}}Changed({{property|parameter_type}})
@@ -256,6 +258,7 @@ void {{class}}::{{property|setter_name}}({{ property|parameter_type }})
auto d = {{class}}Private::get(this);
if (d->m_{{property}} == {{property}})
return;
+ d->m_{{property}} = {{property}};
{% if not module.tags.config.disablePrivateIVI %}
bool sendToBackend = true;
if (Q_UNLIKELY(d->m_propertyOverride)) {
@@ -268,7 +271,6 @@ void {{class}}::{{property|setter_name}}({{ property|parameter_type }})
{% endif %}
if ({{class}}BackendInterface *backend = qobject_cast<{{class}}BackendInterface *>(this->backend()))
backend->{{property|setter_name}}({{property}}{% if interface.tags.config.zoned %}, zone(){% endif %});
- d->m_{{property}} = {{property}};
}
emit {{property}}Changed({{property}});
}