summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2010-11-23 13:35:42 -0200
committerHugo Parente Lima <hugo.pl@gmail.com>2010-11-23 13:37:10 -0200
commit605bbf8d03eaf5c90b1efdb17eabfa66fedc24be (patch)
treef973f457e6ca3e1d5168544cffd548fd66487163
parent622e6f61a08b8ef31dd996609d69812f53e566b8 (diff)
downloadshiboken-605bbf8d03eaf5c90b1efdb17eabfa66fedc24be.tar.gz
shiboken-605bbf8d03eaf5c90b1efdb17eabfa66fedc24be.tar.xz
shiboken-605bbf8d03eaf5c90b1efdb17eabfa66fedc24be.zip
Do not use const and ref when writing converters for object-types, qflags, const ref. value types and enums.
-rw-r--r--generator/shibokengenerator.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/generator/shibokengenerator.cpp b/generator/shibokengenerator.cpp
index 5ddbb6d7..b064573d 100644
--- a/generator/shibokengenerator.cpp
+++ b/generator/shibokengenerator.cpp
@@ -476,7 +476,7 @@ static QString baseConversionString(QString typeName)
void ShibokenGenerator::writeBaseConversion(QTextStream& s, const TypeEntry* type)
{
- QString typeName = type->qualifiedCppName();
+ QString typeName = type->qualifiedCppName().trimmed();
if (!type->isCppPrimitive())
typeName.prepend("::");
if (type->isObject())
@@ -501,11 +501,11 @@ void ShibokenGenerator::writeBaseConversion(QTextStream& s, const AbstractMetaTy
ptype = ptype->basicAliasedTypeEntry();
typeName = ptype->name();
} else {
- if (type->isObject() || (type->isValue() && !type->isReference()))
+ if (!isCString(type)) // not "const char*"
options |= Generator::ExcludeConst;
- if (type->isContainer() || (type->isConstant() && type->isReference()))
- options |= Generator::ExcludeReference | Generator::ExcludeConst;
- typeName = translateTypeForWrapperMethod(type, context, options);
+ if (type->isContainer() || type->isFlags() || type->isEnum() || (type->isConstant() && type->isReference()))
+ options |= Generator::ExcludeReference;
+ typeName = translateTypeForWrapperMethod(type, context, options).trimmed();
if (!type->typeEntry()->isCppPrimitive())
typeName.prepend("::");
}