[PATCH] Move URIs representing other FS instead of coping them if source parent is target



From bug 61269 [1]:

"Nautilus treats drag and drop of NFS directories on the desktop as copy
instead of as a layout change."

Proposed patch attached.

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

-- 
Christian Neumair <chris gnome-de org>
Index: libnautilus-private/nautilus-dnd.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-dnd.c,v
retrieving revision 1.21
diff -u -p -r1.21 nautilus-dnd.c
--- libnautilus-private/nautilus-dnd.c	6 Jul 2005 12:18:27 -0000	1.21
+++ libnautilus-private/nautilus-dnd.c	20 Jul 2005 10:57:04 -0000
@@ -309,6 +310,7 @@ nautilus_drag_default_drop_action_for_ic
 	int *action)
 {
 	gboolean same_fs;
+	gboolean target_is_source_parent;
 	GnomeVFSURI *target_uri;
 	GnomeVFSURI *dropped_uri;
 	GdkDragAction actions;
@@ -379,14 +381,16 @@ nautilus_drag_default_drop_action_for_ic
 	/* Compare the first dropped uri with the target uri for same fs match. */
 	dropped_uri = gnome_vfs_uri_new (((NautilusDragSelectionItem *)items->data)->uri);
 	same_fs = TRUE;
+	target_is_source_parent = FALSE;
 
 	if (dropped_uri != NULL) {
 		gnome_vfs_check_same_fs_uris (dropped_uri, target_uri, &same_fs);
+		target_is_source_parent = gnome_vfs_uri_is_parent (target_uri, dropped_uri, FALSE);
 		gnome_vfs_uri_unref (dropped_uri);
 	}
 	gnome_vfs_uri_unref (target_uri);
 	
-	if (same_fs) {
+	if (same_fs || target_is_source_parent) {
 		if (actions & GDK_ACTION_MOVE) {
 			*action = GDK_ACTION_MOVE;
 		} else {

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil



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