[nautilus] pathbar: walk the buttons in the right order



commit d433ee1280fd7fa821de5941db1c972124633c29
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Sat Aug 14 02:07:43 2010 +0200

    pathbar: walk the buttons in the right order
    
    When a file is gone, walk the button items in the right order, i.e. the
    reversed one, otherwise we end up removing the entire pathbar.

 src/nautilus-pathbar.c |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/src/nautilus-pathbar.c b/src/nautilus-pathbar.c
index 7b61c9f..8c9c5cd 100644
--- a/src/nautilus-pathbar.c
+++ b/src/nautilus-pathbar.c
@@ -1571,11 +1571,19 @@ button_data_file_changed (NautilusFile *file,
 		}
 	} 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) {
+		GList *children;
+
+		children = g_list_find (path_bar->button_list, button_data);
+
+		while (children != NULL) {
+			temp_button_data = children->data;
+
+			/* children are in reverse order */
+			children = children->prev;
+
 			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;
 	}



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