Check if we are still holding the model before updating it; removes a set

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
This commit is contained in:
Emmanuele Bassi 2007-08-23 10:48:28 +00:00 committed by Emmanuele Bassi
parent 31fc77fb1d
commit a35bd52a96
2 changed files with 27 additions and 6 deletions

View File

@ -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

View 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;