From b8db6d3d44eb4e7bdb1e680acb51b91dba64bbc6 Mon Sep 17 00:00:00 2001 From: Marcelo Lira Date: Tue, 24 Nov 2009 19:01:47 -0300 Subject: Updated the code injection writer to replace "%TYPE" and "%0" by the proper values when they are used in a constructor code injection. --- shibokengenerator.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'shibokengenerator.cpp') 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); } -- cgit v1.2.3