summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2010-05-07 10:09:10 -0300
committerRenato Filho <renato.filho@openbossa.org>2010-05-07 11:51:19 -0300
commite3f3c1007a435e647eb0ee026559b9a64b44da9e (patch)
treeca2e3e6cbb681db8f4fb3404d23f325844918b56
parent7271b442d9393add8a3da3e66e5462ad553c87c6 (diff)
downloadshiboken-e3f3c1007a435e647eb0ee026559b9a64b44da9e.tar.gz
shiboken-e3f3c1007a435e647eb0ee026559b9a64b44da9e.tar.xz
shiboken-e3f3c1007a435e647eb0ee026559b9a64b44da9e.zip
Register values types as object types too.
Fixes bug #121. Reviewer: Hugo Parente Lima <hugo.lima@openbossa.org>, Luciano Wolf <luciano.wolf@openbossa.org>
-rw-r--r--cppgenerator.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/cppgenerator.cpp b/cppgenerator.cpp
index de2be43c..21ec6538 100644
--- a/cppgenerator.cpp
+++ b/cppgenerator.cpp
@@ -2747,10 +2747,12 @@ void CppGenerator::writeClassRegister(QTextStream& s, const AbstractMetaClass* m
if (!metaClass->isNamespace()) {
bool isObjectType = metaClass->typeEntry()->isObject();
QString typeName = metaClass->qualifiedCppName();
- QString registeredTypeName = typeName + (isObjectType ? "*" : "");
- QString functionSufix = isObjectType ? "Object" : "Value";
- s << INDENT << "Shiboken::TypeResolver::create" << functionSufix;
- s << "TypeResolver<" << typeName << " >" << "(\"" << registeredTypeName << "\");\n";
+ if (!isObjectType)
+ s << INDENT << "Shiboken::TypeResolver::createValueTypeResolver<" << typeName << " >" << "(\"" << typeName << "\");\n";
+
+ s << INDENT << "Shiboken::TypeResolver::createObjectTypeResolver<" << typeName << " >" << "(\"" << typeName << "*\");\n";
+
+ QString functionSufix = (isObjectType ? "Object" : "Value");
s << INDENT << "Shiboken::TypeResolver::create" << functionSufix;
s << "TypeResolver<" << typeName << " >" << "(typeid(" << typeName << ").name());\n";
}