aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-format.c
diff options
context:
space:
mode:
authorRadek Doulik <rodo@ximian.com>2001-09-06 06:13:05 +0800
committerRadek Doulik <rodo@src.gnome.org>2001-09-06 06:13:05 +0800
commit032096185501894e9e0060bccc758d26372061e2 (patch)
tree26550b84a76773f4cef17dd171e7cbc9ef208c4f /mail/mail-format.c
parentdc75cabd4d61dca6fc62dde17c790bf1cd70ba00 (diff)
downloadgsoc2013-evolution-032096185501894e9e0060bccc758d26372061e2.tar.gz
gsoc2013-evolution-032096185501894e9e0060bccc758d26372061e2.tar.zst
gsoc2013-evolution-032096185501894e9e0060bccc758d26372061e2.zip
This patch should avoid flashing when loading images into mail view, credits
go to Dan, Larry and me ;) (fixes ximian #6680) 2001-09-06 Radek Doulik <rodo@ximian.com> * everywhere updated for new mail_content_loaded definition (prototype) 2001-09-05 Radek Doulik <rodo@ximian.com> * mail-display.c (mail_display_redisplay): increase redisplay_counter (try_part_urls): new helper function (try_data_urls): ditto (load_content_loaded): if it has stream handle available and if it's still valid, it writes to this stream instead of redisplaying, uses try_part_urls and try_data_urls * mail-display.h: added redisplay_counter to MailDisplay, I use it in load_content_loaded to be sure that there wasn't any redisplay and that remembered handle is still valid * mail-display.c (on_url_requested): don't end stream with error if part is not loaded yet (on_url_requested): don't end stream in cases when we are going to load image using http (stream_write_or_redisplay_when_loaded): new helper function, which is extracted from mail_display_redisplay_when_loaded. it's extended to handle gtkhtml stream writting (mail_display_redisplay_when_loaded): use stream_write_or_redisplay_when_loaded (mail_display_stream_write_when_loaded): new function, uses stream_write_or_redisplay_when_loaded struct _load_content_msg: added handle, url and redisplay_counter fields * mail-format.c (mail_content_loaded): added redisplay, url and handle parameter for case when we are loading image content and want it write to stream instead of redisplaying svn path=/trunk/; revision=12633
Diffstat (limited to 'mail/mail-format.c')
-rw-r--r--mail/mail-format.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/mail/mail-format.c b/mail/mail-format.c
index aaf8ec84f6..27f4506ad6 100644
--- a/mail/mail-format.c
+++ b/mail/mail-format.c
@@ -676,7 +676,7 @@ format_mime_part (CamelMimePart *part, MailDisplay *md)
mesg = e_utf8_from_locale_string (_("Could not parse MIME message. Displaying as source."));
mail_error_write (md->html, md->stream, "%s", mesg);
g_free (mesg);
- if (mail_content_loaded (wrapper, md))
+ if (mail_content_loaded (wrapper, md, TRUE, NULL, NULL))
handle_text_plain (part, "text/plain", md);
return TRUE;
}
@@ -712,7 +712,7 @@ format_mime_part (CamelMimePart *part, MailDisplay *md)
attachment_header (part, mime_type, md);
if (handler && handler->builtin && inline_flags & I_DISPLAYED &&
- mail_content_loaded (wrapper, md))
+ mail_content_loaded (wrapper, md, TRUE, NULL, NULL))
output = (*handler->builtin) (part, mime_type, md);
else
output = TRUE;
@@ -990,13 +990,16 @@ load_offline_content (MailDisplay *md, gpointer data)
}
gboolean
-mail_content_loaded (CamelDataWrapper *wrapper, MailDisplay *md)
+mail_content_loaded (CamelDataWrapper *wrapper, MailDisplay *md, gboolean redisplay, const gchar *url, GtkHTMLStream *handle)
{
if (!camel_data_wrapper_is_offline (wrapper))
return TRUE;
camel_object_ref (CAMEL_OBJECT (wrapper));
- mail_display_redisplay_when_loaded (md, wrapper, load_offline_content, wrapper);
+ if (redisplay)
+ mail_display_redisplay_when_loaded (md, wrapper, load_offline_content, wrapper);
+ else
+ mail_display_stream_write_when_loaded (md, wrapper, url, load_offline_content, handle, wrapper);
return FALSE;
}