Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 477dccee authored by Laurent Montel's avatar Laurent Montel 😁

Don't generate const'ref for int/bool

parent 0c8a4b9e
......@@ -328,7 +328,15 @@ void CppGenerator::writeHeaderClass(ClassNode const *node)
} else if (!prop->dependencies().isEmpty()) {
mHeader << " void " << prop->setterName() << "(const " << prop->type() << " &" << prop->name() << ");\n";
} else {
mHeader << " inline void " << prop->setterName() << "(const " << prop->type() << " &"
QString varType;
if (prop->type() == QLatin1String("qint64")
|| prop->type() == QLatin1String("int")
|| prop->type() == QLatin1String("bool") ) {
varType = QLatin1String("(") + prop->type() + QLatin1String(" ");
} else {
varType = QLatin1String("(const ") + prop->type() + QLatin1String(" &");
}
mHeader << " inline void " << prop->setterName() << varType
<< prop->name() << ") { " << prop->mVariableName() << " = "
<< prop->name() << "; }\n";
}
......
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