From 9a6f182c0d598d84f6c5b2f3c7725729931655f5 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Fri, 4 Mar 2011 13:56:49 +0100 Subject: Construct attachment bars for correct message part ids --- mail/em-format-html-display.c | 11 +++++++++-- 1 file 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, "", classid); + + g_free (classid); } static void -- cgit v1.2.3