GNOME Bugzilla – Bug 580321
FileChooserButton forgets file filters
Last modified: 2013-05-30 07:07:44 UTC
Please describe the problem: A file filer is set to a FileChooserButton. The first time the FileChooserButton is clicked, the filter is there and works. The second time, the filter is gone. This can be confirmed by the FileChooser.list_filters() method, or by the look of the FileChooser dialog. Expected behavior: The file filter is persistent. Observed behavior: The file filter disappears after the first activation of the FileChooserButton. Unknown if this is caused by the "button" or by the FileChooser. Attached: small demonstration example. Tested with Ubuntu 8.10 and python-gtk2 version 2.13.0ubuntu8. Steps to reproduce: Either run the python program at http://launchpadlibrarian.net/25995141/fcb.py or 1. Create a gtk.Window, a gtk.FileChooserButton and a gtk.FileFilter. 2. Add a pattern to the FileFilter. 3. Add the filter to the button, and the button to the Window. 4. Start gtk.main() 5. Click the button, which opens a dialog. 6. Observe the Filter being active 7. Select a file and click Open. 8. Click the Button again. 9. Observe that there is no filter; all files in the current directory are visible. Actual results: The file filter is active the first time the dialog is used, but not at later times. Expected results: The filter should be persistent. Does this happen every time? Yes. At least with my installation; Ubuntu 8.10, pygtk (python-gtk2) 2.13.0-0ubuntu8 Other information: See also bug report at: https://bugs.launchpad.net/ubuntu/+source/pygtk/+bug/367285
Created attachment 133359 [details] Demonstration of how file filters is not persistent.
Cannot reproduce here. This was most likely a GTK+ (not PyGTK) bug that was fixed at some point.
I have now tried in Ubuntu 9.04, with pygtk 2.14, on a different computer, and the problem remains.
Created attachment 133650 [details] [review] C program demonstrates how file filter is not persistent.
The bug demonstration program is now translated to C. (my first C program in many years). It fails in the same way as the Python version. Might still be a programmer error, but the Python program worked on a Solaris workstation. This C program failed on RedHat 4. I'm not sure about the gtk version. How can I find out? If this is a bug, I suppose it should be reported elsewhere. Where?
Can not reproduce using the test C program. Guessing this was fixed a while back as suggested in comment 2.