Re: [PATCH] allow to drop URIs, URLs and text to subfolders



On Thu, 2006-06-22 at 22:17 +0200, Christian Neumair wrote:
> The attached patch considers subfolders as drop targets for non-GNOME
> Icon List drag data that refers to files.

-		                nautilus_marshal_VOID__STRING_ENUM_INT_INT,
-		                G_TYPE_NONE, 4,
+		                nautilus_marshal_VOID__STRING_STRING_ENUM_INT_INT,
+		                G_TYPE_NONE, 5,
+				G_TYPE_STRING,
This changes signal marhsaller types, but not the method definition in
nautilus-icon-container.h.

@@ -4782,7 +4790,8 @@ extension_action_callback_data_free (Ext
 {
 	g_object_unref (data->item);
 	nautilus_file_list_free (data->selection);
-	
+	g_object_unref (data->view);
+
 	g_free (data);
 }
 
@@ -4826,6 +4835,12 @@ extension_action_slow_mime_types_ready_c
 	g_free (item_name);
 
 	if (is_valid) {
+		char *display;
+
+		display = gdk_screen_make_display_name (gtk_widget_get_screen
(GTK_WIDGET (data->view)));
+		g_setenv ("DISPLAY", display, TRUE);
+		g_free (display);
+
 		nautilus_menu_item_activate (data->item);
 	}
 
@@ -4890,7 +4905,7 @@ add_extension_action_for_files (FMDirect
 
 	data = g_new0 (ExtensionActionCallbackData, 1);
 	data->item = g_object_ref (item);
-	data->view = view;
+	data->view = g_object_ref (view);
 	data->selection = nautilus_file_list_copy (files);
 	data->action = action;
 
This is something else. If a menu plugin really needs that they can do
it themselves, and anyway it shouldn't be done by changing
process-global environment vars, but by using gdk_spawn*.

 @@ -553,7 +553,8 @@ fm_icon_view_add_file (FMDirectoryView *
 
 	if (nautilus_icon_container_add (icon_container,
 					 NAUTILUS_ICON_CONTAINER_ICON_DATA (file),
-					 file_has_lazy_position (view, file)))  {
+					 file_has_lazy_position (view, file),
+					 nautilus_icon_factory_can_thumbnail (file))) {
 		nautilus_file_ref (file);
 	}
 }

What is this? Its also referenced elsewhere in the patch. Could you
regenerate with only the required changes?

@@ -383,9 +385,27 @@ get_drop_action (NautilusTreeViewDragDes
 		return action;
 		
 	case NAUTILUS_ICON_DND_URL:
-		return nautilus_drag_default_drop_action_for_url (context);
+		drop_target = get_drop_target_uri_for_path (dest, path);
+
+		if (drop_target == NULL) {
+			return 0;
+		}
+
+		action = nautilus_drag_default_drop_action_for_url (context);
+
+		g_free (drop_target);
+
+		return action;
 		

Are these really right? Doesn't that block dropping on the background?

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's a superhumanly strong native American paramedic on the run. She's a 
chain-smoking streetsmart nun with a birthmark shaped like Liberty's torch. 
They fight crime! 




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