From 524a5dd1a87d82531fac0a8624ba11abd5a9b0b7 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 19 Jul 2013 11:08:48 -0400 Subject: empe_text_plain_parse() cleanups. Return type is a boolean, not an integer count. --- em-format/e-mail-parser-text-plain.c | 27 ++++++++++++++------------- 1 file 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 -- cgit v1.2.3