aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-07-19 23:08:48 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-07-20 00:39:57 +0800
commit524a5dd1a87d82531fac0a8624ba11abd5a9b0b7 (patch)
tree4c3da1c702f91cbf024738acd4865dfce302dc47
parent7a05cf2cf74ceb5c5bb950f42475ab4ff3acba74 (diff)
downloadgsoc2013-evolution-524a5dd1a87d82531fac0a8624ba11abd5a9b0b7.tar.gz
gsoc2013-evolution-524a5dd1a87d82531fac0a8624ba11abd5a9b0b7.tar.zst
gsoc2013-evolution-524a5dd1a87d82531fac0a8624ba11abd5a9b0b7.zip
empe_text_plain_parse() cleanups.
Return type is a boolean, not an integer count.
-rw-r--r--em-format/e-mail-parser-text-plain.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/em-format/e-mail-parser-text-plain.c b/em-format/e-mail-parser-text-plain.c
index c6f4d1e628..a4550ea0fe 100644
--- a/em-format/e-mail-parser-text-plain.c
+++ b/em-format/e-mail-parser-text-plain.c
@@ -137,12 +137,12 @@ empe_text_plain_parse (EMailParserExtension *extension,
CamelMultipart *mp;
CamelDataWrapper *dw;
CamelContentType *type;
- gint i, count;
+ gint ii, count;
EMailInlineFilter *inline_filter;
gboolean charset_added = FALSE;
const gchar *snoop_type = NULL;
gboolean is_attachment;
- gint n_parts_added = 0;
+ gboolean handled = FALSE;
dw = camel_medium_get_content ((CamelMedium *) part);
if (!dw)
@@ -204,26 +204,27 @@ empe_text_plain_parse (EMailParserExtension *extension,
g_object_unref (inline_filter);
camel_content_type_unref (type);
- /* We handle our made-up multipart here, so we don't recursively call ourselves */
+ /* We handle our made-up multipart here,
+ * so we don't recursively call ourselves. */
+
count = camel_multipart_get_number (mp);
is_attachment = ((count == 1) && (e_mail_part_is_attachment (part)));
- for (i = 0; i < count; i++) {
- CamelMimePart *newpart = camel_multipart_get_part (mp, i);
-
- if (!newpart)
- continue;
+ for (ii = 0; ii < count; ii++) {
+ CamelMimePart *newpart = camel_multipart_get_part (mp, ii);
- n_parts_added += process_part (
- parser, part_id, i,
- newpart, is_attachment,
- cancellable, out_mail_parts);
+ if (newpart != NULL) {
+ handled |= process_part (
+ parser, part_id, ii,
+ newpart, is_attachment,
+ cancellable, out_mail_parts);
+ }
}
g_object_unref (mp);
- return n_parts_added;
+ return handled;
}
static void