aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-05-19 22:02:29 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-05-20 01:07:21 +0800
commitca09edf8fa5f24cbc2a29989d8ba1dca5e004da2 (patch)
tree8bbdac133165d8c755300963362a54cb37a25079
parent875746e0ef57dc6f0592397d5ba9e561d8751c13 (diff)
downloadgsoc2013-evolution-ca09edf8fa5f24cbc2a29989d8ba1dca5e004da2.tar.gz
gsoc2013-evolution-ca09edf8fa5f24cbc2a29989d8ba1dca5e004da2.tar.zst
gsoc2013-evolution-ca09edf8fa5f24cbc2a29989d8ba1dca5e004da2.zip
Add e_mail_part_get_is_attachment().
-rw-r--r--em-format/e-mail-formatter-print-headers.c2
-rw-r--r--em-format/e-mail-formatter-print.c2
-rw-r--r--em-format/e-mail-formatter-quote.c2
-rw-r--r--em-format/e-mail-parser-multipart-digest.c2
-rw-r--r--em-format/e-mail-parser-multipart-mixed.c4
-rw-r--r--em-format/e-mail-parser.c4
-rw-r--r--em-format/e-mail-part.c8
-rw-r--r--em-format/e-mail-part.h1
-rw-r--r--mail/em-utils.c4
9 files changed, 19 insertions, 10 deletions
diff --git a/em-format/e-mail-formatter-print-headers.c b/em-format/e-mail-formatter-print-headers.c
index 65515508a5..591c28ee80 100644
--- a/em-format/e-mail-formatter-print-headers.c
+++ b/em-format/e-mail-formatter-print-headers.c
@@ -187,7 +187,7 @@ emfpe_headers_format (EMailFormatterExtension *extension,
if (!e_mail_part_id_has_prefix (mail_part, part_id_prefix))
continue;
- if (!mail_part->is_attachment)
+ if (!e_mail_part_get_is_attachment (mail_part))
continue;
if (mail_part->is_hidden)
diff --git a/em-format/e-mail-formatter-print.c b/em-format/e-mail-formatter-print.c
index d193c062d8..70689df4a5 100644
--- a/em-format/e-mail-formatter-print.c
+++ b/em-format/e-mail-formatter-print.c
@@ -148,7 +148,7 @@ mail_formatter_print_run (EMailFormatter *formatter,
if (mime_type == NULL)
continue;
- if (part->is_attachment) {
+ if (e_mail_part_get_is_attachment (part)) {
if (e_mail_part_get_cid (part) != NULL)
continue;
diff --git a/em-format/e-mail-formatter-quote.c b/em-format/e-mail-formatter-quote.c
index 12978f6978..52d76ec599 100644
--- a/em-format/e-mail-formatter-quote.c
+++ b/em-format/e-mail-formatter-quote.c
@@ -119,7 +119,7 @@ mail_formatter_quote_run (EMailFormatter *formatter,
if (part->is_hidden)
continue;
- if (part->is_attachment)
+ if (e_mail_part_get_is_attachment (part))
continue;
mime_type = e_mail_part_get_mime_type (part);
diff --git a/em-format/e-mail-parser-multipart-digest.c b/em-format/e-mail-parser-multipart-digest.c
index 8cf80be00f..ef1090848c 100644
--- a/em-format/e-mail-parser-multipart-digest.c
+++ b/em-format/e-mail-parser-multipart-digest.c
@@ -98,7 +98,7 @@ empe_mp_digest_parse (EMailParserExtension *extension,
wrap_as_attachment =
(mail_part != NULL) &&
- !mail_part->is_attachment;
+ !e_mail_part_get_is_attachment (mail_part);
/* Force the message to be collapsable */
if (wrap_as_attachment)
diff --git a/em-format/e-mail-parser-multipart-mixed.c b/em-format/e-mail-parser-multipart-mixed.c
index 410d78bdeb..6fb9ca787f 100644
--- a/em-format/e-mail-parser-multipart-mixed.c
+++ b/em-format/e-mail-parser-multipart-mixed.c
@@ -89,7 +89,7 @@ empe_mp_mixed_parse (EMailParserExtension *extension,
* not multipart/related. */
if (mail_part != NULL &&
e_mail_part_get_cid (mail_part) != NULL &&
- (!mail_part->is_attachment ||
+ (!e_mail_part_get_is_attachment (mail_part) ||
mail_part->is_hidden)) {
e_mail_parser_wrap_as_attachment (
@@ -99,7 +99,7 @@ empe_mp_mixed_parse (EMailParserExtension *extension,
} else if (mail_part == NULL ||
(camel_content_type_is (ct, "message", "rfc822") &&
mail_part != NULL &&
- !mail_part->is_attachment)) {
+ !e_mail_part_get_is_attachment (mail_part))) {
e_mail_parser_wrap_as_attachment (
parser, subpart, part_id, &work_queue);
diff --git a/em-format/e-mail-parser.c b/em-format/e-mail-parser.c
index 46eec598f2..75ec0e5f8c 100644
--- a/em-format/e-mail-parser.c
+++ b/em-format/e-mail-parser.c
@@ -367,7 +367,7 @@ e_mail_parser_parse_sync (EMailParser *parser,
e_mail_part_get_cid (part),
e_mail_part_get_mime_type (part),
part->is_hidden ? 1 : 0,
- part->is_attachment ? 1 : 0);
+ e_mail_part_get_is_attachment (part) ? 1 : 0);
e_mail_part_unref (part);
}
@@ -471,7 +471,7 @@ e_mail_parser_parse_finish (EMailParser *parser,
e_mail_part_get_cid (part),
e_mail_part_get_mime_type (part),
part->is_hidden ? 1 : 0,
- part->is_attachment ? 1 : 0);
+ e_mail_part_get_is_attachment (part) ? 1 : 0);
e_mail_part_unref (part);
}
diff --git a/em-format/e-mail-part.c b/em-format/e-mail-part.c
index 07b606361d..6c1ee969f5 100644
--- a/em-format/e-mail-part.c
+++ b/em-format/e-mail-part.c
@@ -267,6 +267,14 @@ e_mail_part_set_mime_type (EMailPart *part,
part->mime_type = g_strdup (mime_type);
}
+gboolean
+e_mail_part_get_is_attachment (EMailPart *part)
+{
+ g_return_val_if_fail (part != NULL, FALSE);
+
+ return part->is_attachment;
+}
+
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 f4a1bcdf53..e4a83753a9 100644
--- a/em-format/e-mail-part.h
+++ b/em-format/e-mail-part.h
@@ -109,6 +109,7 @@ CamelMimePart * e_mail_part_ref_mime_part (EMailPart *part);
const gchar * e_mail_part_get_mime_type (EMailPart *part);
void e_mail_part_set_mime_type (EMailPart *part,
const gchar *mime_type);
+gboolean e_mail_part_get_is_attachment (EMailPart *part);
void e_mail_part_update_validity (EMailPart *part,
CamelCipherValidity *validity,
guint32 validity_type);
diff --git a/mail/em-utils.c b/mail/em-utils.c
index fa6e704369..07c943a4e9 100644
--- a/mail/em-utils.c
+++ b/mail/em-utils.c
@@ -1227,7 +1227,7 @@ is_only_text_part_in_this_level (GList *parts,
if (part->is_hidden)
continue;
- if (part->is_attachment)
+ if (e_mail_part_get_is_attachment (part))
continue;
mime_type = e_mail_part_get_mime_type (part);
@@ -1331,7 +1331,7 @@ em_utils_message_to_html (CamelSession *session,
* text part in the email, thus show it (and hide again later) */
if (part->is_hidden && !hidden_text_html_part &&
mime_type != NULL &&
- !part->is_attachment &&
+ !e_mail_part_get_is_attachment (part) &&
g_ascii_strcasecmp (mime_type, "text/html") == 0 &&
is_only_text_part_in_this_level (head, part)) {
part->is_hidden = FALSE;