diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2013-05-18 23:24:40 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2013-05-20 01:07:20 +0800 |
commit | f19058ea7a002e8ebf8351c55a86d3bb17a46cbc (patch) | |
tree | 0fdbb2c62ba31e92094ef7da2956f7caedd4840d /mail | |
parent | 5ad0b6d8f7ee9244eb328b5951b98f8945e7b3cf (diff) | |
download | gsoc2013-evolution-f19058ea7a002e8ebf8351c55a86d3bb17a46cbc.tar gsoc2013-evolution-f19058ea7a002e8ebf8351c55a86d3bb17a46cbc.tar.gz gsoc2013-evolution-f19058ea7a002e8ebf8351c55a86d3bb17a46cbc.tar.bz2 gsoc2013-evolution-f19058ea7a002e8ebf8351c55a86d3bb17a46cbc.tar.lz gsoc2013-evolution-f19058ea7a002e8ebf8351c55a86d3bb17a46cbc.tar.xz gsoc2013-evolution-f19058ea7a002e8ebf8351c55a86d3bb17a46cbc.tar.zst gsoc2013-evolution-f19058ea7a002e8ebf8351c55a86d3bb17a46cbc.zip |
Add e_mail_part_ref_mime_part().
Diffstat (limited to 'mail')
-rw-r--r-- | mail/e-mail-display.c | 7 | ||||
-rw-r--r-- | mail/e-mail-request.c | 6 |
2 files changed, 11 insertions, 2 deletions
diff --git a/mail/e-mail-display.c b/mail/e-mail-display.c index c70e12ece2..3861fbbced 100644 --- a/mail/e-mail-display.c +++ b/mail/e-mail-display.c @@ -941,6 +941,7 @@ mail_display_plugin_widget_requested (WebKitWebView *web_view, e_attachment_button_set_expandable ( E_ATTACHMENT_BUTTON (widget), FALSE); } else { + CamelMimePart *mime_part; const CamelContentDisposition *disposition; e_attachment_button_set_expandable ( @@ -957,11 +958,13 @@ mail_display_plugin_widget_requested (WebKitWebView *web_view, G_CALLBACK (attachment_button_expanded), display); + mime_part = e_mail_part_ref_mime_part (part); + /* Automatically expand attachments that have inline * disposition or the EMailParts have specific * force_inline flag set. */ disposition = - camel_mime_part_get_content_disposition (part->part); + camel_mime_part_get_content_disposition (mime_part); if (!part->force_collapse && (part->force_inline || (g_strcmp0 (empa->snoop_mime_type, "message/rfc822") == 0) || @@ -977,6 +980,8 @@ mail_display_plugin_widget_requested (WebKitWebView *web_view, attachment_button_expanded ( G_OBJECT (widget), NULL, display); } + + g_object_unref (mime_part); } } diff --git a/mail/e-mail-request.c b/mail/e-mail-request.c index 69b9a13533..1c88b74e33 100644 --- a/mail/e-mail-request.c +++ b/mail/e-mail-request.c @@ -142,10 +142,12 @@ handle_mail_request (GSimpleAsyncResult *res, if (part != NULL) { if (context.mode == E_MAIL_FORMATTER_MODE_CID) { CamelDataWrapper *dw; + CamelMimePart *mime_part; CamelStream *raw_content; GByteArray *ba; - dw = camel_medium_get_content (CAMEL_MEDIUM (part->part)); + mime_part = e_mail_part_ref_mime_part (part); + dw = camel_medium_get_content (CAMEL_MEDIUM (mime_part)); g_return_if_fail (dw); raw_content = camel_stream_mem_new (); @@ -155,6 +157,8 @@ handle_mail_request (GSimpleAsyncResult *res, camel_stream_write (request->priv->output_stream, (gchar *) ba->data, ba->len, cancellable, NULL); g_object_unref (raw_content); + + g_object_unref (mime_part); } else { if (mime_type == NULL) mime_type = part->mime_type; |