GNOME Bugzilla – Bug 577862
FileFilter name not set
Last modified: 2015-03-08 13:12:33 UTC
Please describe the problem: I stumbled upon this issue when I was porting the PyGTK application LottaNZB (http://www.lottanzb.org/) from libglade to GtkBuilder. If a FileFilter is specified in a glade file, the name of the resulting object will not be set to what has been chosen in the glade file. Steps to reproduce: I attached a simple Python file that reproduces the problem. Actual results: get_name() returns None. Expected results: I expected the get_name() method of the FileFilter object to return "my_file_filter" instead of None. Does this happen every time? Positive. Other information: I'm not entirely sure if this is really a bug or intended behaviour. However, for me the bug was unlikely to be caused by the Python bindings, that's why I filed it agains GtkBuilder.
Created attachment 132015 [details] Simple demonstration of the issue
I guess creating GtkFileFilter objects with GtkBuilder is not very useful at the moment, since there is no way to set any of the filter attributes. To get that, we need to a make the name a regular property (it does not make sense to map it to the object id, btw, since it is supposed to be translated). Then we need to add some custom tag support for adding mime types, etc.
However, if we really want to support the building of GtkFileFilter we could easily solve the initial problem reported in this bug by just implement GtkBuildable->get_name for GtkFileFilter similar to what GtkAction does.