[evolution] Add e_mail_part_get_validity_flags().
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] Add e_mail_part_get_validity_flags().
- Date: Sun, 19 May 2013 17:07:31 +0000 (UTC)
commit 67227b428b5f730059ad9eefcc866fb4f4bf5e86
Author: Matthew Barnes <mbarnes redhat com>
Date: Sun May 19 12:31:19 2013 -0400
Add e_mail_part_get_validity_flags().
em-format/e-mail-part.c | 20 ++++++++++++++++++++
em-format/e-mail-part.h | 2 ++
mail/em-utils.c | 12 +-----------
3 files changed, 23 insertions(+), 11 deletions(-)
---
diff --git a/em-format/e-mail-part.c b/em-format/e-mail-part.c
index ba43e7e..2339e0e 100644
--- a/em-format/e-mail-part.c
+++ b/em-format/e-mail-part.c
@@ -371,3 +371,23 @@ e_mail_part_has_validity (EMailPart *part)
return !g_queue_is_empty (&part->validities);
}
+EMailPartValidityFlags
+e_mail_part_get_validity_flags (EMailPart *part)
+{
+ EMailPartValidityFlags flags = 0;
+ GList *head, *link;
+
+ g_return_val_if_fail (part != NULL, 0);
+
+ head = g_queue_peek_head_link (&part->validities);
+
+ for (link = head; link != NULL; link = g_list_next (link)) {
+ EMailPartValidityPair *pair = link->data;
+
+ if (pair != NULL)
+ flags |= pair->validity_type;
+ }
+
+ return flags;
+}
+
diff --git a/em-format/e-mail-part.h b/em-format/e-mail-part.h
index bcb4270..cb25cb3 100644
--- a/em-format/e-mail-part.h
+++ b/em-format/e-mail-part.h
@@ -119,6 +119,8 @@ CamelCipherValidity *
e_mail_part_get_validity (EMailPart *part,
guint32 validity_type);
gboolean e_mail_part_has_validity (EMailPart *part);
+EMailPartValidityFlags
+ e_mail_part_get_validity_flags (EMailPart *part);
G_END_DECLS
diff --git a/mail/em-utils.c b/mail/em-utils.c
index 07c943a..6a12e3c 100644
--- a/mail/em-utils.c
+++ b/mail/em-utils.c
@@ -1322,7 +1322,6 @@ em_utils_message_to_html (CamelSession *session,
for (link = head; link != NULL; link = g_list_next (link)) {
EMailPart *part = link->data;
- GList *vhead, *vlink;
const gchar *mime_type;
mime_type = e_mail_part_get_mime_type (part);
@@ -1338,16 +1337,7 @@ em_utils_message_to_html (CamelSession *session,
hidden_text_html_part = part;
}
- vhead = g_queue_peek_head_link (&part->validities);
-
- for (vlink = vhead; vlink != NULL; vlink = g_list_next (vlink)) {
- EMailPartValidityPair *pair = vlink->data;
-
- if (pair == NULL)
- continue;
-
- is_validity_found |= pair->validity_type;
- }
+ is_validity_found |= e_mail_part_get_validity_flags (part);
}
while (!g_queue_is_empty (&queue))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]