aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-format-html-display.c
diff options
context:
space:
mode:
authorChenthill Palanisamy <pchenthill@novell.com>2009-12-28 21:12:28 +0800
committerChenthill Palanisamy <pchenthill@novell.com>2009-12-28 21:14:09 +0800
commit6a72dacb7db51cd0f6b84e9aefd248677c0ff4e0 (patch)
tree8dc7acf0ca7bff50ece62f1c95db2493deb15a23 /mail/em-format-html-display.c
parent32bc83c91d575d7258252a9c532309e8e9015d84 (diff)
downloadgsoc2013-evolution-6a72dacb7db51cd0f6b84e9aefd248677c0ff4e0.tar
gsoc2013-evolution-6a72dacb7db51cd0f6b84e9aefd248677c0ff4e0.tar.gz
gsoc2013-evolution-6a72dacb7db51cd0f6b84e9aefd248677c0ff4e0.tar.bz2
gsoc2013-evolution-6a72dacb7db51cd0f6b84e9aefd248677c0ff4e0.tar.lz
gsoc2013-evolution-6a72dacb7db51cd0f6b84e9aefd248677c0ff4e0.tar.xz
gsoc2013-evolution-6a72dacb7db51cd0f6b84e9aefd248677c0ff4e0.tar.zst
gsoc2013-evolution-6a72dacb7db51cd0f6b84e9aefd248677c0ff4e0.zip
Bug 361145 - Evolution hangs when formatting message - fixes part of it.
Diffstat (limited to 'mail/em-format-html-display.c')
-rw-r--r--mail/em-format-html-display.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/mail/em-format-html-display.c b/mail/em-format-html-display.c
index c795929091..9228aec472 100644
--- a/mail/em-format-html-display.c
+++ b/mail/em-format-html-display.c
@@ -799,10 +799,24 @@ efhd_attachment_button(EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObje
EAttachment *attachment;
GtkWidget *widget;
gpointer parent;
+ EMFormat *emf = (EMFormat *) efh;
+ CamelMessageInfo *mi = NULL;
+ CamelMessageContentInfo *ci = NULL;
+ GFileInfo *fileinfo;
+ guint32 size;
/* FIXME: handle default shown case */
d(printf("adding attachment button/content\n"));
+ mi = camel_folder_summary_uid (emf->folder->summary, emf->uid);
+ ci = camel_folder_summary_guess_content_info (mi, ((CamelDataWrapper *)pobject->part)->mime_type);
+ if (ci) {
+ size = ci->size;
+ /* what if its not encoded in base64 ? is it a case to consider? */
+ if (ci->encoding && !g_ascii_strcasecmp (ci->encoding, "base64"))
+ size = size/1.37;
+ }
+
info = (struct _attach_puri *)em_format_find_puri((EMFormat *)efh, pobject->classid);
if (!info || info->forward) {
@@ -828,6 +842,11 @@ efhd_attachment_button(EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObje
e_attachment_load_async (
info->attachment, (GAsyncReadyCallback)
e_attachment_load_handle_error, parent);
+ if (size != 0) {
+ fileinfo = e_attachment_get_file_info (info->attachment);
+ g_file_info_set_size (fileinfo, size);
+ e_attachment_set_file_info (info->attachment, fileinfo);
+ }
widget = e_attachment_button_new (view);
e_attachment_button_set_attachment (