aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2011-03-04 20:56:49 +0800
committerMilan Crha <mcrha@redhat.com>2011-03-04 20:56:49 +0800
commit9a6f182c0d598d84f6c5b2f3c7725729931655f5 (patch)
tree700086ec191d2106e961da9b0564f2298a983954
parent744f785a9c70b860a23c9d8982e755caf99c9b2c (diff)
downloadgsoc2013-evolution-9a6f182c0d598d84f6c5b2f3c7725729931655f5.tar
gsoc2013-evolution-9a6f182c0d598d84f6c5b2f3c7725729931655f5.tar.gz
gsoc2013-evolution-9a6f182c0d598d84f6c5b2f3c7725729931655f5.tar.bz2
gsoc2013-evolution-9a6f182c0d598d84f6c5b2f3c7725729931655f5.tar.lz
gsoc2013-evolution-9a6f182c0d598d84f6c5b2f3c7725729931655f5.tar.xz
gsoc2013-evolution-9a6f182c0d598d84f6c5b2f3c7725729931655f5.tar.zst
gsoc2013-evolution-9a6f182c0d598d84f6c5b2f3c7725729931655f5.zip
Construct attachment bars for correct message part ids
-rw-r--r--mail/em-format-html-display.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/mail/em-format-html-display.c b/mail/em-format-html-display.c
index 85aba9da71..9d4ff55897 100644
--- a/mail/em-format-html-display.c
+++ b/mail/em-format-html-display.c
@@ -992,12 +992,15 @@ efhd_add_bar (EMFormatHTML *efh,
if (!EM_IS_FORMAT_HTML_DISPLAY (efh))
return FALSE;
+ g_return_val_if_fail (pobject != NULL && pobject->classid != NULL, FALSE);
+ g_return_val_if_fail (g_str_has_prefix (pobject->classid, "attachment-bar:"), FALSE);
+
priv = EM_FORMAT_HTML_DISPLAY (efh)->priv;
widget = e_mail_attachment_bar_new ();
gtk_container_add (GTK_CONTAINER (eb), widget);
- g_hash_table_insert (priv->attachment_views, g_strdup (EM_FORMAT (efh)->current_message_part_id), widget);
+ g_hash_table_insert (priv->attachment_views, g_strdup (strchr (pobject->classid, ':') + 1), widget);
g_object_weak_ref (G_OBJECT (widget), efhd_attachment_view_gone_cb, efh);
gtk_widget_hide (widget);
@@ -1014,7 +1017,9 @@ efhd_message_add_bar (EMFormat *emf,
CamelMimePart *part,
const EMFormatHandler *info)
{
- const gchar *classid = "attachment-bar";
+ gchar *classid;
+
+ classid = g_strdup_printf ("attachment-bar:%s", emf->current_message_part_id);
/* XXX Apparently this installs the callback for -all-
* EMFormatHTML subclasses, not just this subclass.
@@ -1027,6 +1032,8 @@ efhd_message_add_bar (EMFormat *emf,
camel_stream_printf (
stream, "<td><object classid=\"%s\"></object></td>", classid);
+
+ g_free (classid);
}
static void