summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.lima@openbossa.org>2010-04-16 16:50:00 -0300
committerHugo Parente Lima <hugo.lima@openbossa.org>2010-04-22 19:45:25 -0300
commit3b2ea763f95723e33105accf7a3fd0535cb67f85 (patch)
treeb131bf4d6939272bf62bf9c20bb8fd1ece9c9d55
parent5c59d232ecd1c03f920a11cd899e0699fc70c96b (diff)
downloadshiboken-3b2ea763f95723e33105accf7a3fd0535cb67f85.tar.gz
shiboken-3b2ea763f95723e33105accf7a3fd0535cb67f85.tar.xz
shiboken-3b2ea763f95723e33105accf7a3fd0535cb67f85.zip
Use qualified class name when callign a method like self->ClassName::method().
This fix some problems compiling bindings for classes under C++ namespaces.
-rw-r--r--cppgenerator.cpp4
-rw-r--r--tests/libsample/samplenamespace.h10
-rw-r--r--tests/samplebinding/CMakeLists.txt1
-rw-r--r--tests/samplebinding/typesystem_sample.xml3
4 files changed, 15 insertions, 3 deletions
diff --git a/cppgenerator.cpp b/cppgenerator.cpp
index 4214c157..f06ecb12 100644
--- a/cppgenerator.cpp
+++ b/cppgenerator.cpp
@@ -1554,7 +1554,7 @@ void CppGenerator::writeMethodCall(QTextStream& s, const AbstractMetaFunction* f
if (!func->isStatic())
mc << CPP_SELF_VAR << "->";
if (!func->isAbstract())
- mc << func->ownerClass()->name() << "::";
+ mc << func->ownerClass()->qualifiedCppName() << "::";
mc << func->originalName();
#else
if (!func->isStatic()) {
@@ -1563,7 +1563,7 @@ void CppGenerator::writeMethodCall(QTextStream& s, const AbstractMetaFunction* f
mc << CPP_SELF_VAR << (func->isProtected() ? ")" : "") << "->";
}
if (!func->isAbstract())
- mc << (func->isProtected() ? wrapperName(func->ownerClass()) : func->ownerClass()->name()) << "::";
+ mc << (func->isProtected() ? wrapperName(func->ownerClass()) : func->ownerClass()->qualifiedCppName()) << "::";
mc << func->originalName() << (func->isProtected() ? "_protected" : "");
#endif
} else {
diff --git a/tests/libsample/samplenamespace.h b/tests/libsample/samplenamespace.h
index b3b3a822..ae1f58dd 100644
--- a/tests/libsample/samplenamespace.h
+++ b/tests/libsample/samplenamespace.h
@@ -77,13 +77,23 @@ public:
class OkThisIsRecursiveEnough
{
public:
+ ~OkThisIsRecursiveEnough() {}
enum NiceEnum {
NiceValue1, NiceValue2
};
+
+ int someMethod(SomeInnerClass*) { return 0; }
+ virtual OkThisIsRecursiveEnough* someVirtualMethod(OkThisIsRecursiveEnough* arg) { return arg; }
};
};
};
+class DerivedFromNamespace : public SomeClass::SomeInnerClass::OkThisIsRecursiveEnough
+{
+public:
+ virtual OkThisIsRecursiveEnough* someVirtualMethod(OkThisIsRecursiveEnough* arg) { return arg; }
+};
+
} // namespace SampleNamespace
#endif // SAMPLENAMESPACE_H
diff --git a/tests/samplebinding/CMakeLists.txt b/tests/samplebinding/CMakeLists.txt
index 36d3c4c0..a2f58f91 100644
--- a/tests/samplebinding/CMakeLists.txt
+++ b/tests/samplebinding/CMakeLists.txt
@@ -57,6 +57,7 @@ ${CMAKE_CURRENT_BINARY_DIR}/sample/samplenamespace_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/sample/samplenamespace_someclass_someinnerclass_okthisisrecursiveenough_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/sample/samplenamespace_someclass_someinnerclass_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/sample/samplenamespace_someclass_wrapper.cpp
+${CMAKE_CURRENT_BINARY_DIR}/sample/samplenamespace_derivedfromnamespace_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/sample/simplefile_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/sample/size_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/sample/sonofmderived1_wrapper.cpp
diff --git a/tests/samplebinding/typesystem_sample.xml b/tests/samplebinding/typesystem_sample.xml
index 85fc3e3d..0f532733 100644
--- a/tests/samplebinding/typesystem_sample.xml
+++ b/tests/samplebinding/typesystem_sample.xml
@@ -99,8 +99,9 @@
<value-type name="SampleNamespace::SomeClass" />
<value-type name="SampleNamespace::SomeClass::SomeInnerClass" />
- <value-type name="SampleNamespace::SomeClass::SomeInnerClass::OkThisIsRecursiveEnough" />
+ <object-type name="SampleNamespace::SomeClass::SomeInnerClass::OkThisIsRecursiveEnough" />
<enum-type name="SampleNamespace::SomeClass::SomeInnerClass::OkThisIsRecursiveEnough::NiceEnum" />
+ <object-type name="SampleNamespace::DerivedFromNamespace" />
<object-type name="Abstract">
<modify-function signature="id()" rename="id_"/>