aboutsummaryrefslogtreecommitdiffstats
path: root/mail
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
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')
-rw-r--r--mail/ChangeLog8
-rw-r--r--mail/mail-display.c29
-rw-r--r--mail/mail-format.c14
-rw-r--r--mail/mail-format.h4
4 files changed, 30 insertions, 25 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index c52e8a8240..10b6e6586b 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,11 @@
+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.
+
2003-03-06 Ettore Perazzoli <ettore@ximian.com>
* mail-accounts.c (mail_accounts_treeview_new): Set the
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;
}
diff --git a/mail/mail-format.c b/mail/mail-format.c
index cd83dd2c9b..20f3719de9 100644
--- a/mail/mail-format.c
+++ b/mail/mail-format.c
@@ -214,8 +214,7 @@ get_cid (CamelMimePart *part, MailDisplay *md)
* make a (syntactically invalid, unique) fake one.
*/
if (camel_mime_part_get_content_id (part)) {
- cid = g_strdup_printf ("cid:%s",
- camel_mime_part_get_content_id (part));
+ cid = g_strdup_printf ("cid:%s", camel_mime_part_get_content_id (part));
} else
cid = g_strdup_printf ("cid:@@@%d", fake_cid_counter++);
@@ -666,10 +665,10 @@ format_mime_part (CamelMimePart *part, MailDisplay *md,
MailDisplayStream *stream)
{
CamelDataWrapper *wrapper;
- char *mime_type, *tmp;
MailMimeHandler *handler;
gboolean output;
int inline_flags;
+ char *mime_type;
/* Record URLs associated with this part */
get_cid (part, md);
@@ -685,9 +684,8 @@ format_mime_part (CamelMimePart *part, MailDisplay *md,
return TRUE;
}
- tmp = camel_data_wrapper_get_mime_type (wrapper);
- mime_type = g_ascii_strdown (tmp, strlen (tmp));
- g_free (tmp);
+ mime_type = camel_data_wrapper_get_mime_type (wrapper);
+ camel_strdown (mime_type);
handler = mail_lookup_handler (mime_type);
if (!handler) {
@@ -1090,7 +1088,7 @@ mail_content_loaded (CamelDataWrapper *wrapper, MailDisplay *md, gboolean redisp
}
-static ssize_t
+ssize_t
mail_format_data_wrapper_write_to_stream (CamelDataWrapper *wrapper, MailDisplay *mail_display, CamelStream *stream)
{
CamelStreamFilter *filtered_stream;
@@ -1625,7 +1623,7 @@ find_preferred_alternative (CamelMultipart *multipart, gboolean want_plain)
CamelContentType *type = camel_mime_part_get_content_type (part);
char *mime_type = header_content_type_simple (type);
- g_ascii_strdown (mime_type, -1);
+ camel_strdown (mime_type);
if (want_plain && !strcmp (mime_type, "text/plain"))
return part;
handler = mail_lookup_handler (mime_type);
diff --git a/mail/mail-format.h b/mail/mail-format.h
index a7f7ad423c..fffae641ba 100644
--- a/mail/mail-format.h
+++ b/mail/mail-format.h
@@ -33,6 +33,10 @@
GByteArray *mail_format_get_data_wrapper_text (CamelDataWrapper *data,
MailDisplay *mail_display);
+ssize_t mail_format_data_wrapper_write_to_stream (CamelDataWrapper *wrapper,
+ MailDisplay *mail_display,
+ CamelStream *stream);
+
void mail_format_mime_message (CamelMimeMessage *mime_message,
MailDisplay *md, MailDisplayStream *stream);
void mail_format_raw_message (CamelMimeMessage *mime_message,