diff options
author | Sandro S. Andrade <sandroandrade@kde.org> | 2013-11-20 23:10:29 -0300 |
---|---|---|
committer | Sandro S. Andrade <sandroandrade@kde.org> | 2013-11-21 03:07:57 +0100 |
commit | 9b1ea6e1915cc24282798ac1ae142d90efe6bb7c (patch) | |
tree | 20fa2f5273e08bad14e37c02424a28d503d88ebd /scripts/templates | |
parent | 8e5a36d72286d134e33ad9496507b74b1503178a (diff) |
Provide improved version of DuSE metamodel
Change-Id: Icbc1807e61475a4ca1536b2230d79d7b98ddcd52
Reviewed-by: Sandro S. Andrade <sandroandrade@kde.org>
Diffstat (limited to 'scripts/templates')
-rw-r--r-- | scripts/templates/common.tmpl | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/scripts/templates/common.tmpl b/scripts/templates/common.tmpl index e0e205ba..23463ce2 100644 --- a/scripts/templates/common.tmpl +++ b/scripts/templates/common.tmpl @@ -9,6 +9,7 @@ }; -%] [%- MACRO QT_TYPE(namespace, attribute, external) BLOCK -%] + [%- SET localNamespace = namespace -%] [%- SET multiplicity = attribute.findnodes("upperValue").findvalue("@value") -%] [%- SET isUnique = attribute.findvalue("@isUnique") -%] [%- SET isOrdered = attribute.findvalue("@isOrdered") -%] @@ -17,15 +18,15 @@ [%- IF attributeType == "" -%][%- SET attributeType = attribute.findnodes("type").findvalue("@xmi:idref") -%][%- END -%] [%- IF attributeType == "" -%][%- SET attributeType = attribute.findnodes("type").findvalue("@href") -%][%- END -%] [%- IF attributeType.split('#').first.split('/').last != attributeType and !attributeType.match('PrimitiveTypes\.xmi') -%] - [%- SET namespace = attributeType.split('#').first.split('/').last.split('\.').first.lower.ucfirst -%] + [%- SET localNamespace = attributeType.split('#').first.split('/').last.split('\.').first.lower.ucfirst -%] [%- SET attributeType = attributeType.split('#').last -%] [%- END -%] [%- IF !attributeType.match('PrimitiveTypes\.xmi') -%] [%- IF xmi.findnodes("//packagedElement[@xmi:type='uml:Enumeration' and @name='$attributeType']").findvalue("@name") != "" -%] -Qt${namespace}::${attributeType} +Qt${localNamespace}::${attributeType} [%- ELSE -%] [%- IF attributeType != "" -%] -[% IF external == "false" %]QObject *[% ELSE %]Q${namespace}${attributeType} *[% END %] +[% IF external == "false" %]QObject *[% ELSE %]Q${localNamespace}${attributeType} *[% END %] [%- ELSE %] [% END -%] [%- END -%] [%- ELSE -%] @@ -506,14 +507,15 @@ void Q${namespace}${originalClassName}Object::unset${qtAttribute.remove("^is").u [%- IF forwardName == "" -%][%- SET forwardName = forward.findvalue('@xmi:idref') -%][%- END -%] [%- IF forwardName == "" -%][%- SET forwardName = forward.findvalue('@href') -%][%- END -%] [%- NEXT IF forwardName.match('PrimitiveTypes') -%] +[%- SET localNamespace = namespace -%] [%- IF forwardName.split('#').first.split('/').last != forwardName -%] - [%- SET namespace = forwardName.split('#').first.split('/').last.split('\.').first.lower.ucfirst -%] + [%- SET localNamespace = forwardName.split('#').first.split('/').last.split('\.').first.lower.ucfirst -%] [%- SET forwardName = forwardName.split('#').last -%] [%- END -%] [%- IF xmi.findnodes("//packagedElement[@xmi:type='uml:Enumeration' and @name='$forwardName']").findvalue("@name") != "" -%] [%- useNamespace.push("true") -%] [%- ELSE -%] -[%- IF forwardName != className && superclasses.grep("^${namespace}${forwardName}\$").size == 0 -%][%- forwards.push("Qt${namespace}/Q${namespace}${forwardName}") -%][%- END -%] +[%- IF forwardName != className && superclasses.grep("^${localNamespace}${forwardName}\$").size == 0 -%][%- forwards.push("Qt${localNamespace}/Q${localNamespace}${forwardName}") -%][%- END -%] [%- END -%] [%- END -%] [%- END -%] |