nautilus r14159 - in trunk: . libnautilus-private src/file-manager



Author: cneumair
Date: Tue May 13 12:49:14 2008
New Revision: 14159
URL: http://svn.gnome.org/viewvc/nautilus?rev=14159&view=rev

Log:
2008-05-13  Christian Neumair  <cneumair gnome org>

	* libnautilus-private/nautilus-file-operations.c
	(nautilus_file_operations_copy_move):
	Never move to "burn:///". Fixes #531750.

	* src/file-manager/fm-properties-window.c (real_destroy):
	Free permission_combos list.


Modified:
   trunk/ChangeLog
   trunk/libnautilus-private/nautilus-file-operations.c
   trunk/src/file-manager/fm-properties-window.c

Modified: trunk/libnautilus-private/nautilus-file-operations.c
==============================================================================
--- trunk/libnautilus-private/nautilus-file-operations.c	(original)
+++ trunk/libnautilus-private/nautilus-file-operations.c	Tue May 13 12:49:14 2008
@@ -4871,15 +4871,44 @@
 				    gpointer done_callback_data)
 {
 	GList *locations;
+	GList *p;
 	GFile *dest, *src_dir;
 	GtkWindow *parent_window;
-
+	gboolean target_is_mapping;
+	gboolean have_nonmapping_source;
+	char *file_scheme;
+	                        	
 	dest = NULL;
+	target_is_mapping = FALSE;
+	have_nonmapping_source = FALSE;
+                
 	if (target_dir) {
 		dest = g_file_new_for_uri (target_dir);
+		file_scheme = g_file_get_uri_scheme (dest);
+		if (strcmp (file_scheme, "burn") == 0) {
+			target_is_mapping = TRUE;
+                }
+		g_free (file_scheme);
 	}
 	locations = location_list_from_uri_list (item_uris);
-
+	
+	for (p = location_list_from_uri_list (item_uris); p != NULL; p = p->next) {
+		file_scheme = g_file_get_uri_scheme ((GFile *)p->data);
+                
+		if (strcmp (file_scheme, "burn") != 0) {
+			have_nonmapping_source = TRUE;
+		}
+                
+		g_free (file_scheme);
+	}
+	
+	if (target_is_mapping && have_nonmapping_source && copy_action == GDK_ACTION_MOVE) {
+		/* never move to "burn:///", but fall back to copy.
+		 * This is a workaround, because otherwise the source files would be removed.
+		 */
+		copy_action = GDK_ACTION_COPY;
+	}
+	
 	parent_window = NULL;
 	if (parent_view) {
 		parent_window = (GtkWindow *)gtk_widget_get_ancestor (parent_view, GTK_TYPE_WINDOW);

Modified: trunk/src/file-manager/fm-properties-window.c
==============================================================================
--- trunk/src/file-manager/fm-properties-window.c	(original)
+++ trunk/src/file-manager/fm-properties-window.c	Tue May 13 12:49:14 2008
@@ -5416,6 +5416,9 @@
 	g_list_free (window->details->permission_buttons);
 	window->details->permission_buttons = NULL;
 
+	g_list_free (window->details->permission_combos);
+	window->details->permission_combos = NULL;
+
 	if (window->details->initial_permissions) {
 		g_hash_table_destroy (window->details->initial_permissions);
 		window->details->initial_permissions = NULL;



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