diff options
author | Cosimo Cecchi <cosimoc@gnome.org> | 2010-12-28 16:51:10 +0100 |
---|---|---|
committer | Cosimo Cecchi <cosimoc@gnome.org> | 2010-12-28 16:53:33 +0100 |
commit | c3b54e662b52ca15d1dcbe68386b8fa82b12adc5 (patch) | |
tree | 083dcbf17e6c0ea4e67cc658c1740a67cb256931 | |
parent | c37922a67ab3a48a914bd1d13490af8e5ab133e3 (diff) | |
download | nautilus-c3b54e662b52ca15d1dcbe68386b8fa82b12adc5.tar.gz |
pathbar: remove buttons only if the gone file is below the current
This should fix once and for all the crashers when ejecting devices.
-rw-r--r-- | src/nautilus-pathbar.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/nautilus-pathbar.c b/src/nautilus-pathbar.c index 24478b90a..65a69ebe1 100644 --- a/src/nautilus-pathbar.c +++ b/src/nautilus-pathbar.c @@ -1571,10 +1571,12 @@ button_data_file_changed (NautilusFile *file, } else if (nautilus_file_is_gone (file)) { gint idx, position; - /* if the current location is gone, don't do anything, as the view + /* 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. */ - if (nautilus_file_compare_location (file, current_button_data->file) != 0) { + current_location = nautilus_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, g_list_find (path_bar->button_list, button_data)); @@ -1587,6 +1589,7 @@ button_data_file_changed (NautilusFile *file, } } + g_object_unref (current_location); g_object_unref (location); return; } |