]> Pileus Git - ~andy/gtk/commitdiff
Bug #514260 – Better filtering for "Recently Used" files
authorEmmanuele Bassi <ebassi@gnome.org>
Sat, 30 May 2009 11:43:28 +0000 (12:43 +0100)
committerEmmanuele Bassi <ebassi@gnome.org>
Thu, 30 Jul 2009 10:16:29 +0000 (11:16 +0100)
Instead of refiltering the recently used files we should rebuild
the list altogether when the current GtkFileFilter changes; this
allows us to keep showing the maximum amount of recently used
files.

Fixes bug:

  http://bugzilla.gnome.org/show_bug.cgi?id=514260

gtk/gtkfilechooserdefault.c

index ff4d1cfe97d2d2226602d3bb63882c14244090ac..365f4e07fe35ba282ef933d8dfa14dd1078359ed 100644 (file)
@@ -10430,11 +10430,15 @@ set_current_filter (GtkFileChooserDefault *impl,
       if (impl->browse_files_model)
        install_list_model_filter (impl);
 
-      if (impl->search_model_filter)
+      if (impl->operation_mode == OPERATION_MODE_SEARCH &&
+          impl->search_model_filter != NULL)
         gtk_tree_model_filter_refilter (impl->search_model_filter);
 
-      if (impl->recent_model_filter)
-        gtk_tree_model_filter_refilter (impl->recent_model_filter);
+      /* we want to have all the matching results, and not just a
+       * filter of the previous model
+       */
+      if (impl->operation_mode == OPERATION_MODE_RECENT)
+        recent_start_loading (impl);
 
       g_object_notify (G_OBJECT (impl), "filter");
     }