After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 377435 - capitals in catalog files translated to underscores
capitals in catalog files translated to underscores
Status: RESOLVED FIXED
Product: glade
Classification: Applications
Component: general
3.0.x
Other All
: Normal normal
: ---
Assigned To: Glade 3 Maintainers
Glade 3 Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-11-20 16:39 UTC by Alexander Brinkman
Modified: 2006-12-08 20:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix for bug377435 (7.49 KB, patch)
2006-12-08 19:46 UTC, Jeff Westerinen
none Details | Review

Description Alexander Brinkman 2006-11-20 16:39:39 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:
Comment 1 Murray Cumming 2006-11-20 17:08:15 UTC
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.
Comment 2 Tristan Van Berkom 2006-11-20 17:45:35 UTC
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).
Comment 3 Jeff Westerinen 2006-12-08 19:46:51 UTC
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.
Comment 4 Tristan Van Berkom 2006-12-08 20:15:46 UTC
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.