diff options
author | Marcelo Lira <marcelo.lira@openbossa.org> | 2009-10-30 17:36:33 -0300 |
---|---|---|
committer | Hugo Lima <hugo.lima@openbossa.org> | 2009-10-30 18:08:20 -0200 |
commit | 9c6170b5a6ec1e84bc777f6f0aa09250b594d87d (patch) | |
tree | ed773496ef87a94e94b0c6e82596b814c4980091 /shibokengenerator.cpp | |
parent | f851bcd28974db9a3614145a4ced9f04e321d836 (diff) |
modified overload method decisor to create an instance of a value-type
when a method that expects a reference for the value-type receives
another type convertible to said value-type; the instance created is
given to a std::auto_ptr object to be deleted at the end of the scope
Reviewed by Hugo Parente Lima <hugo.lima@openbossa.org>
Diffstat (limited to 'shibokengenerator.cpp')
-rw-r--r-- | shibokengenerator.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/shibokengenerator.cpp b/shibokengenerator.cpp index 53dfa8d3d..05946e84a 100644 --- a/shibokengenerator.cpp +++ b/shibokengenerator.cpp @@ -167,6 +167,8 @@ QString ShibokenGenerator::translateTypeForWrapperMethod(const AbstractMetaType* result = cType->typeEntry()->qualifiedCppName(); if (cType->isObject() || cType->isQObject()) result.append('*'); + else if (cType->isValue() && cType->isReference()) + result.append('&'); } else if (cType->isArray()) { result = translateTypeForWrapperMethod(cType->arrayElementType(), context) + "[]"; } else { @@ -277,7 +279,8 @@ QString ShibokenGenerator::writeBaseConversion(QTextStream& s, const AbstractMet // Remove the constness, if any if (conversion.startsWith("const ") && type->name() != "char") conversion.remove(0, 6); - if (conversion.endsWith("&")) + + if (conversion.endsWith("&") && !(type->isValue() && type->isReference())) conversion.chop(1); s << "Shiboken::Converter<" << conversion << " >::"; |