Commit 1e4941ec authored by Wouter's avatar Wouter

Proper parsing of parameters to base classes in generated constructors

i.e. Template fixes
parent e3092ffb
{% load grantleecodegen %}
class {{ class.className }}
{% for base in class.inheritance %}
{% if forloop.first %}:{% else %},{% endif %} {{ base.protectionLevel.key|lower }} {{ base.name }}
{% if forloop.first %}:{% else %},{% endif %} virtual {{ base.protectionLevel.key|lower }} {{ base.name }}
{% endfor %}
{
......
......@@ -7,15 +7,17 @@
{% switch member.memberKind %}
{% default %}
{% case "Constructor" %}
{{ class.namespaces|join:"::" }}::{{ class.className }}::{{ member.name }}({% for param in member.parameters %}{% if not forloop.first %}, {% endif %}{{ param.type.signature }} {{ param.name }}{% endfor %})
{% for item in member.initializers %}{% if forloop.first %}:{% else %},{% endif %} {{ item.member }}({{ item.parameters }}){% endfor %}
{% evalto initializers %}{% for item in member.initializers %}{% if forloop.first %}:{% else %},{% endif %} {{ item.member }}({{ item.parameters }}){% endfor %}{% evaltosplit %}
{% evalto params %}{% for param in member.parameters %}{% if not forloop.first %}, {% endif %}{{ param.type.signature }} {{ param.name }}{% endfor %}{% evaltosplit %}
{{ class.fullName }}::{{ member.name }}({{ params }})
{{ initializers }}
{
{{ member.body }}
}
// Data loader
{{ class.namespaces|join:"::" }}::{{ class.className }}::{{ member.name }}(const QVariantMap &data{% for param in member.parameters %}, {{ param.type.signature }} {{ param.name }}{% endfor %})
{% for item in member.initializers %}{% if forloop.first %}:{% else %},{% endif %} {{ item.member }}({% if item.isInheritance and item.type.isIntrospected %}data, {% endif %}{{ item.parameters }}){% endfor %}
{{ class.fullName }}::{{ member.name }}(const QVariantMap &data{% if params %}, {{ params }}{% endif %})
{{ initializers }}
{
{{ member.body }}
LoadOwnData(data);
......@@ -37,6 +39,8 @@
}
{% endfor %}
}
{% endevalto %}
{% endevalto %}
{% case "Method" %}
{% if not member.isInline %}{% if not member.isPureVirtual %}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment