diff options
Diffstat (limited to 'em-format')
30 files changed, 373 insertions, 291 deletions
diff --git a/em-format/e-mail-extension-registry.c b/em-format/e-mail-extension-registry.c index 348228620c..3097d93212 100644 --- a/em-format/e-mail-extension-registry.c +++ b/em-format/e-mail-extension-registry.c @@ -129,8 +129,9 @@ e_mail_extension_registry_add_extension (EMailExtensionRegistry *reg, } if (camel_debug ("emformat:registry")) { - printf ("Added extension '%s' for type '%s'\n", - G_OBJECT_TYPE_NAME (extension), types[i]); + printf ( + "Added extension '%s' for type '%s'\n", + G_OBJECT_TYPE_NAME (extension), types[i]); } } } @@ -165,7 +166,8 @@ e_mail_extension_registry_remove_extension (EMailExtensionRegistry *reg, g_queue_remove (queue, extension); if (camel_debug ("emformat:registry")) { - printf ("Removed extension '%s' from type '%s'\n", + printf ( + "Removed extension '%s' from type '%s'\n", G_OBJECT_TYPE_NAME (extension), types[i]); } } diff --git a/em-format/e-mail-formatter-attachment-bar.c b/em-format/e-mail-formatter-attachment-bar.c index eea8962f84..83cb5cad8d 100644 --- a/em-format/e-mail-formatter-attachment-bar.c +++ b/em-format/e-mail-formatter-attachment-bar.c @@ -103,8 +103,9 @@ emfe_attachment_bar_get_widget (EMailFormatterExtension *extension, empab = (EMailPartAttachmentBar *) part; widget = e_attachment_bar_new (empab->store); g_object_set_data (G_OBJECT (empab->store), "attachment-bar", widget); - g_object_weak_ref (G_OBJECT (widget), - (GWeakNotify) unset_bar_from_store_data, empab->store); + g_object_weak_ref ( + G_OBJECT (widget), + (GWeakNotify) unset_bar_from_store_data, empab->store); return widget; } diff --git a/em-format/e-mail-formatter-attachment.c b/em-format/e-mail-formatter-attachment.c index e0e6b90fbe..ffe16347c0 100644 --- a/em-format/e-mail-formatter-attachment.c +++ b/em-format/e-mail-formatter-attachment.c @@ -190,10 +190,12 @@ emfe_attachment_format (EMailFormatterExtension *extension, description = e_attachment_get_description (attachment); if (description && *description) { - name = g_strdup_printf ("<h2>Attachment: %s (%s)</h2>\n", + name = g_strdup_printf ( + "<h2>Attachment: %s (%s)</h2>\n", description, g_file_info_get_display_name (fi)); } else { - name = g_strdup_printf ("<h2>Attachment: %s</h2>\n", + name = g_strdup_printf ( + "<h2>Attachment: %s</h2>\n", g_file_info_get_display_name (fi)); } diff --git a/em-format/e-mail-formatter-error.c b/em-format/e-mail-formatter-error.c index f99a5fb1e3..505f1dd10f 100644 --- a/em-format/e-mail-formatter-error.c +++ b/em-format/e-mail-formatter-error.c @@ -104,7 +104,8 @@ emfe_error_format (EMailFormatterExtension *extension, camel_stream_flush (filtered_stream, cancellable, NULL); g_object_unref (filtered_stream); - camel_stream_write_string (stream, + camel_stream_write_string ( + stream, "</td>\n" "</tr>\n" "</table>\n" diff --git a/em-format/e-mail-formatter-headers.c b/em-format/e-mail-formatter-headers.c index c1a9285f77..dde0e5a682 100644 --- a/em-format/e-mail-formatter-headers.c +++ b/em-format/e-mail-formatter-headers.c @@ -92,9 +92,10 @@ format_short_headers (EMailFormatter *formatter, evolution_imagesdir = g_filename_to_uri (EVOLUTION_IMAGESDIR, NULL, NULL); from = g_string_new (""); - g_string_append_printf (buffer, + g_string_append_printf ( + buffer, "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" " - "id=\"__evo-short-headers\" style=\"display: %s\">", + "id=\"__evo-short-headers\" style=\"display: %s\">", flags & E_MAIL_FORMATTER_HEADER_FLAG_COLLAPSED ? "block" : "none"); header = ((CamelMimePart *) part)->headers; @@ -269,9 +270,10 @@ format_full_headers (EMailFormatter *formatter, evolution_imagesdir = g_filename_to_uri (EVOLUTION_IMAGESDIR, NULL, NULL); - g_string_append_printf (buffer, + g_string_append_printf ( + buffer, "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" " - "id=\"__evo-full-headers\" style=\"display: %s\" width=\"100%%\">", + "id=\"__evo-full-headers\" style=\"display: %s\" width=\"100%%\">", flags & E_MAIL_FORMATTER_HEADER_FLAG_COLLAPSED ? "none" : "block"); header = ((CamelMimePart *) part)->headers; @@ -451,7 +453,8 @@ format_full_headers (EMailFormatter *formatter, only_local_photo = e_mail_formatter_get_only_local_photos (formatter); g_string_append (buffer, "<td align=\"right\" valign=\"top\">"); - g_string_append_printf (buffer, + g_string_append_printf ( + buffer, "<img src=\"mail://contact-photo?mailaddr=&only-local-photo=1\" " "data-mailaddr=\"%s\" %s id=\"__evo-contact-photo\"/>", name, only_local_photo ? "data-onlylocal=1" : ""); @@ -543,9 +546,10 @@ emfe_headers_format (EMailFormatterExtension *extension, E_MAIL_FORMATTER_COLOR_HEADER))); if (context->flags & E_MAIL_FORMATTER_HEADER_FLAG_COLLAPSABLE) { - g_string_append_printf (buffer, + g_string_append_printf ( + buffer, "<img src=\"evo-file://%s/%s\" class=\"navigable\" " - "id=\"__evo-collapse-headers-img\" />" + "id=\"__evo-collapse-headers-img\" />" "</td><td>", EVOLUTION_IMAGESDIR, (context->flags & E_MAIL_FORMATTER_HEADER_FLAG_COLLAPSED) ? diff --git a/em-format/e-mail-formatter-message-rfc822.c b/em-format/e-mail-formatter-message-rfc822.c index 9ec393cd0a..614efca6df 100644 --- a/em-format/e-mail-formatter-message-rfc822.c +++ b/em-format/e-mail-formatter-message-rfc822.c @@ -201,7 +201,8 @@ emfe_message_rfc822_format (EMailFormatterExtension *extension, p = iter->data; - uri = e_mail_part_build_uri (context->folder, context->message_uid, + uri = e_mail_part_build_uri ( + context->folder, context->message_uid, "part_id", G_TYPE_STRING, p->id, "mode", G_TYPE_INT, E_MAIL_FORMATTER_MODE_RAW, "headers_collapsable", G_TYPE_INT, 0, diff --git a/em-format/e-mail-formatter-print.c b/em-format/e-mail-formatter-print.c index 48c9706dd5..1ca3bbae7f 100644 --- a/em-format/e-mail-formatter-print.c +++ b/em-format/e-mail-formatter-print.c @@ -46,8 +46,9 @@ write_attachments_list (EMailFormatter *formatter, str = g_string_new ( "<table border=\"0\" cellspacing=\"5\" cellpadding=\"0\" " - "class=\"attachments-list\" >\n"); - g_string_append_printf (str, + "class=\"attachments-list\" >\n"); + g_string_append_printf ( + str, "<tr><th colspan=\"2\"><h1>%s</h1></td></tr>\n" "<tr><th>%s</th><th>%s</th></tr>\n", _("Attachments"), _("Name"), _("Size")); @@ -68,7 +69,8 @@ write_attachments_list (EMailFormatter *formatter, if (e_attachment_get_description (attachment) && *e_attachment_get_description (attachment)) { - name = g_strdup_printf ("%s (%s)", + name = g_strdup_printf ( + "%s (%s)", e_attachment_get_description (attachment), g_file_info_get_display_name (fi)); } else { @@ -77,7 +79,8 @@ write_attachments_list (EMailFormatter *formatter, size = g_format_size (g_file_info_get_size (fi)); - g_string_append_printf (str, "<tr><td>%s</td><td>%s</td></tr>\n", + g_string_append_printf ( + str, "<tr><td>%s</td><td>%s</td></tr>\n", name, size); g_free (name); @@ -101,12 +104,13 @@ mail_formatter_print_run (EMailFormatter *formatter, context->mode = E_MAIL_FORMATTER_MODE_PRINTING; - camel_stream_write_string (stream, + camel_stream_write_string ( + stream, "<!DOCTYPE HTML>\n<html>\n" "<head>\n<meta name=\"generator\" content=\"Evolution Mail Component\" />\n" "<title>Evolution Mail Display</title>\n" "<link type=\"text/css\" rel=\"stylesheet\" media=\"print\" " - "href=\"evo-file://" EVOLUTION_PRIVDATADIR "/theme/webview-print.css\" />\n" + "href=\"evo-file://" EVOLUTION_PRIVDATADIR "/theme/webview-print.css\" />\n" "</head>\n" "<body style=\"background: #FFF; color: #000;\">", cancellable, NULL); @@ -259,8 +263,9 @@ e_mail_formatter_print_get_type (void) NULL /* value_table */ }; - type = g_type_register_static (E_TYPE_MAIL_FORMATTER, - "EMailFormatterPrint", &type_info, 0); + type = g_type_register_static ( + E_TYPE_MAIL_FORMATTER, + "EMailFormatterPrint", &type_info, 0); } return type; diff --git a/em-format/e-mail-formatter-quote-attachment.c b/em-format/e-mail-formatter-quote-attachment.c index 655f676602..82f10239cb 100644 --- a/em-format/e-mail-formatter-quote-attachment.c +++ b/em-format/e-mail-formatter-quote-attachment.c @@ -90,30 +90,33 @@ emfqe_attachment_format (EMailFormatterExtension *extension, text_format_flags = e_mail_formatter_get_text_format_flags (formatter); - text = e_mail_part_describe (part->part, - empa ? empa->snoop_mime_type : part->mime_type); + text = e_mail_part_describe ( + part->part, + empa ? empa->snoop_mime_type : part->mime_type); html = camel_text_to_html ( - text, - text_format_flags & CAMEL_MIME_FILTER_TOHTML_CONVERT_URLS, - 0); + text, + text_format_flags & CAMEL_MIME_FILTER_TOHTML_CONVERT_URLS, + 0); camel_stream_write_string (stream, html, cancellable, NULL); camel_stream_write_string (stream, "<br>", cancellable, NULL); g_free (html); g_free (text); - camel_stream_write_string (stream, - "<!--+GtkHTML:<DATA class=\"ClueFlow\" " - "key=\"orig\" value=\"1\">-->\n" - "<blockquote type=cite>\n", cancellable, NULL); + camel_stream_write_string ( + stream, + "<!--+GtkHTML:<DATA class=\"ClueFlow\" " + "key=\"orig\" value=\"1\">-->\n" + "<blockquote type=cite>\n", cancellable, NULL); e_mail_formatter_format_as ( formatter, context, att_part, stream, NULL, cancellable); - camel_stream_write_string (stream, - "</blockquote><!--+GtkHTML:" - "<DATA class=\"ClueFlow\" clear=\"orig\">-->", - cancellable, NULL); + camel_stream_write_string ( + stream, + "</blockquote><!--+GtkHTML:" + "<DATA class=\"ClueFlow\" clear=\"orig\">-->", + cancellable, NULL); return TRUE; } diff --git a/em-format/e-mail-formatter-quote.c b/em-format/e-mail-formatter-quote.c index 71bfbcd6bb..2468a3110b 100644 --- a/em-format/e-mail-formatter-quote.c +++ b/em-format/e-mail-formatter-quote.c @@ -93,7 +93,8 @@ mail_formatter_quote_run (EMailFormatter *formatter, } if (qf->priv->flags & E_MAIL_FORMATTER_QUOTE_FLAG_CITE) { - camel_stream_write_string (stream, + camel_stream_write_string ( + stream, "<!--+GtkHTML:<DATA class=\"ClueFlow\" " "key=\"orig\" value=\"1\">-->\n" "<blockquote type=cite>\n", cancellable, NULL); @@ -215,8 +216,9 @@ e_mail_formatter_quote_get_type (void) NULL /* value_table */ }; - type = g_type_register_static (E_TYPE_MAIL_FORMATTER, - "EMailFormatterQuote", &type_info, 0); + type = g_type_register_static ( + E_TYPE_MAIL_FORMATTER, + "EMailFormatterQuote", &type_info, 0); } return type; diff --git a/em-format/e-mail-formatter-secure-button.c b/em-format/e-mail-formatter-secure-button.c index 755497a750..d95670cc9c 100644 --- a/em-format/e-mail-formatter-secure-button.c +++ b/em-format/e-mail-formatter-secure-button.c @@ -135,7 +135,8 @@ viewcert_clicked (GtkWidget *button, g_object_unref (ec); } else { - g_warning ("can't find certificate for %s <%s>", + g_warning ( + "can't find certificate for %s <%s>", info->name ? info->name : "", info->email ? info->email : ""); } @@ -289,19 +290,20 @@ secure_button_clicked_cb (GtkWidget *widget, gtk_text_buffer_set_text ( buffer, part->validity->sign.description, strlen (part->validity->sign.description)); - w = g_object_new (gtk_scrolled_window_get_type (), - "hscrollbar_policy", GTK_POLICY_AUTOMATIC, - "vscrollbar_policy", GTK_POLICY_AUTOMATIC, - "shadow_type", GTK_SHADOW_IN, - "expand", TRUE, - "child", g_object_new (gtk_text_view_get_type (), - "buffer", buffer, - "cursor_visible", FALSE, - "editable", FALSE, - "width_request", 500, - "height_request", 160, - NULL), - NULL); + w = g_object_new ( + gtk_scrolled_window_get_type (), + "hscrollbar_policy", GTK_POLICY_AUTOMATIC, + "vscrollbar_policy", GTK_POLICY_AUTOMATIC, + "shadow_type", GTK_SHADOW_IN, + "expand", TRUE, + "child", g_object_new (gtk_text_view_get_type (), + "buffer", buffer, + "cursor_visible", FALSE, + "editable", FALSE, + "width_request", 500, + "height_request", 160, + NULL), + NULL); g_object_unref (buffer); gtk_container_add (GTK_CONTAINER (grid), w); @@ -325,19 +327,20 @@ secure_button_clicked_cb (GtkWidget *widget, gtk_text_buffer_set_text ( buffer, part->validity->encrypt.description, strlen (part->validity->encrypt.description)); - w = g_object_new (gtk_scrolled_window_get_type (), - "hscrollbar_policy", GTK_POLICY_AUTOMATIC, - "vscrollbar_policy", GTK_POLICY_AUTOMATIC, - "shadow_type", GTK_SHADOW_IN, - "expand", TRUE, - "child", g_object_new (gtk_text_view_get_type (), - "buffer", buffer, - "cursor_visible", FALSE, - "editable", FALSE, - "width_request", 500, - "height_request", 160, - NULL), - NULL); + w = g_object_new ( + gtk_scrolled_window_get_type (), + "hscrollbar_policy", GTK_POLICY_AUTOMATIC, + "vscrollbar_policy", GTK_POLICY_AUTOMATIC, + "shadow_type", GTK_SHADOW_IN, + "expand", TRUE, + "child", g_object_new (gtk_text_view_get_type (), + "buffer", buffer, + "cursor_visible", FALSE, + "editable", FALSE, + "width_request", 500, + "height_request", 160, + NULL), + NULL); g_object_unref (buffer); gtk_container_add (GTK_CONTAINER (grid), w); @@ -403,7 +406,8 @@ emfe_secure_button_get_widget (EMailFormatterExtension *extension, box = gtk_event_box_new (); if (part->validity->sign.status != 0) - gtk_widget_override_background_color (box, GTK_STATE_FLAG_NORMAL, + gtk_widget_override_background_color ( + box, GTK_STATE_FLAG_NORMAL, &smime_sign_colour[part->validity->sign.status]); layout = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5); @@ -411,7 +415,8 @@ emfe_secure_button_get_widget (EMailFormatterExtension *extension, button = gtk_button_new (); gtk_box_pack_start (GTK_BOX (layout), button, FALSE, FALSE, 0); - g_signal_connect (button, "clicked", + g_signal_connect ( + button, "clicked", G_CALLBACK (secure_button_clicked_cb), part); widget = gtk_image_new_from_icon_name ( diff --git a/em-format/e-mail-formatter-source.c b/em-format/e-mail-formatter-source.c index 518c2af050..c9d4e17890 100644 --- a/em-format/e-mail-formatter-source.c +++ b/em-format/e-mail-formatter-source.c @@ -114,7 +114,8 @@ emfe_source_format (EMailFormatterExtension *extension, camel_stream_write_string ( stream, "<code class=\"pre\">", cancellable, NULL); - camel_data_wrapper_write_to_stream_sync (dw, filtered_stream, + camel_data_wrapper_write_to_stream_sync ( + dw, filtered_stream, cancellable, NULL); camel_stream_flush (filtered_stream, cancellable, NULL); g_object_unref (filtered_stream); diff --git a/em-format/e-mail-formatter-text-enriched.c b/em-format/e-mail-formatter-text-enriched.c index cd01b4d3e2..344d7a62a6 100644 --- a/em-format/e-mail-formatter-text-enriched.c +++ b/em-format/e-mail-formatter-text-enriched.c @@ -85,7 +85,8 @@ emfe_text_enriched_format (EMailFormatterExtension *extension, buffer = g_string_new (""); - g_string_append_printf (buffer, + g_string_append_printf ( + buffer, "<div class=\"part-container\" style=\"border-color: #%06x; " "background-color: #%06x; color: #%06x;\">" "<div class=\"part-container-inner-margin\">\n", diff --git a/em-format/e-mail-formatter-text-html.c b/em-format/e-mail-formatter-text-html.c index 5f493b2f4d..71c73f9266 100644 --- a/em-format/e-mail-formatter-text-html.c +++ b/em-format/e-mail-formatter-text-html.c @@ -264,7 +264,7 @@ emfe_text_html_format (EMailFormatterExtension *extension, } } - if (document_end ) { + if (document_end) { length = strlen (document_end); tag = string->str + string->len - 1; i = 0; diff --git a/em-format/e-mail-formatter-text-plain.c b/em-format/e-mail-formatter-text-plain.c index 5ef5ba3d1f..40b9358aa4 100644 --- a/em-format/e-mail-formatter-text-plain.c +++ b/em-format/e-mail-formatter-text-plain.c @@ -89,7 +89,8 @@ emfe_text_plain_format (EMailFormatterExtension *extension, g_free (header); /* No need for body margins within <iframe> */ - camel_stream_write_string (stream, + camel_stream_write_string ( + stream, "<style>body{ margin: 0; }</style>", cancellable, NULL); } @@ -137,8 +138,9 @@ emfe_text_plain_format (EMailFormatterExtension *extension, camel_stream_write_string (stream, "</div>\n", cancellable, NULL); if (context->mode == E_MAIL_FORMATTER_MODE_RAW) { - camel_stream_write_string (stream, "</body></html>", - cancellable, NULL); + camel_stream_write_string ( + stream, "</body></html>", + cancellable, NULL); } return TRUE; diff --git a/em-format/e-mail-formatter-utils.c b/em-format/e-mail-formatter-utils.c index 883d985510..7c01f323bb 100644 --- a/em-format/e-mail-formatter-utils.c +++ b/em-format/e-mail-formatter-utils.c @@ -58,7 +58,8 @@ e_mail_formatter_format_text_header (EMailFormatter *formatter, value++; if (!(flags & E_MAIL_FORMATTER_HEADER_FLAG_HTML)) - html = mhtml = camel_text_to_html (value, + html = mhtml = camel_text_to_html ( + value, e_mail_formatter_get_text_format_flags (formatter), 0); else html = value; @@ -90,7 +91,8 @@ e_mail_formatter_format_text_header (EMailFormatter *formatter, } } - g_string_append_printf (buffer, fmt, + g_string_append_printf ( + buffer, fmt, (flags & E_MAIL_FORMATTER_HEADER_FLAG_HIDDEN ? "none" : "table-row"), label, html); g_free (mhtml); @@ -186,12 +188,13 @@ e_mail_formatter_format_address (EMailFormatter *formatter, } if (id) { - g_string_append_printf (out, + g_string_append_printf ( + out, "<span id=\"__evo-moreaddr-%s\" " - "style=\"display: none;\">", id); + "style=\"display: none;\">", id); str = g_strdup_printf ( "<img src=\"evo-file://%s/plus.png\" " - "id=\"__evo-moreaddr-img-%s\" class=\"navigable\">", + "id=\"__evo-moreaddr-img-%s\" class=\"navigable\">", EVOLUTION_IMAGESDIR, id); } } @@ -209,7 +212,8 @@ e_mail_formatter_format_address (EMailFormatter *formatter, } if (id) { - g_string_append_printf (out, + g_string_append_printf ( + out, "</span>" "<span class=\"navigable\" " "id=\"__evo-moreaddr-ellipsis-%s\" " @@ -289,7 +293,8 @@ e_mail_formatter_format_header (EMailFormatter *formatter, g_free (buf); html = g_string_new (""); - img = e_mail_formatter_format_address (formatter, html, addrs, (gchar *) label, + img = e_mail_formatter_format_address ( + formatter, html, addrs, (gchar *) label, (flags & E_MAIL_FORMATTER_HEADER_FLAG_NOLINKS), !(flags & E_MAIL_FORMATTER_HEADER_FLAG_NOELIPSIZE)); @@ -329,7 +334,8 @@ e_mail_formatter_format_header (EMailFormatter *formatter, while (*txt == ' ' || *txt == '\t') txt++; - html = camel_text_to_html (txt, + html = camel_text_to_html ( + txt, e_mail_formatter_get_text_format_flags (formatter), 0); msg_date = camel_header_decode_date (txt, &msg_offset); @@ -347,8 +353,9 @@ e_mail_formatter_format_header (EMailFormatter *formatter, } else { gchar *date_str; - date_str = e_datetime_format_format ("mail", "header", - DTFormatKindDateTime, msg_date); + date_str = e_datetime_format_format ( + "mail", "header", + DTFormatKindDateTime, msg_date); if (hide_real_date) { /* Show only the local-formatted date, losing all timezone @@ -382,7 +389,8 @@ e_mail_formatter_format_header (EMailFormatter *formatter, if (flags & E_MAIL_FORMATTER_HEADER_FLAG_NOLINKS) g_string_append_printf (html, "%s", scan->newsgroup); else - g_string_append_printf (html, "<a href=\"news:%s\">%s</a>", + g_string_append_printf ( + html, "<a href=\"news:%s\">%s</a>", scan->newsgroup, scan->newsgroup); scan = scan->next; if (scan) diff --git a/em-format/e-mail-formatter.c b/em-format/e-mail-formatter.c index ac16647b7f..7d0f589b8a 100644 --- a/em-format/e-mail-formatter.c +++ b/em-format/e-mail-formatter.c @@ -185,9 +185,10 @@ mail_formatter_create_context (EMailFormatter *formatter) if (formatter_class->create_context) { if (!formatter_class->free_context) { - g_warning ("%s implements create_context() but " - "does not implement free_context()!", - G_OBJECT_TYPE_NAME (formatter)); + g_warning ( + "%s implements create_context() but " + "does not implement free_context()!", + G_OBJECT_TYPE_NAME (formatter)); } return formatter_class->create_context (formatter); @@ -353,36 +354,41 @@ e_mail_formatter_get_property (GObject *object, { switch (property_id) { case PROP_BODY_COLOR: - g_value_set_boxed (value, - e_mail_formatter_get_color ( + g_value_set_boxed ( + value, + e_mail_formatter_get_color ( E_MAIL_FORMATTER (object), E_MAIL_FORMATTER_COLOR_BODY)); return; case PROP_CITATION_COLOR: - g_value_set_boxed (value, - e_mail_formatter_get_color ( + g_value_set_boxed ( + value, + e_mail_formatter_get_color ( E_MAIL_FORMATTER (object), E_MAIL_FORMATTER_COLOR_CITATION)); return; case PROP_CONTENT_COLOR: - g_value_set_boxed (value, - e_mail_formatter_get_color ( + g_value_set_boxed ( + value, + e_mail_formatter_get_color ( E_MAIL_FORMATTER (object), E_MAIL_FORMATTER_COLOR_CONTENT)); return; case PROP_FRAME_COLOR: - g_value_set_boxed (value, - e_mail_formatter_get_color ( + g_value_set_boxed ( + value, + e_mail_formatter_get_color ( E_MAIL_FORMATTER (object), E_MAIL_FORMATTER_COLOR_FRAME)); return; case PROP_HEADER_COLOR: - g_value_set_boxed (value, - e_mail_formatter_get_color ( + g_value_set_boxed ( + value, + e_mail_formatter_get_color ( E_MAIL_FORMATTER (object), E_MAIL_FORMATTER_COLOR_HEADER)); return; @@ -396,50 +402,58 @@ e_mail_formatter_get_property (GObject *object, case PROP_MARK_CITATIONS: g_value_set_boolean ( - value, e_mail_formatter_get_mark_citations ( + value, + e_mail_formatter_get_mark_citations ( E_MAIL_FORMATTER (object))); return; case PROP_ONLY_LOCAL_PHOTOS: g_value_set_boolean ( - value, e_mail_formatter_get_only_local_photos ( + value, + e_mail_formatter_get_only_local_photos ( E_MAIL_FORMATTER (object))); return; case PROP_SHOW_SENDER_PHOTO: g_value_set_boolean ( - value, e_mail_formatter_get_show_sender_photo ( + value, + e_mail_formatter_get_show_sender_photo ( E_MAIL_FORMATTER (object))); return; case PROP_SHOW_REAL_DATE: g_value_set_boolean ( - value, e_mail_formatter_get_show_real_date ( + value, + e_mail_formatter_get_show_real_date ( E_MAIL_FORMATTER (object))); return; case PROP_TEXT_COLOR: - g_value_set_boxed (value, - e_mail_formatter_get_color ( + g_value_set_boxed ( + value, + e_mail_formatter_get_color ( E_MAIL_FORMATTER (object), E_MAIL_FORMATTER_COLOR_TEXT)); return; case PROP_ANIMATE_IMAGES: g_value_set_boolean ( - value, e_mail_formatter_get_animate_images ( + value, + e_mail_formatter_get_animate_images ( E_MAIL_FORMATTER (object))); return; case PROP_CHARSET: g_value_set_string ( - value, e_mail_formatter_get_charset ( + value, + e_mail_formatter_get_charset ( E_MAIL_FORMATTER (object))); return; case PROP_DEFAULT_CHARSET: g_value_set_string ( - value, e_mail_formatter_get_default_charset ( + value, + e_mail_formatter_get_default_charset ( E_MAIL_FORMATTER (object))); return; } @@ -746,11 +760,12 @@ e_mail_formatter_get_type (void) (GInterfaceInitFunc) e_mail_formatter_extensible_interface_init }; - type = g_type_register_static (G_TYPE_OBJECT, - "EMailFormatter", &type_info, 0); + type = g_type_register_static ( + G_TYPE_OBJECT, + "EMailFormatter", &type_info, 0); - g_type_add_interface_static (type, - E_TYPE_EXTENSIBLE, &e_extensible_interface_info); + g_type_add_interface_static ( + type, E_TYPE_EXTENSIBLE, &e_extensible_interface_info); } return type; @@ -825,8 +840,8 @@ e_mail_formatter_format (EMailFormatter *formatter, g_return_if_fail (formatter_class->run != NULL); simple = g_simple_async_result_new ( - G_OBJECT (formatter), callback, - user_data, e_mail_formatter_format); + G_OBJECT (formatter), callback, + user_data, e_mail_formatter_format); g_simple_async_result_set_check_cancellable (simple, cancellable); @@ -935,9 +950,10 @@ e_mail_formatter_format_as (EMailFormatter *formatter, ok = FALSE; - d (printf ("(%d) Formatting for part %s of type %s (found %d formatters)\n", - _call_i, part->id, as_mime_type, - formatters ? g_queue_get_length (formatters) : 0)); + d ( + printf ("(%d) Formatting for part %s of type %s (found %d formatters)\n", + _call_i, part->id, as_mime_type, + formatters ? g_queue_get_length (formatters) : 0)); if (formatters) { for (iter = formatters->head; iter; iter = iter->next) { @@ -952,7 +968,9 @@ e_mail_formatter_format_as (EMailFormatter *formatter, extension, formatter, context, part, stream, cancellable); - d (printf ("\t(%d) trying %s...%s\n", _call_i, + d ( + printf ( + "\t(%d) trying %s...%s\n", _call_i, G_OBJECT_TYPE_NAME (extension), ok ? "OK" : "failed")); @@ -1206,10 +1224,6 @@ e_mail_formatter_set_mark_citations (EMailFormatter *formatter, { g_return_if_fail (E_IS_MAIL_FORMATTER (formatter)); - if (((E_MAIL_FORMATTER_GET_CLASS (formatter)->text_html_flags - & CAMEL_MIME_FILTER_TOHTML_MARK_CITATION) ? 1 : 0) == (mark_citations ? 1 : 0)) - return; - if (mark_citations) E_MAIL_FORMATTER_GET_CLASS (formatter)->text_html_flags |= CAMEL_MIME_FILTER_TOHTML_MARK_CITATION; @@ -1234,7 +1248,7 @@ e_mail_formatter_set_only_local_photos (EMailFormatter *formatter, { g_return_if_fail (E_IS_MAIL_FORMATTER (formatter)); - if ((formatter->priv->only_local_photos ? 1 : 0) == (only_local_photos ? 1 : 0)) + if (formatter->priv->only_local_photos == only_local_photos) return; formatter->priv->only_local_photos = only_local_photos; @@ -1256,7 +1270,7 @@ e_mail_formatter_set_show_sender_photo (EMailFormatter *formatter, { g_return_if_fail (E_IS_MAIL_FORMATTER (formatter)); - if ((formatter->priv->show_sender_photo ? 1 : 0) == (show_sender_photo ? 1 : 0)) + if (formatter->priv->show_sender_photo == show_sender_photo) return; formatter->priv->show_sender_photo = show_sender_photo; @@ -1278,7 +1292,7 @@ e_mail_formatter_set_show_real_date (EMailFormatter *formatter, { g_return_if_fail (E_IS_MAIL_FORMATTER (formatter)); - if ((formatter->priv->show_real_date ? 1 : 0) == (show_real_date ? 1 : 0)) + if (formatter->priv->show_real_date == show_real_date) return; formatter->priv->show_real_date = show_real_date; @@ -1300,7 +1314,7 @@ e_mail_formatter_set_animate_images (EMailFormatter *formatter, { g_return_if_fail (E_IS_MAIL_FORMATTER (formatter)); - if ((formatter->priv->animate_images ? 1 : 0) == (animate_images ? 1 : 0)) + if (formatter->priv->animate_images == animate_images) return; formatter->priv->animate_images = animate_images; diff --git a/em-format/e-mail-inline-filter.c b/em-format/e-mail-inline-filter.c index 242ac5959a..1cd6781a06 100644 --- a/em-format/e-mail-inline-filter.c +++ b/em-format/e-mail-inline-filter.c @@ -426,7 +426,7 @@ e_mail_inline_filter_init (EMailInlineFilter *emif) EMailInlineFilter * e_mail_inline_filter_new (CamelTransferEncoding base_encoding, CamelContentType *base_type, - const gchar *filename) + const gchar *filename) { EMailInlineFilter *emif; diff --git a/em-format/e-mail-parser-application-mbox.c b/em-format/e-mail-parser-application-mbox.c index d8224e35c1..fb901afdea 100644 --- a/em-format/e-mail-parser-application-mbox.c +++ b/em-format/e-mail-parser-application-mbox.c @@ -73,7 +73,7 @@ empe_app_mbox_parse (EMailParserExtension *extension, gint old_len; gint messages; GSList *parts; - GError *error; + GError *error = NULL; if (g_cancellable_is_cancelled (cancellable)) return NULL; @@ -101,17 +101,15 @@ empe_app_mbox_parse (EMailParserExtension *extension, mem_stream, NULL, NULL); g_seekable_seek (G_SEEKABLE (mem_stream), 0, G_SEEK_SET, cancellable, NULL); - error = NULL; camel_mime_parser_init_with_stream (mime_parser, mem_stream, &error); - if (error) { - parts = e_mail_parser_error (parser, cancellable, - _("Error parsing MBOX part: %s"), - error->message ? - error->message : - _("Unknown error")); - g_clear_error (&error); + if (error != NULL) { + parts = e_mail_parser_error ( + parser, cancellable, + _("Error parsing MBOX part: %s"), + error->message); g_object_unref (mem_stream); g_object_unref (mime_parser); + g_error_free (error); return parts; } diff --git a/em-format/e-mail-parser-application-smime.c b/em-format/e-mail-parser-application-smime.c index 11513e3dc2..9fbf24e3ff 100644 --- a/em-format/e-mail-parser-application-smime.c +++ b/em-format/e-mail-parser-application-smime.c @@ -93,19 +93,18 @@ empe_app_smime_parse (EMailParserExtension *extension, opart = camel_mime_part_new (); valid = camel_cipher_context_decrypt_sync ( - context, part, opart, - cancellable, &local_error); + context, part, opart, + cancellable, &local_error); e_mail_part_preserve_charset_in_content_type (part, opart); - if (valid == NULL) { + if (local_error != NULL) { parts = e_mail_parser_error ( parser, cancellable, _("Could not parse S/MIME message: %s"), - local_error->message ? - local_error->message : - _("Unknown error")); - g_clear_error (&local_error); + local_error->message); + g_error_free (local_error); + } else { gint len = part_id->len; @@ -123,7 +122,8 @@ empe_app_smime_parse (EMailParserExtension *extension, if (!mail_part) continue; - e_mail_part_update_validity (mail_part, valid, + e_mail_part_update_validity ( + mail_part, valid, E_MAIL_PART_VALIDITY_ENCRYPTED | E_MAIL_PART_VALIDITY_SMIME); @@ -144,7 +144,8 @@ empe_app_smime_parse (EMailParserExtension *extension, if (button && button->data) { mail_part = button->data; - e_mail_part_update_validity (mail_part, valid, + e_mail_part_update_validity ( + mail_part, valid, E_MAIL_PART_VALIDITY_ENCRYPTED | E_MAIL_PART_VALIDITY_SMIME); } diff --git a/em-format/e-mail-parser-headers.c b/em-format/e-mail-parser-headers.c index 92e93f6f51..c66563aef1 100644 --- a/em-format/e-mail-parser-headers.c +++ b/em-format/e-mail-parser-headers.c @@ -77,7 +77,8 @@ empe_headers_bind_dom (EMailPart *part, addr = webkit_dom_element_get_attribute (photo, "data-mailaddr"); only_local = webkit_dom_element_has_attribute (photo, "data-onlylocal"); - uri = g_strdup_printf ("mail://contact-photo?mailaddr=%s%s", + uri = g_strdup_printf ( + "mail://contact-photo?mailaddr=%s%s", addr, only_local ? "&only-local-photo=1" : ""); webkit_dom_html_image_element_set_src ( diff --git a/em-format/e-mail-parser-inlinepgp-encrypted.c b/em-format/e-mail-parser-inlinepgp-encrypted.c index ebdc274738..3a61a5eeff 100644 --- a/em-format/e-mail-parser-inlinepgp-encrypted.c +++ b/em-format/e-mail-parser-inlinepgp-encrypted.c @@ -85,20 +85,19 @@ empe_inlinepgp_encrypted_parse (EMailParserExtension *extension, valid = camel_cipher_context_decrypt_sync ( cipher, part, opart, cancellable, &local_error); - if (!valid) { + if (local_error != NULL) { parts = e_mail_parser_error ( - parser, cancellable, - _("Could not parse PGP message: %s"), - local_error->message ? - local_error->message : - _("Unknown error")); - g_clear_error (&local_error); - - parts = g_slist_concat (parts, - e_mail_parser_parse_part_as (parser, - part, part_id, - "application/vnd.evolution.source", - cancellable)); + parser, cancellable, + _("Could not parse PGP message: %s"), + local_error->message); + g_error_free (local_error); + + parts = g_slist_concat ( + parts, + e_mail_parser_parse_part_as (parser, + part, part_id, + "application/vnd.evolution.source", + cancellable)); g_object_unref (cipher); g_object_unref (opart); @@ -136,7 +135,8 @@ empe_inlinepgp_encrypted_parse (EMailParserExtension *extension, if (!mail_part) continue; - e_mail_part_update_validity (mail_part, valid, + e_mail_part_update_validity ( + mail_part, valid, E_MAIL_PART_VALIDITY_ENCRYPTED | E_MAIL_PART_VALIDITY_PGP); } @@ -156,7 +156,8 @@ empe_inlinepgp_encrypted_parse (EMailParserExtension *extension, if (button && button->data) { mail_part = button->data; - e_mail_part_update_validity (mail_part, valid, + e_mail_part_update_validity ( + mail_part, valid, E_MAIL_PART_VALIDITY_ENCRYPTED | E_MAIL_PART_VALIDITY_PGP); } diff --git a/em-format/e-mail-parser-inlinepgp-signed.c b/em-format/e-mail-parser-inlinepgp-signed.c index 82b8c98178..23461299d9 100644 --- a/em-format/e-mail-parser-inlinepgp-signed.c +++ b/em-format/e-mail-parser-inlinepgp-signed.c @@ -87,21 +87,21 @@ empe_inlinepgp_signed_parse (EMailParserExtension *extension, /* Verify the signature of the message */ valid = camel_cipher_context_verify_sync ( cipher, part, cancellable, &local_error); - if (!valid) { + + if (local_error != NULL) { parts = e_mail_parser_error ( - parser, cancellable, - _("Error verifying signature: %s"), - local_error->message ? - local_error->message : - _("Unknown error")); + parser, cancellable, + _("Error verifying signature: %s"), + local_error->message); - g_clear_error (&local_error); + g_error_free (local_error); - parts = g_slist_concat (parts, - e_mail_parser_parse_part_as ( - parser, part, part_id, - "application/vnd.evolution.source", - cancellable)); + parts = g_slist_concat ( + parts, + e_mail_parser_parse_part_as ( + parser, part, part_id, + "application/vnd.evolution.source", + cancellable)); g_object_unref (cipher); return parts; @@ -148,7 +148,7 @@ empe_inlinepgp_signed_parse (EMailParserExtension *extension, g_string_append (part_id, ".inlinepgp_signed"); parts = e_mail_parser_parse_part ( - parser, opart, part_id, cancellable); + parser, opart, part_id, cancellable); for (iter = parts; iter; iter = iter->next) { EMailPart *mail_part; @@ -157,7 +157,8 @@ empe_inlinepgp_signed_parse (EMailParserExtension *extension, if (!mail_part) continue; - e_mail_part_update_validity (mail_part, valid, + e_mail_part_update_validity ( + mail_part, valid, E_MAIL_PART_VALIDITY_SIGNED | E_MAIL_PART_VALIDITY_PGP); } @@ -173,13 +174,14 @@ empe_inlinepgp_signed_parse (EMailParserExtension *extension, g_string_append (part_id, ".inlinepgp_signed.button"); button = e_mail_parser_parse_part_as ( - parser, part, part_id, - "application/vnd.evolution.widget.secure-button", - cancellable); + parser, part, part_id, + "application/vnd.evolution.widget.secure-button", + cancellable); if (button && button->data) { mail_part = button->data; - e_mail_part_update_validity (mail_part, valid, + e_mail_part_update_validity ( + mail_part, valid, E_MAIL_PART_VALIDITY_SIGNED | E_MAIL_PART_VALIDITY_PGP); } diff --git a/em-format/e-mail-parser-message.c b/em-format/e-mail-parser-message.c index 5f7f8a94d0..7b6e6201d5 100644 --- a/em-format/e-mail-parser-message.c +++ b/em-format/e-mail-parser-message.c @@ -90,7 +90,7 @@ empe_message_parse (EMailParserExtension *extension, if (mime_type && g_ascii_strcasecmp (mime_type, "message/rfc822") == 0) { /* get mime type of the content of the message, - instead of using a generic message/rfc822 */ + * instead of using a generic message/rfc822 */ CamelDataWrapper *content; content = camel_medium_get_content (CAMEL_MEDIUM (part)); diff --git a/em-format/e-mail-parser-multipart-digest.c b/em-format/e-mail-parser-multipart-digest.c index e723b7ee67..2acd8ee614 100644 --- a/em-format/e-mail-parser-multipart-digest.c +++ b/em-format/e-mail-parser-multipart-digest.c @@ -99,10 +99,11 @@ empe_mp_digest_parse (EMailParserExtension *extension, if (ct && !camel_content_type_is (ct, "message", "rfc822")) { cts = camel_content_type_simple (ct); - parts = g_slist_concat (parts, - e_mail_parser_parse_part_as ( - parser, subpart, part_id, - cts, cancellable)); + parts = g_slist_concat ( + parts, + e_mail_parser_parse_part_as ( + parser, subpart, part_id, + cts, cancellable)); g_free (cts); } else { diff --git a/em-format/e-mail-parser-multipart-encrypted.c b/em-format/e-mail-parser-multipart-encrypted.c index e85bcd2a98..db417fabbf 100644 --- a/em-format/e-mail-parser-multipart-encrypted.c +++ b/em-format/e-mail-parser-multipart-encrypted.c @@ -77,15 +77,15 @@ empe_mp_encrypted_parse (EMailParserExtension *extension, mpe = (CamelMultipartEncrypted *) camel_medium_get_content ((CamelMedium *) part); if (!CAMEL_IS_MULTIPART_ENCRYPTED (mpe)) { parts = e_mail_parser_error ( - parser, cancellable, - _("Could not parse MIME message. " - "Displaying as source.")); + parser, cancellable, + _("Could not parse MIME message. " + "Displaying as source.")); parts = g_slist_concat ( - parts, - e_mail_parser_parse_part_as ( - parser, part, part_id, - "application/vnd.evolution/source", - cancellable)); + parts, + e_mail_parser_parse_part_as ( + parser, part, part_id, + "application/vnd.evolution/source", + cancellable)); return parts; } @@ -95,14 +95,14 @@ empe_mp_encrypted_parse (EMailParserExtension *extension, ((CamelDataWrapper *) mpe)->mime_type, "protocol"); if (!protocol || g_ascii_strcasecmp (protocol, "application/pgp-encrypted") != 0) { parts = e_mail_parser_error ( - parser, cancellable, - _("Unsupported encryption type for multipart/encrypted")); + parser, cancellable, + _("Unsupported encryption type for multipart/encrypted")); parts = g_slist_concat ( - parts, - e_mail_parser_parse_part_as ( - parser, part, part_id, - "multipart/mixed", cancellable)); + parts, + e_mail_parser_parse_part_as ( + parser, part, part_id, + "multipart/mixed", cancellable)); return parts; } @@ -110,23 +110,23 @@ empe_mp_encrypted_parse (EMailParserExtension *extension, opart = camel_mime_part_new (); valid = camel_cipher_context_decrypt_sync ( - context, part, opart, cancellable, &local_error); + context, part, opart, cancellable, &local_error); e_mail_part_preserve_charset_in_content_type (part, opart); - if (valid == NULL) { + + if (local_error != NULL) { parts = e_mail_parser_error ( - parser, cancellable, - _("Could not parse PGP/MIME message: %s"), - local_error->message ? - local_error->message : - _("Unknown error")); + parser, cancellable, + _("Could not parse PGP/MIME message: %s"), + local_error->message); - g_clear_error (&local_error); + g_error_free (local_error); - parts = g_slist_concat (parts, - e_mail_parser_parse_part_as ( - parser, part, part_id, - "multipart/mixed", cancellable)); + parts = g_slist_concat ( + parts, + e_mail_parser_parse_part_as ( + parser, part, part_id, + "multipart/mixed", cancellable)); g_object_unref (opart); g_object_unref (context); @@ -138,7 +138,7 @@ empe_mp_encrypted_parse (EMailParserExtension *extension, g_string_append (part_id, ".encrypted"); parts = e_mail_parser_parse_part ( - parser, opart, part_id, cancellable); + parser, opart, part_id, cancellable); g_string_truncate (part_id, len); @@ -150,27 +150,29 @@ empe_mp_encrypted_parse (EMailParserExtension *extension, if (!mail_part) continue; - e_mail_part_update_validity (mail_part, valid, + e_mail_part_update_validity ( + mail_part, valid, E_MAIL_PART_VALIDITY_ENCRYPTED | E_MAIL_PART_VALIDITY_PGP); } /* Add a widget with details about the encryption, but only when - * the decrypted part isn't itself secured, in that case it has created - * the button itself */ + * the decrypted part isn't itself secured, in that case it has + * created the button itself. */ if (!e_mail_part_is_secured (opart)) { GSList *button; EMailPart *mail_part; g_string_append (part_id, ".encrypted.button"); button = e_mail_parser_parse_part_as ( - parser, part, part_id, - "application/vnd.evolution.widget.secure-button", - cancellable); + parser, part, part_id, + "application/vnd.evolution.widget.secure-button", + cancellable); if (button && button->data) { mail_part = button->data; - e_mail_part_update_validity (mail_part, valid, + e_mail_part_update_validity ( + mail_part, valid, E_MAIL_PART_VALIDITY_ENCRYPTED | E_MAIL_PART_VALIDITY_PGP); } diff --git a/em-format/e-mail-parser-multipart-mixed.c b/em-format/e-mail-parser-multipart-mixed.c index c8e2995ffc..69882739d9 100644 --- a/em-format/e-mail-parser-multipart-mixed.c +++ b/em-format/e-mail-parser-multipart-mixed.c @@ -105,10 +105,11 @@ empe_mp_mixed_parse (EMailParserExtension *extension, (E_MAIL_PART (new_parts->data)->cid != NULL) && !E_MAIL_PART (new_parts->data)->is_attachment) { - parts = g_slist_concat (parts, - e_mail_parser_wrap_as_attachment ( - parser, subpart, new_parts, - part_id, cancellable)); + parts = g_slist_concat ( + parts, + e_mail_parser_wrap_as_attachment ( + parser, subpart, new_parts, + part_id, cancellable)); /* Force messages to be expandable */ } else if (!new_parts || @@ -116,10 +117,11 @@ empe_mp_mixed_parse (EMailParserExtension *extension, new_parts && new_parts->data && !E_MAIL_PART (new_parts->data)->is_attachment)) { - parts = g_slist_concat (parts, - e_mail_parser_wrap_as_attachment ( - parser, subpart, new_parts, - part_id, cancellable)); + parts = g_slist_concat ( + parts, + e_mail_parser_wrap_as_attachment ( + parser, subpart, new_parts, + part_id, cancellable)); if (parts && parts->data) E_MAIL_PART (parts->data)->force_inline = TRUE; } else { @@ -165,5 +167,4 @@ e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface) static void e_mail_parser_multipart_mixed_init (EMailParserMultipartMixed *parser) { - } diff --git a/em-format/e-mail-parser-multipart-signed.c b/em-format/e-mail-parser-multipart-signed.c index bd6e1e2970..b7d395ab05 100644 --- a/em-format/e-mail-parser-multipart-signed.c +++ b/em-format/e-mail-parser-multipart-signed.c @@ -88,18 +88,21 @@ empe_mp_signed_parse (EMailParserExtension *extension, mps = (CamelMultipartSigned *) camel_medium_get_content ((CamelMedium *) part); if (!CAMEL_IS_MULTIPART_SIGNED (mps) - || (cpart = camel_multipart_get_part ((CamelMultipart *) mps, + || ( + cpart = camel_multipart_get_part ( + (CamelMultipart *) mps, CAMEL_MULTIPART_SIGNED_CONTENT)) == NULL) { parts = e_mail_parser_error ( - parser, cancellable, - _("Could not parse MIME message. " - "Displaying as source.")); - - parts = g_slist_concat (parts, - e_mail_parser_parse_part_as ( - parser, part, part_id, - "application/vnd.evolution.source", - cancellable)); + parser, cancellable, + _("Could not parse MIME message. " + "Displaying as source.")); + + parts = g_slist_concat ( + parts, + e_mail_parser_parse_part_as ( + parser, part, part_id, + "application/vnd.evolution.source", + cancellable)); return parts; } @@ -125,33 +128,34 @@ empe_mp_signed_parse (EMailParserExtension *extension, if (cipher == NULL) { parts = e_mail_parser_error ( - parser, cancellable, - _("Unsupported signature format")); + parser, cancellable, + _("Unsupported signature format")); - parts = g_slist_concat (parts, - e_mail_parser_parse_part_as ( - parser, part, part_id, - "multipart/mixed", cancellable)); + parts = g_slist_concat ( + parts, + e_mail_parser_parse_part_as ( + parser, part, part_id, + "multipart/mixed", cancellable)); return parts; } valid = camel_cipher_context_verify_sync ( cipher, part, cancellable, &local_error); - if (valid == NULL) { + + if (local_error != NULL) { parts = e_mail_parser_error ( - parser, cancellable, - _("Error verifying signature: %s"), - local_error->message ? - local_error->message : - _("Unknown error")); + parser, cancellable, + _("Error verifying signature: %s"), + local_error->message); - g_clear_error (&local_error); + g_error_free (local_error); - parts = g_slist_concat (parts, - e_mail_parser_parse_part_as ( - parser, part, part_id, - "multipart/mixed", cancellable)); + parts = g_slist_concat ( + parts, + e_mail_parser_parse_part_as ( + parser, part, part_id, + "multipart/mixed", cancellable)); g_object_unref (cipher); return parts; @@ -169,7 +173,7 @@ empe_mp_signed_parse (EMailParserExtension *extension, g_string_append_printf (part_id, ".signed.%d", i); mail_parts = e_mail_parser_parse_part ( - parser, subpart, part_id, cancellable); + parser, subpart, part_id, cancellable); g_string_truncate (part_id, len); @@ -183,7 +187,8 @@ empe_mp_signed_parse (EMailParserExtension *extension, if (!mail_part) continue; - e_mail_part_update_validity (mail_part, valid, + e_mail_part_update_validity ( + mail_part, valid, validity_type | E_MAIL_PART_VALIDITY_SIGNED); } @@ -199,13 +204,14 @@ empe_mp_signed_parse (EMailParserExtension *extension, g_string_append (part_id, ".signed.button"); button = e_mail_parser_parse_part_as ( - parser, part, part_id, - "application/vnd.evolution.widget.secure-button", - cancellable); + parser, part, part_id, + "application/vnd.evolution.widget.secure-button", + cancellable); if (button && button->data) { mail_part = button->data; - e_mail_part_update_validity (mail_part, valid, + e_mail_part_update_validity ( + mail_part, valid, validity_type | E_MAIL_PART_VALIDITY_SIGNED); } @@ -247,5 +253,4 @@ e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface) static void e_mail_parser_multipart_signed_init (EMailParserMultipartSigned *parser) { - } diff --git a/em-format/e-mail-parser-text-plain.c b/em-format/e-mail-parser-text-plain.c index 3503be5979..bdfcd15e5d 100644 --- a/em-format/e-mail-parser-text-plain.c +++ b/em-format/e-mail-parser-text-plain.c @@ -203,9 +203,10 @@ empe_text_plain_parse (EMailParserExtension *extension, g_object_unref (inline_filter); camel_content_type_unref (type); - return process_part (parser, part_id, 0, - part, e_mail_part_is_attachment (part), - cancellable); + return process_part ( + parser, part_id, 0, + part, e_mail_part_is_attachment (part), + cancellable); } mp = e_mail_inline_filter_get_multipart (inline_filter); @@ -229,11 +230,12 @@ empe_text_plain_parse (EMailParserExtension *extension, if (!newpart) continue; - parts = g_slist_concat (parts, - process_part ( - parser, part_id, i, - newpart, is_attachment, - cancellable)); + parts = g_slist_concat ( + parts, + process_part ( + parser, part_id, i, + newpart, is_attachment, + cancellable)); } g_object_unref (mp); diff --git a/em-format/e-mail-parser.c b/em-format/e-mail-parser.c index 69d74af623..8f007a07f7 100644 --- a/em-format/e-mail-parser.c +++ b/em-format/e-mail-parser.c @@ -143,8 +143,9 @@ e_mail_parser_set_property (GObject *object, switch (property_id) { case PROP_SESSION: - mail_parser_set_session (parser, - CAMEL_SESSION (g_value_get_object (value))); + mail_parser_set_session ( + parser, + g_value_get_object (value)); return; } @@ -161,8 +162,9 @@ e_mail_parser_get_property (GObject *object, switch (property_id) { case PROP_SESSION: - g_value_set_object (value, - G_OBJECT (e_mail_parser_get_session (parser))); + g_value_set_object ( + value, + e_mail_parser_get_session (parser)); return; } @@ -261,7 +263,8 @@ e_mail_parser_get_type (void) EMailParser * e_mail_parser_new (CamelSession *session) { - return g_object_new (E_TYPE_MAIL_PARSER, + return g_object_new ( + E_TYPE_MAIL_PARSER, "session", session, NULL); } @@ -308,15 +311,18 @@ e_mail_parser_parse_sync (EMailParser *parser, if (camel_debug_start ("emformat:parser")) { GSList *iter; - printf ("%s finished with EMailPartList:\n", - G_OBJECT_TYPE_NAME (parser)); + printf ( + "%s finished with EMailPartList:\n", + G_OBJECT_TYPE_NAME (parser)); for (iter = parts_list->list; iter; iter = iter->next) { EMailPart *part = iter->data; if (!part) continue; - printf (" id: %s | cid: %s | mime_type: %s | is_hidden: %d | is_attachment: %d\n", + printf ( + " id: %s | cid: %s | mime_type: %s | is_hidden: %d | is_attachment: %d\n", part->id, part->cid, part->mime_type, - part->is_hidden ? 1 : 0, part->is_attachment ? 1 : 0); + part->is_hidden ? 1 : 0, + part->is_attachment ? 1 : 0); } camel_debug_end (); @@ -399,15 +405,18 @@ e_mail_parser_parse_finish (EMailParser *parser, if (camel_debug_start ("emformat:parser")) { GSList *iter; - printf ("%s finished with EMailPartList:\n", + printf ( + "%s finished with EMailPartList:\n", G_OBJECT_TYPE_NAME (parser)); for (iter = parts_list->list; iter; iter = iter->next) { EMailPart *part = iter->data; if (!part) continue; - printf (" id: %s | cid: %s | mime_type: %s | is_hidden: %d | is_attachment: %d\n", + printf ( + " id: %s | cid: %s | mime_type: %s | is_hidden: %d | is_attachment: %d\n", part->id, part->cid, part->mime_type, - part->is_hidden ? 1 : 0, part->is_attachment ? 1 : 0); + part->is_hidden ? 1 : 0, + part->is_attachment ? 1 : 0); } camel_debug_end (); @@ -520,7 +529,8 @@ e_mail_parser_error (EMailParser *parser, errmsg = g_strdup_vprintf (format, ap); part = camel_mime_part_new (); - camel_mime_part_set_content (part, + camel_mime_part_set_content ( + part, errmsg, strlen (errmsg), "application/vnd.evolution.error"); g_free (errmsg); @@ -561,7 +571,8 @@ attachment_loaded (EAttachment *attachment, static gboolean load_attachment_idle (EAttachment *attachment) { - e_attachment_load_async (attachment, + e_attachment_load_async ( + attachment, (GAsyncReadyCallback) attachment_loaded, NULL); return FALSE; @@ -638,7 +649,8 @@ e_mail_parser_wrap_as_attachment (EMailParser *parser, e_attachment_set_mime_part (empa->attachment, part); e_attachment_set_shown (empa->attachment, empa->shown); - e_attachment_set_can_show (empa->attachment, + e_attachment_set_can_show ( + empa->attachment, extensions && !g_queue_is_empty (extensions)); /* Try to guess size of the attachments */ diff --git a/em-format/e-mail-part-utils.c b/em-format/e-mail-part-utils.c index 9c7c91301f..b1c514d49e 100644 --- a/em-format/e-mail-part-utils.c +++ b/em-format/e-mail-part-utils.c @@ -399,10 +399,11 @@ e_mail_part_build_uri (CamelFolder *folder, } encoded_message_uid = soup_uri_encode (message_uid, NULL); - tmp = g_strdup_printf ("mail://%s/%s/%s", - service_uid, - folder_name, - encoded_message_uid); + tmp = g_strdup_printf ( + "mail://%s/%s/%s", + service_uid, + folder_name, + encoded_message_uid); g_free (encoded_message_uid); if (folder) { @@ -419,21 +420,24 @@ e_mail_part_build_uri (CamelFolder *folder, case G_TYPE_INT: case G_TYPE_BOOLEAN: { gint val = va_arg (ap, gint); - tmp2 = g_strdup_printf ("%s%c%s=%d", tmp, + tmp2 = g_strdup_printf ( + "%s%c%s=%d", tmp, separator, name, val); break; } case G_TYPE_FLOAT: case G_TYPE_DOUBLE: { gdouble val = va_arg (ap, double); - tmp2 = g_strdup_printf ("%s%c%s=%f", tmp, + tmp2 = g_strdup_printf ( + "%s%c%s=%f", tmp, separator, name, val); break; } case G_TYPE_STRING: { gchar *val = va_arg (ap, gchar *); gchar *escaped = soup_uri_encode (val, NULL); - tmp2 = g_strdup_printf ("%s%c%s=%s", tmp, + tmp2 = g_strdup_printf ( + "%s%c%s=%s", tmp, separator, name, escaped); g_free (escaped); break; |