diff --git a/generator/shiboken/shibokengenerator.cpp b/generator/shiboken/shibokengenerator.cpp index 2ae213d..ba6c550 100644 --- a/generator/shiboken/shibokengenerator.cpp +++ b/generator/shiboken/shibokengenerator.cpp @@ -314,7 +314,7 @@ QString ShibokenGenerator::fullPythonFunctionName(const AbstractMetaFunction* fu QString ShibokenGenerator::protectedEnumSurrogateName(const AbstractMetaEnum* metaEnum) { - return metaEnum->fullName().replace(".", "_") + "_Surrogate"; + return metaEnum->fullName().replace(".", "_").replace("::", "_") + "_Surrogate"; } QString ShibokenGenerator::protectedFieldGetterName(const AbstractMetaField* field) diff --git a/tests/libsample/samplenamespace.h b/tests/libsample/samplenamespace.h index d75afd8..ed18951 100644 --- a/tests/libsample/samplenamespace.h +++ b/tests/libsample/samplenamespace.h @@ -107,10 +107,20 @@ class SomeClass inline int someMethod(SomeInnerClass*) { return 0; } virtual OkThisIsRecursiveEnough* someVirtualMethod(OkThisIsRecursiveEnough* arg) { return arg; } }; + protected: + enum ProtectedEnum { + ProtectedItem0, + ProtectedItem1 + }; }; struct SomeOtherInnerClass { std::list someInnerClasses; }; +protected: + enum ProtectedEnum { + ProtectedItem0, + ProtectedItem1 + }; }; class DerivedFromNamespace : public SomeClass::SomeInnerClass::OkThisIsRecursiveEnough diff --git a/tests/samplebinding/namespace_test.py b/tests/samplebinding/namespace_test.py index 310f64a..efee9d5 100644 --- a/tests/samplebinding/namespace_test.py +++ b/tests/samplebinding/namespace_test.py @@ -43,7 +43,9 @@ def testInvisibleNamespace(self): class TestClassesUnderNamespace(unittest.TestCase): def testIt(self): c1 = SampleNamespace.SomeClass() + e1 = SampleNamespace.SomeClass.ProtectedEnum() c2 = SampleNamespace.SomeClass.SomeInnerClass() + e2 = SampleNamespace.SomeClass.SomeInnerClass.ProtectedEnum() c3 = SampleNamespace.SomeClass.SomeInnerClass.OkThisIsRecursiveEnough() e3 = SampleNamespace.SomeClass.SomeInnerClass.OkThisIsRecursiveEnough.NiceEnum() @@ -53,6 +55,8 @@ def testFunctionAddedOnNamespace(self): def testTpNames(self): self.assertEquals(str(SampleNamespace.SomeClass), "<%s 'sample.SampleNamespace.SomeClass'>"%TYPE_STR) + self.assertEquals(str(SampleNamespace.SomeClass.ProtectedEnum), "<%s 'sample.SampleNamespace.SomeClass.ProtectedEnum'>"%TYPE_STR) + self.assertEquals(str(SampleNamespace.SomeClass.SomeInnerClass.ProtectedEnum), "<%s 'sample.SampleNamespace.SomeClass.SomeInnerClass.ProtectedEnum'>"%TYPE_STR) self.assertEquals(str(SampleNamespace.SomeClass.SomeInnerClass.OkThisIsRecursiveEnough), "<%s 'sample.SampleNamespace.SomeClass.SomeInnerClass.OkThisIsRecursiveEnough'>"%TYPE_STR) self.assertEquals(str(SampleNamespace.SomeClass.SomeInnerClass.OkThisIsRecursiveEnough.NiceEnum), "<%s 'sample.SampleNamespace.SomeClass.SomeInnerClass.OkThisIsRecursiveEnough.NiceEnum'>"%TYPE_STR) diff --git a/tests/samplebinding/typesystem_sample.xml b/tests/samplebinding/typesystem_sample.xml index f7c0645..6379dba 100644 --- a/tests/samplebinding/typesystem_sample.xml +++ b/tests/samplebinding/typesystem_sample.xml @@ -530,8 +530,10 @@ + +