aboutsummaryrefslogtreecommitdiffstats
path: root/src/tools/ivigenerator/templates_frontend
diff options
context:
space:
mode:
authorDominik Holland <dominik.holland@pelagicore.com>2018-12-05 12:01:23 +0100
committerRobert Griebl <robert.griebl@pelagicore.com>2018-12-05 20:29:08 +0000
commit0439304de22e9f7e66163479fb67a9e0d8c27612 (patch)
tree7d51504e008d9c17c63bce3fc2e551eceb6d0c84 /src/tools/ivigenerator/templates_frontend
parent3781b74db1a490535261e45870b9a4c7215c940e (diff)
Clang-tidy and Clazy fixes
Change-Id: Id88db48e0e18761a9bc1b1014628bf0099c4e5cf Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
Diffstat (limited to 'src/tools/ivigenerator/templates_frontend')
-rw-r--r--src/tools/ivigenerator/templates_frontend/modulefactory.cpp.tpl4
-rw-r--r--src/tools/ivigenerator/templates_frontend/modulefactory.h.tpl2
-rw-r--r--src/tools/ivigenerator/templates_frontend/struct.cpp.tpl9
-rw-r--r--src/tools/ivigenerator/templates_frontend/struct.h.tpl2
4 files changed, 9 insertions, 8 deletions
diff --git a/src/tools/ivigenerator/templates_frontend/modulefactory.cpp.tpl b/src/tools/ivigenerator/templates_frontend/modulefactory.cpp.tpl
index ede6670..0ed1012 100644
--- a/src/tools/ivigenerator/templates_frontend/modulefactory.cpp.tpl
+++ b/src/tools/ivigenerator/templates_frontend/modulefactory.cpp.tpl
@@ -70,9 +70,9 @@ QT_BEGIN_NAMESPACE
\sa {{struct}}
*/
-{{struct}} {{class}}::{{struct|lowerfirst}}({% for field in struct.fields %}{% if not loop.first %}, {% endif %}{{field|return_type}} {{field}}{% endfor %}) const
+{{struct}} {{class}}::{{struct|lowerfirst}}({{struct.fields|map('parameter_type')|join(', ')}}) const
{
- return {{struct}}({% for field in struct.fields %}{% if not loop.first %}, {% endif %}{{field}}{% endfor %});
+ return {{struct}}({{struct.fields|join(', ')}});
}
{% endfor %}
diff --git a/src/tools/ivigenerator/templates_frontend/modulefactory.h.tpl b/src/tools/ivigenerator/templates_frontend/modulefactory.h.tpl
index 02736d8..d69770c 100644
--- a/src/tools/ivigenerator/templates_frontend/modulefactory.h.tpl
+++ b/src/tools/ivigenerator/templates_frontend/modulefactory.h.tpl
@@ -64,7 +64,7 @@ public:
{% for struct in module.structs %}
Q_INVOKABLE {{struct}} {{struct|lowerfirst}}() const;
- Q_INVOKABLE {{struct}} {{struct|lowerfirst}}({% for field in struct.fields %}{% if not loop.first %}, {% endif %}{{field|return_type}} {{field}}{% endfor %}) const;
+ Q_INVOKABLE {{struct}} {{struct|lowerfirst}}({{struct.fields|map('parameter_type')|join(', ')}}) const;
{% endfor %}
};
diff --git a/src/tools/ivigenerator/templates_frontend/struct.cpp.tpl b/src/tools/ivigenerator/templates_frontend/struct.cpp.tpl
index 7670f36..e9f8063 100644
--- a/src/tools/ivigenerator/templates_frontend/struct.cpp.tpl
+++ b/src/tools/ivigenerator/templates_frontend/struct.cpp.tpl
@@ -51,8 +51,9 @@ class {{class}}Private : public QSharedData
{
public:
{{class}}Private()
+ : QSharedData()
{% for field in struct.fields %}
- {% if loop.first %}:{% else %},{% endif %} m_{{field}}({{field|default_type_value}})
+ , m_{{field}}({{field|default_type_value}})
{% endfor %}
{}
@@ -63,7 +64,7 @@ public:
{% endfor %}
{}
- {{class}}Private({% for field in struct.fields %}{% if not loop.first %}, {% endif %}{{field|return_type}} {{field}}{% endfor %})
+ {{class}}Private({{struct.fields|map('parameter_type')|join(', ')}})
: QSharedData()
{% for field in struct.fields %}
, m_{{field}}({{field}})
@@ -101,9 +102,9 @@ public:
return *this;
}
-{{class}}::{{class}}({% for field in struct.fields %}{% if not loop.first %}, {% endif %}{{field|return_type}} {{field}}{% endfor %})
+{{class}}::{{class}}({{struct.fields|map('parameter_type')|join(', ')}})
: QIviStandardItem()
- , d(new {{class}}Private({% for field in struct.fields %}{% if not loop.first %}, {% endif %}{{field}}{% endfor %}))
+ , d(new {{class}}Private({{struct.fields|join(', ')}}))
{
}
diff --git a/src/tools/ivigenerator/templates_frontend/struct.h.tpl b/src/tools/ivigenerator/templates_frontend/struct.h.tpl
index da67518..e12e4a7 100644
--- a/src/tools/ivigenerator/templates_frontend/struct.h.tpl
+++ b/src/tools/ivigenerator/templates_frontend/struct.h.tpl
@@ -74,7 +74,7 @@ public:
Q_INVOKABLE {{class}}();
Q_INVOKABLE {{class}}(const {{class}} &rhs);
{{class}} &operator=(const {{class}} &);
- Q_INVOKABLE {{class}}({% for field in struct.fields %}{% if not loop.first %}, {% endif %}{{field|return_type}} {{field}}{% endfor %});
+ Q_INVOKABLE {{class}}({{struct.fields|map('parameter_type')|join(', ')}});
Q_INVOKABLE {{class}}(const QVariant &variant);
~{{class}}();