From b375acb5643b75e65f2573f686f1ad5ad635726c Mon Sep 17 00:00:00 2001 From: Stefano Karapetsas Date: Thu, 5 Jan 2012 13:11:17 +0100 Subject: pathbar: fix crasher when unmounting volumes https://bugzilla.gnome.org/show_bug.cgi?id=627901 http://git.gnome.org/browse/nautilus/commit/?h=gnome-2-32&id=1dc416887bf1e88c4b49bd1ac2101e0fb8460af8 --- src/caja-pathbar.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'src/caja-pathbar.c') diff --git a/src/caja-pathbar.c b/src/caja-pathbar.c index 78c100e2..1e810c19 100644 --- a/src/caja-pathbar.c +++ b/src/caja-pathbar.c @@ -1765,16 +1765,22 @@ button_data_file_changed (CajaFile *file, { gint idx, position; - /* remove this and the following buttons */ - position = g_list_position (path_bar->button_list, - g_list_find (path_bar->button_list, button_data)); - - if (position != -1) + /* if the current location is gone, don't do anything, as the view + * will get the event too and call us back. + */ + if (caja_file_compare_location (file, current_button_data->file) != 0) { - for (idx = 0; idx <= position; idx++) + /* remove this and the following buttons */ + position = g_list_position (path_bar->button_list, + g_list_find (path_bar->button_list, button_data)); + + if (position != -1) { - gtk_container_remove (GTK_CONTAINER (path_bar), - BUTTON_DATA (path_bar->button_list->data)->button); + for (idx = 0; idx <= position; idx++) + { + gtk_container_remove (GTK_CONTAINER (path_bar), + BUTTON_DATA (path_bar->button_list->data)->button); + } } } -- cgit v1.2.1