[nautilus/gnome-2-32: 217/283] Cleanup non-existant folders on pathbar (bug #310205).



commit f5e20ba9e92d4931b7ddf555df8bd77550f16ee9
Author: Ted M Lin <tedmlin gmail com>
Date:   Wed Sep 2 19:13:26 2009 -0400

    Cleanup non-existant folders on pathbar (bug #310205).

 src/nautilus-pathbar.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/src/nautilus-pathbar.c b/src/nautilus-pathbar.c
index f7623e6..06db317 100644
--- a/src/nautilus-pathbar.c
+++ b/src/nautilus-pathbar.c
@@ -1508,7 +1508,7 @@ button_data_file_changed (NautilusFile *file,
 			  ButtonData *button_data)
 {
 	GFile *location, *current_location, *parent, *button_parent;
-	ButtonData *current_button_data;
+	ButtonData *current_button_data, *temp_button_data;
 	char *display_name;
 	NautilusPathBar *path_bar;
 	gboolean renamed, child;
@@ -1567,7 +1567,15 @@ button_data_file_changed (NautilusFile *file,
 			g_object_unref (current_location);
 			return;
 		}
-
+	} else if (nautilus_file_is_gone (file)) {
+		/* remove this and the following buttons */
+		g_assert (g_list_find (path_bar->button_list, button_data));
+		while ((temp_button_data = g_list_last (path_bar->button_list)->data) != button_data) {
+			gtk_container_remove (GTK_CONTAINER (path_bar), temp_button_data->button);
+		}
+		gtk_container_remove (GTK_CONTAINER (path_bar), button_data->button);
+		g_object_unref (location);
+		return;
 	}
 	g_object_unref (location);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]