[PATCH] Change icon to "visiting" when list view is expanded



The attached patch fixes bug 317531 [1] and makes Nautilus display all
expanded folder nodes in the list view display with the "visiting"
modifier and ensures that the "accept" dnd modifier takes precedence
over the "visiting" modifier. We used to be inconsistent wrt the icon
view precedence.

[1] http://bugzilla.gnome.org/show_bug.cgi?id=317531

-- 
Christian Neumair <chris gnome-de org>
Index: src/file-manager/fm-list-model.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-list-model.c,v
retrieving revision 1.44
diff -u -p -r1.44 fm-list-model.c
--- src/file-manager/fm-list-model.c	6 Jul 2005 12:18:28 -0000	1.44
+++ src/file-manager/fm-list-model.c	29 Sep 2005 21:39:55 -0000
@@ -270,36 +270,44 @@ fm_list_model_get_value (GtkTreeModel *t
 		g_value_init (value, GDK_TYPE_PIXBUF);
 
 		if (file != NULL) {
+			GtkTreePath *file_path;
+
 			zoom_level = fm_list_model_get_zoom_level_from_column_id (column);
 			icon_size = nautilus_get_icon_size_for_zoom_level (zoom_level);
 
+			file_path = gtk_tree_model_get_path (tree_model, iter);
+
 			modifier = NULL;
+
+			if (nautilus_file_has_open_window (file)) {
+				modifier = "visiting";
+			}
+
 			if (model->details->drag_view != NULL) {
-				GtkTreePath *path_a, *path_b;
-				
+				GtkTreePath *drop_path;
+
+				if (gtk_tree_view_row_expanded (model->details->drag_view, file_path)) {
+					modifier = "visiting";
+				}
+
 				gtk_tree_view_get_drag_dest_row (model->details->drag_view,
-								 &path_a,
+								 &drop_path,
 								 NULL);
-				if (path_a != NULL) {
-					path_b = gtk_tree_model_get_path (tree_model, iter);
-
-					if (gtk_tree_path_compare (path_a, path_b) == 0) {
+				if (drop_path != NULL) {
+					if (gtk_tree_path_compare (file_path, drop_path) == 0) {
 						modifier = "accept";
 					}
-						
-					gtk_tree_path_free (path_a);
-					gtk_tree_path_free (path_b);
+
+					gtk_tree_path_free (drop_path);
 				}
 			}
-			
-			if (nautilus_file_has_open_window (file)) {
-				modifier = "visiting";
-			}
-			
+
 			icon = nautilus_icon_factory_get_pixbuf_for_file_force_size (file, modifier, icon_size);
 
 			g_value_set_object (value, icon);
 			g_object_unref (icon);
+
+			gtk_tree_path_free (file_path);
 		}
 		break;
 	case FM_LIST_MODEL_SMALLEST_EMBLEM_COLUMN:

Attachment: signature.asc
Description: This is a digitally signed message part



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