From 794e28d23963fd875c0ffcad9c902f67744393bb Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sun, 19 May 2013 10:24:41 -0400 Subject: Add e_mail_part_set_cid(). --- em-format/e-mail-parser-text-html.c | 4 +++- em-format/e-mail-part.c | 10 ++++++++++ em-format/e-mail-part.h | 2 ++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/em-format/e-mail-parser-text-html.c b/em-format/e-mail-parser-text-html.c index ae97858a11..b9a4653728 100644 --- a/em-format/e-mail-parser-text-html.c +++ b/em-format/e-mail-parser-text-html.c @@ -80,7 +80,7 @@ empe_text_html_parse (EMailParserExtension *extension, mail_part = e_mail_part_new (part, part_id->str); mail_part->mime_type = g_strdup ("text/html"); - mail_part->cid = cid; + e_mail_part_set_cid (mail_part, cid); g_string_truncate (part_id, len); g_queue_push_head (&work_queue, mail_part); @@ -91,6 +91,8 @@ empe_text_html_parse (EMailParserExtension *extension, e_queue_transfer (&work_queue, out_mail_parts); + g_free (cid); + return TRUE; } diff --git a/em-format/e-mail-part.c b/em-format/e-mail-part.c index 0f4550cae5..15bd309f05 100644 --- a/em-format/e-mail-part.c +++ b/em-format/e-mail-part.c @@ -191,6 +191,16 @@ e_mail_part_get_cid (EMailPart *part) return part->cid; } +void +e_mail_part_set_cid (EMailPart *part, + const gchar *cid) +{ + g_return_if_fail (part != NULL); + + g_free (part->cid); + part->cid = g_strdup (cid); +} + static EMailPartValidityPair * mail_part_find_validity_pair (EMailPart *part, guint32 validity_type) diff --git a/em-format/e-mail-part.h b/em-format/e-mail-part.h index 5c071613a0..e3e2e26aa5 100644 --- a/em-format/e-mail-part.h +++ b/em-format/e-mail-part.h @@ -97,6 +97,8 @@ gsize e_mail_part_get_instance_size (EMailPart *part); const gchar * e_mail_part_get_id (EMailPart *part); const gchar * e_mail_part_get_cid (EMailPart *part); +void e_mail_part_set_cid (EMailPart *part, + const gchar *cid); void e_mail_part_update_validity (EMailPart *part, CamelCipherValidity *validity, guint32 validity_type); -- cgit v1.2.3