GNOME Bugzilla – Bug 377435
capitals in catalog files translated to underscores
Last modified: 2006-12-08 20:15:46 UTC
Please describe the problem: When adding custom widgets to a catalog file and the widget name is like this: gtkmm__CustomObject_mywidget Then glade3 tries to get the GType with: gtkmm___custom_object_mywidget_get_type() Which is not correct. It should have tried: gtkmm__CustomObject_mywidget_get_type() Steps to reproduce: Actual results: Expected results: Does this happen every time? yes Other information:
So, this is a compilation error? Is there some code-generation step or is it looking for the function dynamically in the shared library? Sorry, when you mentioned it on the gtkmm-list, I thought you meant it was asking for the wrong GType name.
Yeah, glade does an evil trick to register widgets from plugins, it assumes that the FooBarBazClass - will have a function called foo_bar_baz_get_type() function to register the type. Note to self/bugfixer: The proper fix for this should probably be to allow the plugin to specify the name of the "_get_type()" function explicitly via the catalog (instead of the "name" property - since the actual name of the class will be introspectable from the newly registered class anyway).
Created attachment 77981 [details] [review] Fix for bug377435 2006-12-08 Jeff Westerinen <jeff.westerinen@palmsource.com> * doc/widgetclasses.sgml - changed the description of the "name" property of the glade-widget-class tag. * src/glade-utils.[ch] - changed glade_util_get_type_from_name() to being able to use the name arg directly as the "get type" function. * src/glade-widget-adaptor.c - changed glade_widget_adaptor_from_catalog() to now check for a "get-type-function" property. If one is found, it is used to get the widget type instead of "name" property. * src/glade.h - added the "get-type-function" property definition.
Thanks ! applied in cvs. Note: due to the significant changes since 3.0 that touch on this area of code, we are not planning to backport this fix to 3.0.