diff options
author | Marcelo Lira <marcelo.lira@openbossa.org> | 2011-08-11 09:50:01 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:17:11 -0300 |
commit | e5d7ccddfee37eb10e3c594f96bdddb49864c340 (patch) | |
tree | 0a403a34910674b17cce820a721b0b92e1a0609d /generator/cppgenerator.cpp | |
parent | 81307ef0b1255143e2eb560bc80d80d9dda796ed (diff) |
CppGenerator's writeCopyFunction method now uses cpythonToPythonConversionFunction.
The new overload of cpythonToPythonConversionFunction, that is.
Reviewed by Luciano Wolf <luciano.wolf@openbossa.org>
Reviewed by Renato Araújo <renato.filho@openbossa.org>
Diffstat (limited to 'generator/cppgenerator.cpp')
-rw-r--r-- | generator/cppgenerator.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/generator/cppgenerator.cpp b/generator/cppgenerator.cpp index 07c94efbc..8dd54cc79 100644 --- a/generator/cppgenerator.cpp +++ b/generator/cppgenerator.cpp @@ -2833,18 +2833,14 @@ void CppGenerator::writeTpClearFunction(QTextStream& s, const AbstractMetaClass* s << '}' << endl; } -void CppGenerator::writeCopyFunction(QTextStream& s, const AbstractMetaClass *metaClass) +void CppGenerator::writeCopyFunction(QTextStream& s, const AbstractMetaClass* metaClass) { QString className = cpythonTypeName(metaClass).replace(QRegExp("_Type$"), ""); s << "static PyObject* " << className << "___copy__(PyObject* " PYTHON_SELF_VAR ")" << endl; s << "{" << endl; - - writeCppSelfDefinition(s, metaClass); - - s << INDENT << "PyObject* " << PYTHON_RETURN_VAR << " = "; - s << "Shiboken::Converter< ::" << metaClass->qualifiedCppName() << " >::toPython(*"; - s << CPP_SELF_VAR << ");" << endl; - s << endl; + writeCppSelfDefinition(s, metaClass, false, true); + s << INDENT << "PyObject* " << PYTHON_RETURN_VAR << " = " << cpythonToPythonConversionFunction(metaClass); + s << "(" CPP_SELF_VAR ");" << endl; writeFunctionReturnErrorCheckSection(s); s << INDENT << "return " PYTHON_RETURN_VAR ";" << endl; s << "}" << endl; |