From 3eb627ba99eaa210188acb5c367c8ffdf6aa0eca Mon Sep 17 00:00:00 2001 From: Antonio Xu Date: Mon, 4 Aug 2003 12:50:11 +0000 Subject: add the drop type of mozilla browser link to make composer support to 2003-08-04 Antonio Xu * e-msg-composer.c (drag_data_received): add the drop type of mozilla browser link to make composer support to handle mozilla DnD data. [#47131] svn path=/trunk/; revision=22077 --- composer/e-msg-composer.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'composer/e-msg-composer.c') diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index 101ffde01a..ce29cf35f1 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -122,12 +122,14 @@ static guint signals[LAST_SIGNAL] = { 0 }; enum { DND_TYPE_MESSAGE_RFC822, DND_TYPE_TEXT_URI_LIST, + DND_TYPE_NETSCAPE_URL, DND_TYPE_TEXT_VCARD, }; static GtkTargetEntry drop_types[] = { { "message/rfc822", 0, DND_TYPE_MESSAGE_RFC822 }, { "text/uri-list", 0, DND_TYPE_TEXT_URI_LIST }, + { "_NETSCAPE_URL", 0, DND_TYPE_NETSCAPE_URL }, { "text/x-vcard", 0, DND_TYPE_TEXT_VCARD }, }; @@ -2554,7 +2556,7 @@ drag_data_received (EMsgComposer *composer, GdkDragContext *context, int x, int y, GtkSelectionData *selection, guint info, guint time) { - char *tmp, *str, *filename, **urls; + char *tmp, *str, **urls; CamelMimePart *mime_part; CamelStream *stream; CamelURL *url; @@ -2572,6 +2574,7 @@ drag_data_received (EMsgComposer *composer, GdkDragContext *context, camel_object_unref (stream); break; case DND_TYPE_TEXT_URI_LIST: + case DND_TYPE_NETSCAPE_URL: d(printf ("dropping a text/uri-list\n")); tmp = g_strndup (selection->data, selection->length); urls = g_strsplit (tmp, "\n", 0); @@ -2589,16 +2592,13 @@ drag_data_received (EMsgComposer *composer, GdkDragContext *context, if (url == NULL) continue; - - filename = url->path; - url->path = NULL; + + if (!strcasecmp (url->protocol, "file")) + e_msg_composer_attachment_bar_attach + (E_MSG_COMPOSER_ATTACHMENT_BAR (composer->attachment_bar), + url->path); + camel_url_free (url); - - e_msg_composer_attachment_bar_attach - (E_MSG_COMPOSER_ATTACHMENT_BAR (composer->attachment_bar), - filename); - - g_free (filename); } } -- cgit v1.2.3