summaryrefslogtreecommitdiffstats
path: root/scripts/templates
diff options
context:
space:
mode:
authorSandro S. Andrade <sandroandrade@kde.org>2013-10-04 13:06:32 -0300
committerSandro S. Andrade <sandroandrade@kde.org>2013-10-04 18:05:36 +0200
commitd31c53a4e6aef364cfc1e596349100c100b5b77c (patch)
treec80f10e04c0298ae8792ee3032f809ab803687c6 /scripts/templates
parent501adbcfd644dd9417a89845516b91df2995443b (diff)
Fix general bugs in template files
Change-Id: Iecb2cbc51851e0fddda3bced03d164447674d6e4 Reviewed-by: Sandro S. Andrade <sandroandrade@kde.org>
Diffstat (limited to 'scripts/templates')
-rw-r--r--scripts/templates/common.tmpl16
-rw-r--r--scripts/templates/qclass.cpp2
2 files changed, 9 insertions, 9 deletions
diff --git a/scripts/templates/common.tmpl b/scripts/templates/common.tmpl
index 6ddab0bf..a2a6ba08 100644
--- a/scripts/templates/common.tmpl
+++ b/scripts/templates/common.tmpl
@@ -385,7 +385,7 @@ void Q${namespace}${originalClassName}Object::set${attributeName}(${qtType}${qtA
{
qmodelingobjectproperty_cast<Q${namespace}${originalClassName} *>(this)->set${attributeName}(qmodelingobjectproperty_cast<${originalQtType}>(${qtAttribute}));
[%- IF attribute.findvalue("defaultValue/@xmi:type") != "" %]
- _modifiedResettableProperties << QStringLiteral("${attributeName.remove("^Is").lcfirst}");
+ qmodelingobjectproperty_cast<Q${namespace}${originalClassName} *>(this)->modifiedResettableProperties() << QStringLiteral("${attributeName.remove("^Is").lcfirst}");
[%- END %]
}
@@ -394,15 +394,15 @@ void Q${namespace}${originalClassName}Object::set${attributeName.remove("^Is")}(
{
qmodelingobjectproperty_cast<Q${namespace}${originalClassName} *>(this)->set${attributeName.remove("^Is")}(${qtAttribute});
[%- IF attribute.findvalue("defaultValue/@xmi:type") != "" %]
- _modifiedResettableProperties << QStringLiteral("${attributeName.remove("^Is").lcfirst}");
+ qmodelingobjectproperty_cast<Q${namespace}${originalClassName} *>(this)->modifiedResettableProperties() << QStringLiteral("${attributeName.remove("^Is").lcfirst}");
[%- END %]
}
[%- END -%]
[%- IF attribute.findvalue("defaultValue/@xmi:type") != "" %]
-void unset${qtAttribute.remove("^is").ucfirst}()
+void Q${namespace}${originalClassName}Object::unset${qtAttribute.remove("^is").ucfirst}()
{
- _modifiedResettableProperties.removeAll(QStringLiteral("${attributeName.remove("^Is").lcfirst}"));
+ qmodelingobjectproperty_cast<Q${namespace}${originalClassName} *>(this)->modifiedResettableProperties().removeAll(QStringLiteral("${attributeName.remove("^Is").lcfirst}"));
}
[%- END -%]
@@ -442,17 +442,17 @@ void unset${qtAttribute.remove("^is").ucfirst}()
[%- SET qtAttribute = QT_ATTRIBUTE(attribute) -%]
[%- NEXT IF redefinedProperties.grep("^${className}-${qtAttribute}$").size > 0 -%]
[%- IF qtType.match("QList|QSet") %]
- foreach (${qtType.remove("QList<").remove("QSet<").remove(">").replace('\* ', '*')}element, ${attributeName}())
+ foreach (${qtType.remove("QList<").remove("QSet<").remove(">").replace('\* ', '*')}element, ${qtAttribute}())
[%- IF qtType.match('\*') %]
c->add${attributeName.ucfirst}(dynamic_cast<${qtType.remove("QList<").remove("QSet<").remove(">").replace('\* ', '*')}>(element->clone()));
[%- ELSE %]
c->add${attributeName.ucfirst}(element);
[%- END -%]
[%- ELSIF qtType.match('\*') %]
- if (${attributeName}())
- c->set${attributeName.ucfirst}(dynamic_cast<${qtType.remove("QList<").remove("QSet<").remove(">").replace('\* ', '*')}>(${attributeName}()->clone()));
+ if (${qtAttribute}())
+ c->set${attributeName.ucfirst}(dynamic_cast<${qtType.remove("QList<").remove("QSet<").remove(">").replace('\* ', '*')}>(${qtAttribute}()->clone()));
[%- ELSE %]
- c->set${attributeName.ucfirst.remove("^Is")}(${attributeName}());
+ c->set${attributeName.ucfirst.remove("^Is")}(${qtAttribute}());
[%- END -%]
[%- END %]
[%- END -%]
diff --git a/scripts/templates/qclass.cpp b/scripts/templates/qclass.cpp
index c3523b4a..6b312184 100644
--- a/scripts/templates/qclass.cpp
+++ b/scripts/templates/qclass.cpp
@@ -407,7 +407,7 @@ void Q${namespace}${className}::setPropertyData()
QModelingObject::propertyDataHash[QStringLiteral("${attribute.findvalue("@name")}")][QtModeling::AggregationRole] = QStringLiteral("composite");
[%- ELSE %]
QModelingObject::propertyDataHash[QStringLiteral("${attribute.findvalue("@name")}")][QtModeling::AggregationRole] = QStringLiteral("none");
-[%- END -%]
+[%- END %]
QModelingObject::propertyDataHash[QStringLiteral("${attribute.findvalue("@name")}")][QtModeling::IsDerivedUnionRole] = [% IF attribute.findvalue("@isDerivedUnion") == "true" %]true[% ELSE %]false[% END %];
QModelingObject::propertyDataHash[QStringLiteral("${attribute.findvalue("@name")}")][QtModeling::DocumentationRole] = QStringLiteral("${attribute.findvalue("ownedComment/body/text()")}");
QModelingObject::propertyDataHash[QStringLiteral("${attribute.findvalue("@name")}")][QtModeling::RedefinedPropertiesRole] = QStringLiteral("${attribute.findvalue("@redefinedProperty")}");