[nautilus/gnome-2-32] pathbar: fix crasher when unmounting volumes (#627901)



commit 1dc416887bf1e88c4b49bd1ac2101e0fb8460af8
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Tue Nov 2 19:01:13 2010 +0100

    pathbar: fix crasher when unmounting volumes (#627901)

 src/nautilus-pathbar.c |   21 +++++++++++++--------
 1 files changed, 13 insertions(+), 8 deletions(-)
---
diff --git a/src/nautilus-pathbar.c b/src/nautilus-pathbar.c
index a9e7adc..24478b9 100644
--- a/src/nautilus-pathbar.c
+++ b/src/nautilus-pathbar.c
@@ -1571,14 +1571,19 @@ button_data_file_changed (NautilusFile *file,
 	} else if (nautilus_file_is_gone (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) {
-			for (idx = 0; idx <= position; idx++) {
-				gtk_container_remove (GTK_CONTAINER (path_bar),
-						      BUTTON_DATA (path_bar->button_list->data)->button);
+		/* if the current location is 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) {
+			/* 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) {
+				for (idx = 0; idx <= position; idx++) {
+					gtk_container_remove (GTK_CONTAINER (path_bar),
+							      BUTTON_DATA (path_bar->button_list->data)->button);
+				}
 			}
 		}
 



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