]> Pileus Git - ~andy/gtk/commitdiff
Check if we are still holding the model before updating it; removes a set
authorEmmanuele Bassi <ebassi@gnome.org>
Thu, 23 Aug 2007 10:48:28 +0000 (10:48 +0000)
committerEmmanuele Bassi <ebassi@src.gnome.org>
Thu, 23 Aug 2007 10:48:28 +0000 (10:48 +0000)
2007-08-23  Emmanuele Bassi  <ebassi@gnome.org>

* gtkfilechooserdefault.c:
(search_hit_get_info_cb), (recent_item_get_info_cb): Check if
we are still holding the model before updating it; removes a
set of critical warnings when switching to the browse mode from
a loading search or recent files list.

(recent_clear_model), (recent_sort_model),
(recent_idle_cleanup): When in recent files mode, set the
model for the files list view when we have completed the loading
of the recently used files list. This makes switching between
modes fast again and reduces the amount of redraws needed
to display the list. (#469214)

svn path=/trunk/; revision=18677

ChangeLog
gtk/gtkfilechooserdefault.c

index 300328bf5aad262ec8ffd5274266a99fed16d95f..7164e3b5a5f9b2da5f50cbbb54df49e9b547baa4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2007-08-23  Emmanuele Bassi  <ebassi@gnome.org>
+
+       * gtkfilechooserdefault.c:
+       (search_hit_get_info_cb), (recent_item_get_info_cb): Check if
+       we are still holding the model before updating it; removes a
+       set of critical warnings when switching to the browse mode from
+       a loading search or recent files list.
+
+       (recent_clear_model), (recent_sort_model),
+       (recent_idle_cleanup): When in recent files mode, set the
+       model for the files list view when we have completed the loading
+       of the recently used files list. This makes switching between
+       modes fast again and reduces the amount of redraws needed
+       to display the list. (#469214)
+
 2007-08-22  Emmanuele Bassi  <ebassi@gnome.org>
 
        * configure.in: Remove oc (Occitane) from LINGUAS and unbreak
index 2f8bce643a452896c59b0c7056dc4cd4dc7b839e..eb26f515a5169d8b6b4be6447c0fbee6ac14570d 100644 (file)
@@ -8728,6 +8728,9 @@ search_hit_get_info_cb (GtkFileSystemHandle *handle,
   char *display_name;
   struct SearchHitInsertRequest *request = data;
 
+  if (!request->impl->search_model)
+    goto out;
+
   path = gtk_tree_row_reference_get_path (request->row_ref);
   if (!path)
     goto out;
@@ -9440,6 +9443,9 @@ recent_clear_model (GtkFileChooserDefault *impl,
     return;
 
   model = GTK_TREE_MODEL (impl->recent_model);
+  
+  if (remove_from_treeview)
+    gtk_tree_view_set_model (GTK_TREE_VIEW (impl->browse_files_tree_view), NULL);
 
   if (gtk_tree_model_get_iter_first (model, &iter))
     {
@@ -9475,9 +9481,6 @@ recent_clear_model (GtkFileChooserDefault *impl,
 
   g_object_unref (impl->recent_model_sort);
   impl->recent_model_sort = NULL;
-
-  if (remove_from_treeview)
-    gtk_tree_view_set_model (GTK_TREE_VIEW (impl->browse_files_tree_view), NULL);
 }
 
 /* Stops any ongoing loading of the recent files list; does
@@ -9730,9 +9733,6 @@ recent_setup_model (GtkFileChooserDefault *impl)
   gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (impl->recent_model_sort),
                                         RECENT_MODEL_COL_INFO,
                                         GTK_SORT_DESCENDING);
-
-  gtk_tree_view_set_model (GTK_TREE_VIEW (impl->browse_files_tree_view),
-                           GTK_TREE_MODEL (impl->recent_model_sort));
 }
 
 typedef struct
@@ -9750,6 +9750,9 @@ recent_idle_cleanup (gpointer data)
   RecentLoadData *load_data = data;
   GtkFileChooserDefault *impl = load_data->impl;
 
+  gtk_tree_view_set_model (GTK_TREE_VIEW (impl->browse_files_tree_view),
+                           GTK_TREE_MODEL (impl->recent_model_sort));
+
   set_busy_cursor (impl, FALSE);
   
   impl->load_recent_id = 0;
@@ -9783,6 +9786,9 @@ recent_item_get_info_cb (GtkFileSystemHandle *handle,
   gboolean is_folder = FALSE;
   struct RecentItemInsertRequest *request = data;
 
+  if (!request->impl->recent_model)
+    goto out;
+
   path = gtk_tree_row_reference_get_path (request->row_ref);
   if (!path)
     goto out;