diff options
author | Stefano Karapetsas <[email protected]> | 2012-01-05 13:11:17 +0100 |
---|---|---|
committer | Stefano Karapetsas <[email protected]> | 2012-01-05 13:11:17 +0100 |
commit | b375acb5643b75e65f2573f686f1ad5ad635726c (patch) | |
tree | 374762ddd8fbe981b7d4dfa193f940028bce4ee0 /src/caja-pathbar.c | |
parent | 63a4ddb0bb1d98b54dd962831e4ca95365bc7123 (diff) | |
download | caja-b375acb5643b75e65f2573f686f1ad5ad635726c.tar.bz2 caja-b375acb5643b75e65f2573f686f1ad5ad635726c.tar.xz |
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
Diffstat (limited to 'src/caja-pathbar.c')
-rw-r--r-- | src/caja-pathbar.c | 22 |
1 files changed, 14 insertions, 8 deletions
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); + } } } |