diff --git a/etg/mimetype.py b/etg/mimetype.py index cc15b2e0..cb84a8f8 100644 --- a/etg/mimetype.py +++ b/etg/mimetype.py @@ -146,11 +146,18 @@ def run(): #----------------------------------------------------------------- c = module.find('wxFileTypeInfo') - # Ignore the last two args for this ctor as the varargs is causing some - # trouble. TODO: Figure this out... + # Ignore the variadic nature of this ctor ctor = c.find('wxFileTypeInfo').findOverload('extension') ctor.items[-1].ignore() - ctor.items[-2].ignore() + ctor.setCppCode("""\ + wxFileTypeInfo* fti = new wxFileTypeInfo(*mimeType); + fti->SetOpenCommand(*openCmd); + fti->SetPrintCommand(*printCmd); + fti->SetDescription(*description); + fti->AddExtension(*extension); + return fti; + """) + ctor.useDerivedName = False #----------------------------------------------------------------- diff --git a/etgtools/extractors.py b/etgtools/extractors.py index 059d97a9..229c2033 100644 --- a/etgtools/extractors.py +++ b/etgtools/extractors.py @@ -1104,6 +1104,7 @@ class CppMethodDef(MethodDef): super(CppMethodDef, self).__init__() self.type = type self.name = name + self.useDerivedName = True self.argsString = argsString self.body = body self.briefDoc = doc diff --git a/unittests/test_mimetype.py b/unittests/test_mimetype.py index 35b1f616..527704d4 100644 --- a/unittests/test_mimetype.py +++ b/unittests/test_mimetype.py @@ -19,8 +19,7 @@ class mimetype_Tests(wtc.WidgetTestCase): ft.GetIcon() def test_mimetype3(self): - fti = wx.FileTypeInfo('mime', 'open', 'print', 'desc') - fti.AddExtension('ext1') + fti = wx.FileTypeInfo('mime', 'open', 'print', 'desc', 'ext1') fti.AddExtension('ext2') fti.AddExtension('ext3') self.assertEqual(fti.GetMimeType(), 'mime')