aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-display.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2003-03-08 02:43:38 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2003-03-08 02:43:38 +0800
commit36d9b4794e8e811b8f854d97dcc3f2dd946a7bf8 (patch)
tree28db673c91d96d6791eaa215cb84a0c4cbada35d /mail/mail-display.c
parentd17a298a0c70b8530376ddadf9b48270789c2e7c (diff)
downloadgsoc2013-evolution-36d9b4794e8e811b8f854d97dcc3f2dd946a7bf8.tar.gz
gsoc2013-evolution-36d9b4794e8e811b8f854d97dcc3f2dd946a7bf8.tar.zst
gsoc2013-evolution-36d9b4794e8e811b8f854d97dcc3f2dd946a7bf8.zip
If the part url is a text part, use
2003-03-07 Jeffrey Stedfast <fejj@ximian.com> * mail-display.c (on_url_requested): If the part url is a text part, use mail_format_data_wrapper_write_to_stream(). This should fix bug #39204. * mail-format.c (mail_format_data_wrapper_write_to_stream): Make public. svn path=/trunk/; revision=20219
Diffstat (limited to 'mail/mail-display.c')
-rw-r--r--mail/mail-display.c29
1 files changed, 12 insertions, 17 deletions
diff --git a/mail/mail-display.c b/mail/mail-display.c
index 0e18044f21..83387bde92 100644
--- a/mail/mail-display.c
+++ b/mail/mail-display.c
@@ -1026,8 +1026,7 @@ do_attachment_header (GtkHTML *html, GtkHTMLEmbedded *eb,
/* Drag & Drop */
drag_types[DND_TARGET_TYPE_PART_MIME_TYPE].target = header_content_type_simple (part->content_type);
- g_ascii_strdown (drag_types[DND_TARGET_TYPE_PART_MIME_TYPE].target,
- strlen (drag_types[DND_TARGET_TYPE_PART_MIME_TYPE].target));
+ camel_strdown (drag_types[DND_TARGET_TYPE_PART_MIME_TYPE].target);
gtk_drag_source_set (button, GDK_BUTTON1_MASK,
drag_types, num_drag_types,
@@ -1231,34 +1230,30 @@ on_url_requested (GtkHTML *html, const char *url, GtkHTMLStream *handle,
medium = g_hash_table_lookup (urls, url);
if (medium) {
CamelContentType *content_type;
- CamelDataWrapper *data;
+ CamelDataWrapper *wrapper;
+ CamelStream *html_stream;
g_return_if_fail (CAMEL_IS_MEDIUM (medium));
if (md->related)
g_hash_table_remove (md->related, medium);
- data = camel_medium_get_content_object (medium);
- if (!mail_content_loaded (data, md, FALSE, url, html, handle))
+ wrapper = camel_medium_get_content_object (medium);
+ if (!mail_content_loaded (wrapper, md, FALSE, url, html, handle))
return;
- content_type = camel_data_wrapper_get_mime_type_field (data);
+ content_type = camel_data_wrapper_get_mime_type_field (wrapper);
+
+ html_stream = mail_display_stream_new (html, handle);
if (header_content_type_is (content_type, "text", "*")) {
- ba = mail_format_get_data_wrapper_text (data, md);
- if (ba) {
- gtk_html_write (html, handle, ba->data, ba->len);
-
- g_byte_array_free (ba, TRUE);
- }
+ mail_format_data_wrapper_write_to_stream (wrapper, md, html_stream);
} else {
- CamelStream *html_stream;
-
- html_stream = mail_display_stream_new (html, handle);
- camel_data_wrapper_write_to_stream (data, html_stream);
- camel_object_unref (html_stream);
+ camel_data_wrapper_write_to_stream (wrapper, html_stream);
}
+ camel_object_unref (html_stream);
+
gtk_html_end (html, handle, GTK_HTML_STREAM_OK);
return;
}