GNOME Bugzilla – Bug 418219
GtkRecentChooser should apply filter before sorting and clamping the list
Last modified: 2007-03-15 10:48:40 UTC
at the moment, all the GtkRecentChooser implementations sort and clamp the recent files list they get from the GtkRecentManager and then apply the currently set filter. on IRC, paolo borelli pointed out that this is wrong, and at least the clamping should be done on the already filtered list, otherwise any filtered list will often be smaller than the required clamp limit (this seems to create a visual difference between the list of files in the menu and the one inside the toolbar, in gedit).
Created attachment 84572 [details] [review] patch fixing the problem this patch fixes this problem, by moving the filtering inside the private implementation of GtkRecentChooser::get_items shared by all the GtkRecentChooser widges. the filtering is done before sorting and clamping the list.
Makes sense, please commit to both branches if you want
fixed in trunk, testing in the stable branch. 2007-03-15 Emmanuele Bassi <ebassi@gnome.org> * gtk/gtkrecentchooserprivate.h: * gtk/gtkrecentchooserutils.c: Move filtering of the recent files list into the shared implementation; do the filtering before the sorting, so that we always clamp on the desired size. (#418219) * gtk/gtkrecentchoosermenu.c: Remove the filtering of the list, as it's already been done. * gtk/gtkrecentchooserdefault.c: Ditto; also remove the GtkTreeModelFilter: just reload the view if the sorting and filtering properties change. * gtk/testrecentchoosermenu.c: Exercise the limit property
now committed to the stable branch too, together with the clean ups attached to the bug #338843. 2007-03-15 Emmanuele Bassi <ebassi@gnome.org> Merge from trunk: * gtk/gtkrecentchooserprivate.h: * gtk/gtkrecentchooserutils.c: Share between the widgets the recent chooser function for getting the filtered, sorted and clamped list of recent files from the manager. (#418219) * gtk/gtkrecentchoosermenu.c: Use the newly defined _gtk_recent_chooser_get_items() function; remove some pointer indirections. * gtk/gtkrecentchooserdefault.c: Reload the items every time a property affecting the view is changed; move the objects unref and the source removal into the dispose function; use the newly defined _gtk_recent_chooser_get_items() function. (see #338843)