summaryrefslogtreecommitdiff
path: root/src/nautilus-pathbar.c
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2012-08-31 20:53:06 -0400
committerCosimo Cecchi <cosimoc@gnome.org>2012-08-31 22:56:58 -0400
commit7643a28eb104bf66c511633bd1662d546f8d7bf7 (patch)
tree46f56a99a0a92514c0f3edaaf8e064901e651f04 /src/nautilus-pathbar.c
parent0a4aa51224790c275cf123a45a78d6afcb790fd2 (diff)
downloadnautilus-7643a28eb104bf66c511633bd1662d546f8d7bf7.tar.gz
pathbar: clear buttons directly when file is gone
Instead of having the code in nautilus-window-manage-views clear the pathbar, since it receives the same signal, handle it internally. This should make code more robust.
Diffstat (limited to 'src/nautilus-pathbar.c')
-rw-r--r--src/nautilus-pathbar.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/nautilus-pathbar.c b/src/nautilus-pathbar.c
index 29eaf2d9e..6b5fbf587 100644
--- a/src/nautilus-pathbar.c
+++ b/src/nautilus-pathbar.c
@@ -1223,7 +1223,7 @@ nautilus_path_bar_check_icon_theme (NautilusPathBar *path_bar)
}
/* Public functions and their helpers */
-void
+static void
nautilus_path_bar_clear_buttons (NautilusPathBar *path_bar)
{
while (path_bar->priv->button_list != NULL) {
@@ -1558,12 +1558,15 @@ button_data_file_changed (NautilusFile *file,
} else if (nautilus_file_is_gone (file)) {
gint idx, position;
- /* 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 the current or a parent location are gone, clear all the buttons,
+ * the view will set the new path.
*/
current_location = nautilus_file_get_location (current_button_data->file);
- if (g_file_has_prefix (location, current_location)) {
+ if (g_file_has_prefix (current_location, location) ||
+ g_file_equal (current_location, location)) {
+ nautilus_path_bar_clear_buttons (path_bar);
+ } else if (g_file_has_prefix (location, current_location)) {
/* remove this and the following buttons */
position = g_list_position (path_bar->priv->button_list,
g_list_find (path_bar->priv->button_list, button_data));