aboutsummaryrefslogtreecommitdiffstats
path: root/shibokengenerator.cpp
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2009-11-24 19:01:47 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2009-11-24 19:01:47 -0300
commitb8db6d3d44eb4e7bdb1e680acb51b91dba64bbc6 (patch)
treef9a0b7815680e5d48ac45836d167a7da3b1a4655 /shibokengenerator.cpp
parent8346dba84250919d435d0115b0f776f4d01ea4fe (diff)
Updated the code injection writer to replace "%TYPE" and "%0" by the
proper values when they are used in a constructor code injection.
Diffstat (limited to 'shibokengenerator.cpp')
-rw-r--r--shibokengenerator.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/shibokengenerator.cpp b/shibokengenerator.cpp
index 411c59b37..f5d5b5046 100644
--- a/shibokengenerator.cpp
+++ b/shibokengenerator.cpp
@@ -893,7 +893,10 @@ void ShibokenGenerator::writeCodeSnips(QTextStream& s,
}
// replace template variable for return variable name
- code.replace("%0", retvalVariableName());
+ if (func->isConstructor())
+ code.replace("%0", "cptr");
+ else
+ code.replace("%0", retvalVariableName());
// replace template variable for self Python object
QString pySelf;
@@ -1005,6 +1008,9 @@ void ShibokenGenerator::writeCodeSnips(QTextStream& s,
}
#endif
+ if (func->isConstructor() && shouldGenerateCppWrapper(func->ownerClass()))
+ code.replace("%TYPE", wrapperName(func->ownerClass()));
+
replaceTemplateVariables(code, func);
}