From ed06682bcd7a122b3b4ada110c152ccb3bbd0208 Mon Sep 17 00:00:00 2001 From: Stefano Karapetsas Date: Thu, 5 Jan 2012 13:24:04 +0100 Subject: pathbar: remove buttons only if the gone file is below the current This should fix once and for all the crashers when ejecting devices Patch by Cosimo Cecchi http://git.gnome.org/browse/nautilus/commit/?h=gnome-2-32&id=c3b54e662b52ca15d1dcbe68386b8fa82b12adc5 --- src/caja-pathbar.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/caja-pathbar.c b/src/caja-pathbar.c index 1e810c19..5a431b1c 100644 --- a/src/caja-pathbar.c +++ b/src/caja-pathbar.c @@ -1765,10 +1765,12 @@ button_data_file_changed (CajaFile *file, { gint idx, position; - /* 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) + /* if the current or a parent location are gone, don't do anything, as the view + * will get the event too and call us back. + */ + current_location = caja_file_get_location (current_button_data->file); + + if (g_file_has_prefix (location, current_location)) { /* remove this and the following buttons */ position = g_list_position (path_bar->button_list, @@ -1784,6 +1786,7 @@ button_data_file_changed (CajaFile *file, } } + g_object_unref (current_location); g_object_unref (location); return; } -- cgit v1.2.1