diff options
author | Marcelo Lira <marcelo.lira@openbossa.org> | 2009-12-02 11:53:18 -0300 |
---|---|---|
committer | Marcelo Lira <marcelo.lira@openbossa.org> | 2009-12-02 19:15:55 -0300 |
commit | 458432be438fb750ae351460536cb7cb3e14263d (patch) | |
tree | 8d8407bf3f08bd2116de62cd63a1ee4b30dab31a /cppgenerator.cpp | |
parent | 943a413287b522475532583147a78c6517613006 (diff) |
Modified the BindingManager::getOverride method to use Python __mro__.
Using the CLASS->tp_mro, which contains the list of method resolution for
a Python class, to find an override for a wrapped C++ virtual method is
more correct than relying in the ShiboTypeObject's baseWrapperType value.
Also baseWrapperType was removed from ShiboTypeObject structure.
Reviewed by Hugo Lima <hugo.lima@openbossa.org>
Diffstat (limited to 'cppgenerator.cpp')
-rw-r--r-- | cppgenerator.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cppgenerator.cpp b/cppgenerator.cpp index b6ef4b737..bda6a26e6 100644 --- a/cppgenerator.cpp +++ b/cppgenerator.cpp @@ -1141,7 +1141,7 @@ void CppGenerator::writeMethodCall(QTextStream& s, const AbstractMetaFunction* f if (func->isConstructor()) { QString className = cpythonTypeName(func->ownerClass()); - s << INDENT << "self = Shiboken::PyBaseWrapper_New(type, &" << className << ", cptr"; + s << INDENT << "self = Shiboken::PyBaseWrapper_New(type, cptr"; // If the created C++ object has a C++ wrapper the ownership is assigned to Python // (first "1") and the flag indicating that the Python wrapper holds an C++ wrapper // is marked as true (the second "1"). Otherwise the default values apply: @@ -2085,7 +2085,7 @@ void CppGenerator::writeTypeConverterImpl(QTextStream& s, const TypeEntry* type) s << '{' << endl; s << INDENT << "return " << "Shiboken::"; if (type->isObject() || type->isValue()) { - s << "PyBaseWrapper_New((PyTypeObject*)&" << pyTypeName << ", &" << pyTypeName << ','; + s << "PyBaseWrapper_New((PyTypeObject*)&" << pyTypeName << ','; } else { // Type is enum or flag s << "PyEnumObject_New(&" << pyTypeName << ", (long)"; |