diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2013-05-18 22:36:20 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2013-05-20 01:07:20 +0800 |
commit | 366b731a169ac54a0407f5d85879c38ba463398a (patch) | |
tree | ca2eb31c03938a2dcac4ae39c058fc714864af5d | |
parent | 794e28d23963fd875c0ffcad9c902f67744393bb (diff) | |
download | gsoc2013-evolution-366b731a169ac54a0407f5d85879c38ba463398a.tar gsoc2013-evolution-366b731a169ac54a0407f5d85879c38ba463398a.tar.gz gsoc2013-evolution-366b731a169ac54a0407f5d85879c38ba463398a.tar.bz2 gsoc2013-evolution-366b731a169ac54a0407f5d85879c38ba463398a.tar.lz gsoc2013-evolution-366b731a169ac54a0407f5d85879c38ba463398a.tar.xz gsoc2013-evolution-366b731a169ac54a0407f5d85879c38ba463398a.tar.zst gsoc2013-evolution-366b731a169ac54a0407f5d85879c38ba463398a.zip |
Add e_mail_part_id_has_prefix().
-rw-r--r-- | em-format/e-mail-formatter-print-headers.c | 4 | ||||
-rw-r--r-- | em-format/e-mail-part.c | 10 | ||||
-rw-r--r-- | em-format/e-mail-part.h | 2 | ||||
-rw-r--r-- | mail/e-mail-display.c | 2 | ||||
-rw-r--r-- | modules/prefer-plain/e-mail-display-popup-prefer-plain.c | 2 |
5 files changed, 16 insertions, 4 deletions
diff --git a/em-format/e-mail-formatter-print-headers.c b/em-format/e-mail-formatter-print-headers.c index 2345b78b05..6eec667463 100644 --- a/em-format/e-mail-formatter-print-headers.c +++ b/em-format/e-mail-formatter-print-headers.c @@ -137,7 +137,7 @@ emfpe_headers_format (EMailFormatterExtension *extension, if (g_queue_is_empty (&mail_part->validities)) continue; - if (!g_str_has_prefix (mail_part->id, part_id_prefix)) + if (!e_mail_part_id_has_prefix (mail_part, part_id_prefix)) continue; if (e_mail_part_get_validity (mail_part, E_MAIL_PART_VALIDITY_PGP | E_MAIL_PART_VALIDITY_SIGNED)) { @@ -181,7 +181,7 @@ emfpe_headers_format (EMailFormatterExtension *extension, for (link = head; link != NULL; link = g_list_next (link)) { EMailPart *mail_part = E_MAIL_PART (link->data); - if (!g_str_has_prefix (mail_part->id, part_id_prefix)) + if (!e_mail_part_id_has_prefix (mail_part, part_id_prefix)) continue; if (!mail_part->is_attachment) diff --git a/em-format/e-mail-part.c b/em-format/e-mail-part.c index 15bd309f05..95e4929286 100644 --- a/em-format/e-mail-part.c +++ b/em-format/e-mail-part.c @@ -201,6 +201,16 @@ e_mail_part_set_cid (EMailPart *part, part->cid = g_strdup (cid); } +gboolean +e_mail_part_id_has_prefix (EMailPart *part, + const gchar *prefix) +{ + g_return_val_if_fail (part != NULL, FALSE); + g_return_val_if_fail (prefix != NULL, FALSE); + + return g_str_has_prefix (part->id, prefix); +} + 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 e3e2e26aa5..8a71d3be9f 100644 --- a/em-format/e-mail-part.h +++ b/em-format/e-mail-part.h @@ -99,6 +99,8 @@ 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); +gboolean e_mail_part_id_has_prefix (EMailPart *part, + const gchar *prefix); void e_mail_part_update_validity (EMailPart *part, CamelCipherValidity *validity, guint32 validity_type); diff --git a/mail/e-mail-display.c b/mail/e-mail-display.c index b899ca46fd..c70e12ece2 100644 --- a/mail/e-mail-display.c +++ b/mail/e-mail-display.c @@ -1206,7 +1206,7 @@ mail_parts_bind_dom (GObject *object, /* Iterate only the parts rendered in * the frame and all it's subparts. */ - if (!g_str_has_prefix (part->id, frame_name)) + if (!e_mail_part_id_has_prefix (part, frame_name)) break; part_id = e_mail_part_get_id (part); diff --git a/modules/prefer-plain/e-mail-display-popup-prefer-plain.c b/modules/prefer-plain/e-mail-display-popup-prefer-plain.c index 9b7de92f53..3935263700 100644 --- a/modules/prefer-plain/e-mail-display-popup-prefer-plain.c +++ b/modules/prefer-plain/e-mail-display-popup-prefer-plain.c @@ -314,7 +314,7 @@ mail_display_popup_prefer_plain_update_actions (EMailDisplayPopupExtension *exte for (link = head; link != NULL; link = g_list_next (link)) { EMailPart *p = link->data; - if (g_str_has_prefix (p->id, prefix) && + if (e_mail_part_id_has_prefix (p, prefix) && (strstr (p->id, "text_html") || strstr (p->id, "plain_text"))) { const gchar *p_id; |