summaryrefslogtreecommitdiffstats
path: root/scripts/templates
diff options
context:
space:
mode:
authorSandro S. Andrade <sandroandrade@kde.org>2013-11-20 17:32:48 -0300
committerSandro S. Andrade <sandroandrade@kde.org>2013-11-20 21:28:30 +0100
commit838e0e4bc84d292d766abb9321956c75794591fe (patch)
treeea36c47badbe51a89cd75b9c2de4de950cc6fce2 /scripts/templates
parentfd76b29cfd51f6521837c9cdcd2fdf984909afba (diff)
Fix bug in templates when update opposite properties of the same class
Change-Id: I119097fd92b3f80f643f7630411cfdd7d6390df5 Reviewed-by: Sandro S. Andrade <sandroandrade@kde.org>
Diffstat (limited to 'scripts/templates')
-rw-r--r--scripts/templates/qclass.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/templates/qclass.cpp b/scripts/templates/qclass.cpp
index b8377d3d..4400b3b2 100644
--- a/scripts/templates/qclass.cpp
+++ b/scripts/templates/qclass.cpp
@@ -234,7 +234,7 @@ void Q${namespace}${className}::add${attributeName}(${qtType.remove("QSet<").rem
[%- IF association != "" -%]
[%- found = "false" -%]
[%- FOREACH memberEnd = xmi.findvalue("//packagedElement[(@xmi:type=\"uml:Association\" or @xmi:type=\"uml:Extension\") and @name=\"${association}\"]/@memberEnd").split(' ') -%]
- [%- NEXT IF memberEnd.split('-').0 == className -%]
+ [%- NEXT IF memberEnd.split('-').0 == className && memberEnd.split('-').1 == attributeName.lcfirst -%]
[%- SET oppositeProperty = xmi.findnodes("//packagedElement[(@xmi:type=\"uml:Class\" or @xmi:type=\"uml:Stereotype\") and @name=\"${memberEnd.split('-').0}\"]/ownedAttribute[@name=\"${memberEnd.split('-').1}\"]") -%]
[%- IF oppositeProperty.findvalue("@name") != "" -%]
[%- IF found == "false" %]
@@ -308,7 +308,7 @@ void Q${namespace}${className}::remove${attributeName}(${qtType.remove("QSet<").
[%- IF association != "" -%]
[%- found = "false" -%]
[%- FOREACH memberEnd = xmi.findvalue("//packagedElement[(@xmi:type=\"uml:Association\" or @xmi:type=\"uml:Extension\") and @name=\"${association}\"]/@memberEnd").split(' ') -%]
- [%- NEXT IF memberEnd.split('-').0 == className -%]
+ [%- NEXT IF memberEnd.split('-').0 == className && memberEnd.split('-').1 == attributeName.lcfirst -%]
[%- SET oppositeProperty = xmi.findnodes("//packagedElement[(@xmi:type=\"uml:Class\" or @xmi:type=\"uml:Stereotype\") and @name=\"${memberEnd.split('-').0}\"]/ownedAttribute[@name=\"${memberEnd.split('-').1}\"]") -%]
[%- IF oppositeProperty.findvalue("@name") != "" -%]
[%- IF found == "false" %]