nautilus r15163 - in trunk: . libnautilus-private



Author: alexl
Date: Mon Apr  6 08:31:28 2009
New Revision: 15163
URL: http://svn.gnome.org/viewvc/nautilus?rev=15163&view=rev

Log:
2009-04-06  Alexander Larsson  <alexl redhat com>

	* libnautilus-private/nautilus-dnd.c:
	(nautilus_drag_default_drop_action_for_icons):
	Fix regression in the default dnd type. We don't
	want to look recursively for the parent.
	See https://bugzilla.redhat.com/show_bug.cgi?id=456515
	for details.



Modified:
   trunk/ChangeLog
   trunk/libnautilus-private/nautilus-dnd.c

Modified: trunk/libnautilus-private/nautilus-dnd.c
==============================================================================
--- trunk/libnautilus-private/nautilus-dnd.c	(original)
+++ trunk/libnautilus-private/nautilus-dnd.c	Mon Apr  6 08:31:28 2009
@@ -437,7 +437,7 @@
 	gboolean target_is_source_parent;
 	gboolean source_deletable;
 	const char *dropped_uri;
-	GFile *target, *dropped;
+	GFile *target, *dropped, *dropped_directory;
 	GdkDragAction actions;
 	NautilusFile *dropped_file, *target_file;
 
@@ -519,7 +519,16 @@
 	
 	/* Compare the first dropped uri with the target uri for same fs match. */
 	dropped = g_file_new_for_uri (dropped_uri);
-	target_is_source_parent = g_file_has_prefix (dropped, target);
+	dropped_directory = g_file_get_parent (dropped);
+	target_is_source_parent = FALSE;
+	if (dropped_directory != NULL) {
+		/* If the dropped file is already in the same directory but
+		   is in another filesystem we still want to move, not copy
+		   as this is then just a move of a mountpoint to another
+		   position in the dir */
+		target_is_source_parent = g_file_equal (dropped_directory, target);
+		g_object_unref (dropped_directory);
+	}
 	source_deletable = source_is_deletable (dropped);
 
 	if ((same_fs && source_deletable) || target_is_source_parent ||



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