aboutsummaryrefslogtreecommitdiffstats
path: root/shibokengenerator.cpp
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2009-10-27 13:39:04 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2009-10-27 13:39:04 -0300
commit0cd881dbf54fb964ba5d46ab842a98b6145387ab (patch)
tree8a574d7d9c185f24b3d8e3bc349e3c4542dc6be8 /shibokengenerator.cpp
parente09048c630c6c0f992178e36d5479f6da73e7970 (diff)
arguments whose types pointers to value-types are now converted as they
were common value-types, the pointer is extracted only at the time of the method call; this behavior is desired when an overloaded method has both cases to decide upon, and it is natural to convert for the common case
Diffstat (limited to 'shibokengenerator.cpp')
-rw-r--r--shibokengenerator.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/shibokengenerator.cpp b/shibokengenerator.cpp
index aabd12a21..c97a4f807 100644
--- a/shibokengenerator.cpp
+++ b/shibokengenerator.cpp
@@ -162,7 +162,7 @@ QString ShibokenGenerator::translateTypeForWrapperMethod(const AbstractMetaType*
{
QString result;
- if (cType->isValue() || cType->isObject()
+ if (cType->isValue() || cType->isValuePointer() || cType->isObject()
|| (cType->isReference() && !cType->isContainer())) {
result = cType->typeEntry()->qualifiedCppName();
if (cType->isObject() || cType->isQObject())
@@ -261,16 +261,13 @@ QString ShibokenGenerator::writeBaseConversion(QTextStream& s, const AbstractMet
typeName.remove(0, 6);
QString conversion = typeName;
- // If the type is a pointer to a Value Type,
- // remove the pointer symbol ('*')
- if (type->isValuePointer())
- conversion.chop(1);
- // And the constness, if any
+ // Remove the constness, if any
if (conversion.startsWith("const ") && type->name() != "char")
conversion.remove(0, 6);
if (conversion.endsWith("&"))
conversion.chop(1);
+
s << "Shiboken::Converter<" << conversion << " >::";
return typeName;
}
@@ -287,8 +284,6 @@ void ShibokenGenerator::writeToPythonConversion(QTextStream& s, const AbstractMe
void ShibokenGenerator::writeToCppConversion(QTextStream& s, const AbstractMetaType* type,
const AbstractMetaClass* context, QString argumentName)
{
- if (type->isValuePointer())
- s << '&';
writeBaseConversion(s, type, context);
s << "toCpp(" << argumentName << ')';
}