r10939 chris_y - /trunk/netsurf/amiga/tree.c

netsurf at semichrome.net netsurf at semichrome.net
Wed Nov 3 21:00:07 GMT 2010


Author: chris_y
Date: Wed Nov  3 16:00:07 2010
New Revision: 10939

URL: http://source.netsurf-browser.org?rev=10939&view=rev
Log:
Show correct drag icons

Modified:
    trunk/netsurf/amiga/tree.c

Modified: trunk/netsurf/amiga/tree.c
URL: http://source.netsurf-browser.org/trunk/netsurf/amiga/tree.c?rev=10939&r1=10938&r2=10939&view=diff
==============================================================================
--- trunk/netsurf/amiga/tree.c (original)
+++ trunk/netsurf/amiga/tree.c Wed Nov  3 16:00:07 2010
@@ -49,6 +49,7 @@
 #include "desktop/cookies.h"
 #include "desktop/history_global_core.h"
 #include "desktop/hotlist.h"
+#include "desktop/tree_url_node.h"
 #include "amiga/sslcert.h"
 #include "amiga/drag.h" /* drag icon stuff */
 #include "amiga/theme.h" /* pointers */
@@ -235,6 +236,11 @@
 
 void ami_tree_drag_icon_show(struct treeview_window *twin)
 {
+	const char *type = "project";
+	const char *url;
+	struct url_data *data;
+	struct node *node = NULL;
+
 	if((tree_drag_status(twin->tree) == TREE_NO_DRAG) ||
 		(tree_drag_status(twin->tree) == TREE_SELECT_DRAG))
 		return;
@@ -242,15 +248,22 @@
 	if((twin->type == AMI_TREE_COOKIES) ||
 		(twin->type == AMI_TREE_SSLCERT)) return; /* No permissable drag operations */
 
-	if(tree_node_is_folder(
-		tree_get_selected_node(
-			tree_get_root(twin->tree))))
+	node = tree_get_selected_node(tree_get_root(twin->tree));
+
+	if(node && tree_node_is_folder(node))
 	{
 		ami_drag_icon_show(twin->win, "drawer");
 	}
 	else
 	{
-		ami_drag_icon_show(twin->win, "html");
+		if(node && (url = tree_url_node_get_url(node)))
+		{
+			if(data = urldb_get_url_data(url))
+			{
+				type = ami_content_type_to_file_type(data->type);
+			}
+		}
+		ami_drag_icon_show(twin->win, type);
 	}
 }
 




More information about the netsurf-commits mailing list