summaryrefslogtreecommitdiffstats
path: root/scripts/templates
diff options
context:
space:
mode:
authorSandro S. Andrade <sandroandrade@kde.org>2013-11-03 10:26:27 -0300
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-03 14:23:15 +0100
commitc00b14b0cea87d3b5d01be2c7a810d5a3b419ee1 (patch)
treee4f5247f6f6efd655ca2992d1e6b9a933c8a763a /scripts/templates
parenta3775c9d1054d868fb2179ad9b35c570531e4bc9 (diff)
Update metamodels for emitting signals when properties change
Change-Id: Ie762c6ecfec7d9b343c50e1e1b851d26443d548b Reviewed-by: Sandro S. Andrade <sandroandrade@kde.org>
Diffstat (limited to 'scripts/templates')
-rw-r--r--scripts/templates/common.tmpl16
1 files changed, 12 insertions, 4 deletions
diff --git a/scripts/templates/common.tmpl b/scripts/templates/common.tmpl
index 45cf3d06..dd18559b 100644
--- a/scripts/templates/common.tmpl
+++ b/scripts/templates/common.tmpl
@@ -406,7 +406,7 @@ void Q${namespace}${originalClassName}Object::add${attributeName}(${originalQtTy
[%- ELSE %]
qmodelingelementproperty_cast<Q${namespace}${originalClassName} *>(this)->add${attributeName}(${qtAttribute});
[%- END %]
- emit ${PLURALFORM(qtAttribute, attribute)}Changed(this->${PLURALFORM(qtAttribute, attribute)}());
+ emit ${PLURALFORM(qtAttribute, attribute).remove('_$')}Changed(this->${PLURALFORM(qtAttribute, attribute)}());
}
[%- IF qtType.remove("QSet<").remove("QList<").match('\*') %]
@@ -420,21 +420,29 @@ void Q${namespace}${originalClassName}Object::remove${attributeName}(${originalQ
[%- ELSE %]
qmodelingelementproperty_cast<Q${namespace}${originalClassName} *>(this)->remove${attributeName}(${qtAttribute});
[%- END %]
- emit ${PLURALFORM(qtAttribute, attribute)}Changed(this->${PLURALFORM(qtAttribute, attribute)}());
+ emit ${PLURALFORM(qtAttribute, attribute).remove('_$')}Changed(this->${PLURALFORM(qtAttribute, attribute)}());
}
[%- ELSIF qtType.match('\*$') %]
void Q${namespace}${originalClassName}Object::set${attributeName}(${qtType}${qtAttribute})
{
qmodelingelementproperty_cast<Q${namespace}${originalClassName} *>(this)->set${attributeName}(qmodelingelementproperty_cast<${originalQtType}>(${qtAttribute}));
- emit ${qtAttribute}Changed(this->${qtAttribute}());
+ [%- IF attributeName.upper != attributeName %]
+ emit ${attributeName.lcfirst}Changed(this->${qtAttribute}());
+ [%- ELSE %]
+ emit ${attributeName}Changed(this->${attributeName}());
+ [%- END %]
}
[%- ELSE %]
void Q${namespace}${originalClassName}Object::set${attributeName.remove("^Is")}(${qtType}${qtAttribute})
{
qmodelingelementproperty_cast<Q${namespace}${originalClassName} *>(this)->set${attributeName.remove("^Is")}(${qtAttribute});
- emit ${attributeName.lcfirst}Changed(this->${attributeName.lcfirst}());
+ [%- IF attributeName.upper != attributeName %]
+ emit ${attributeName.lcfirst}Changed(this->${qtAttribute}());
+ [%- ELSE %]
+ emit ${attributeName}Changed(this->${attributeName}());
+ [%- END %]
}
[%- END -%]