diff options
author | Marcelo Lira <marcelo.lira@openbossa.org> | 2009-12-02 19:03:51 -0300 |
---|---|---|
committer | Marcelo Lira <marcelo.lira@openbossa.org> | 2009-12-02 19:34:27 -0300 |
commit | bfde7a8074a86f547402bcf6deae3e407a8db3bb (patch) | |
tree | 7ce5683dde027aaf0d60569b0cee8ab4d7b8ca27 /cppgenerator.cpp | |
parent | 2dbe941b2b0e163e49cffe6626b1f47a06b8a7c8 (diff) |
Fixed argument conversion writer and type translator to handle references to object-types.
Diffstat (limited to 'cppgenerator.cpp')
-rw-r--r-- | cppgenerator.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/cppgenerator.cpp b/cppgenerator.cpp index bda6a26e6..b35defab3 100644 --- a/cppgenerator.cpp +++ b/cppgenerator.cpp @@ -753,20 +753,22 @@ void CppGenerator::writeArgumentConversion(QTextStream& s, QString argName, QString pyArgName, const AbstractMetaClass* context) { - if (argType->typeEntry()->isCustom()) + const TypeEntry* type = argType->typeEntry(); + + if (type->isCustom()) return; QString typeName; - QString baseTypeName = argType->typeEntry()->name(); - bool isWrappedCppClass = argType->typeEntry()->isValue() || argType->typeEntry()->isObject(); + QString baseTypeName = type->name(); + bool isWrappedCppClass = type->isValue() || type->isObject(); if (isWrappedCppClass) typeName = baseTypeName + '*'; else typeName = translateTypeForWrapperMethod(argType, context); - if (argType->typeEntry()->isContainer()) { + if (type->isContainer() || type->isPrimitive()) { if (typeName.startsWith("const ")) - typeName.remove(0, 6); + typeName.remove(0, sizeof("const ") / sizeof(char) - 1); if (typeName.endsWith("&")) typeName.chop(1); } |