From 4bc23304fc8a316e07eccbd3327a0af76aeb8954 Mon Sep 17 00:00:00 2001 From: Dominik Holland Date: Wed, 18 Mar 2020 09:48:09 +0100 Subject: ivigenerator: Fix generation error with zoned default values With zoned default values we cannot initialize the member variables of the autogenerated class anymore. Instead of doing that, we now initialize the members using the default_type_value() filter. We now rely on the provided QML simulation and initializeDefault() as this does also the correct parsing of zoned default values. Change-Id: I810485721bc9535eaa8838ba1b773a80d8758725 Reviewed-by: Robert Griebl --- .../ivigenerator/templates/common/backend_simulation.cpp.tpl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/tools/ivigenerator/templates/common/backend_simulation.cpp.tpl b/src/tools/ivigenerator/templates/common/backend_simulation.cpp.tpl index 9ee929e..4c146e1 100644 --- a/src/tools/ivigenerator/templates/common/backend_simulation.cpp.tpl +++ b/src/tools/ivigenerator/templates/common/backend_simulation.cpp.tpl @@ -69,7 +69,7 @@ QT_BEGIN_NAMESPACE , m_{{ property }}(new {{property|upperfirst}}ModelBackend(this)); {% endif %} {% else %} - , m_{{ property }}({{property|default_value}}) + , m_{{ property }}({{property|default_type_value}}) {% endif %} {% endfor %} { @@ -103,7 +103,7 @@ QT_BEGIN_NAMESPACE : {{class}}Interface(parent) {% for property in interface.properties %} {% if not property.type.is_model %} - , m_{{ property }}({{property|default_value}}) + , m_{{ property }}({{property|default_type_value}}) {% endif %} {% endfor %} {% if interface_zoned %} @@ -198,7 +198,7 @@ void {{class}}::addZone(const QString &zone) return zo->{{property|getter_name}}(); else qWarning() << "No such Zone"; - return {{property|default_value}}; + return {{property|default_type_value}}; } {% else %} {{ivi.prop_getter(property, class, model_interface = true)}} @@ -257,7 +257,7 @@ void {{class}}::addZone(const QString &zone) Q_UNUSED(zone); {% endif %} - qWarning() << "Not implemented!"; + qWarning() << "{{operation}}: Not implemented!"; //Fake that the reply always succeeded QIviPendingReply<{{operation|return_type}}> successReply; -- cgit v1.2.1