diff options
author | Hugo Parente Lima <hugo.pl@gmail.com> | 2010-11-23 13:35:42 -0200 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:09:00 -0300 |
commit | 21f0343984ddf5aeb5c163cd87540658f5bf4990 (patch) | |
tree | a5a65246e1476c421de1cf681b08feab509d1701 /generator | |
parent | bdfa13fb40778a91622e125a0c5e96f51ed666eb (diff) |
Do not use const and ref when writing converters for object-types, qflags, const ref. value types and enums.
Diffstat (limited to 'generator')
-rw-r--r-- | generator/shibokengenerator.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/generator/shibokengenerator.cpp b/generator/shibokengenerator.cpp index 5ddbb6d7e..b064573d9 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("::"); } |