aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-05-15 04:44:44 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-05-20 01:07:20 +0800
commitf6f11a1da2dfa2c7616cd18b36a44fefd66f0c75 (patch)
tree94091b064fd126c1e23a2ed019561b9842111a78 /mail
parent7d3ce25e9f3575560e331529edf55661eab92d2f (diff)
downloadgsoc2013-evolution-f6f11a1da2dfa2c7616cd18b36a44fefd66f0c75.tar
gsoc2013-evolution-f6f11a1da2dfa2c7616cd18b36a44fefd66f0c75.tar.gz
gsoc2013-evolution-f6f11a1da2dfa2c7616cd18b36a44fefd66f0c75.tar.bz2
gsoc2013-evolution-f6f11a1da2dfa2c7616cd18b36a44fefd66f0c75.tar.lz
gsoc2013-evolution-f6f11a1da2dfa2c7616cd18b36a44fefd66f0c75.tar.xz
gsoc2013-evolution-f6f11a1da2dfa2c7616cd18b36a44fefd66f0c75.tar.zst
gsoc2013-evolution-f6f11a1da2dfa2c7616cd18b36a44fefd66f0c75.zip
EMailPart: Store validity pairs in a GQueue.
Diffstat (limited to 'mail')
-rw-r--r--mail/e-mail-reader-utils.c22
-rw-r--r--mail/em-utils.c15
2 files changed, 19 insertions, 18 deletions
diff --git a/mail/e-mail-reader-utils.c b/mail/e-mail-reader-utils.c
index 9ef55e022e..f495c664a1 100644
--- a/mail/e-mail-reader-utils.c
+++ b/mail/e-mail-reader-utils.c
@@ -1393,20 +1393,20 @@ e_mail_reader_reply_to_message (EMailReader *reader,
while (!g_queue_is_empty (&queue)) {
EMailPart *part = g_queue_pop_head (&queue);
+ GList *head, *link;
- if (part->validities) {
- GSList *viter;
+ head = g_queue_peek_head_link (&part->validities);
- for (viter = part->validities; viter; viter = viter->next) {
- EMailPartValidityPair *vpair = viter->data;
+ for (link = head; link != NULL; link = g_list_next (link)) {
+ EMailPartValidityPair *vpair = link->data;
- if (vpair) {
- if ((vpair->validity_type & E_MAIL_PART_VALIDITY_PGP) != 0)
- validity_pgp_sum |= vpair->validity_type;
- if ((vpair->validity_type & E_MAIL_PART_VALIDITY_SMIME) != 0)
- validity_smime_sum |= vpair->validity_type;
- }
- }
+ if (vpair == NULL)
+ continue;
+
+ if ((vpair->validity_type & E_MAIL_PART_VALIDITY_PGP) != 0)
+ validity_pgp_sum |= vpair->validity_type;
+ if ((vpair->validity_type & E_MAIL_PART_VALIDITY_SMIME) != 0)
+ validity_smime_sum |= vpair->validity_type;
}
e_mail_part_unref (part);
diff --git a/mail/em-utils.c b/mail/em-utils.c
index 011b49b883..470020415c 100644
--- a/mail/em-utils.c
+++ b/mail/em-utils.c
@@ -1304,6 +1304,7 @@ em_utils_message_to_html (CamelSession *session,
for (link = head; link != NULL; link = g_list_next (link)) {
EMailPart *part = link->data;
+ GList *vhead, *vlink;
/* prefer-plain can hide HTML parts, even when it's the only
* text part in the email, thus show it (and hide again later) */
@@ -1315,15 +1316,15 @@ em_utils_message_to_html (CamelSession *session,
hidden_text_html_part = part;
}
- if (part->validities) {
- GSList *lst;
+ vhead = g_queue_peek_head_link (&part->validities);
- for (lst = part->validities; lst; lst = lst->next) {
- EMailPartValidityPair *pair = lst->data;
+ for (vlink = vhead; vlink != NULL; vlink = g_list_next (vlink)) {
+ EMailPartValidityPair *pair = vlink->data;
- if (pair)
- is_validity_found |= pair->validity_type;
- }
+ if (pair == NULL)
+ continue;
+
+ is_validity_found |= pair->validity_type;
}
}