diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2012-12-07 01:57:33 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2012-12-08 03:01:04 +0800 |
commit | 9d34f72ec1b99d58ee1c3a6d1a964a6dde166f79 (patch) | |
tree | 8849353e617afe5207095fb6100a33e79989c9bc /em-format | |
parent | 3924dc759dbf38df0f9ff6941990dcf242478617 (diff) | |
download | gsoc2013-evolution-9d34f72ec1b99d58ee1c3a6d1a964a6dde166f79.tar.gz gsoc2013-evolution-9d34f72ec1b99d58ee1c3a6d1a964a6dde166f79.tar.zst gsoc2013-evolution-9d34f72ec1b99d58ee1c3a6d1a964a6dde166f79.zip |
EMailExtension: Replace mime_types() method with a string array.
In all implementations for EMailExtension, the MIME type list is a
static string array -- with the single exception of the text-highlight
module, where the MIME type list is dynamically assembled once.
Replace the mime_types() method with a "mime_types" string array in the
EMailExtensionInterface struct. Then the list of MIME types supported
by the class implementing the EMailExtensionInterface can be obtained
without requiring an instance of the class.
Diffstat (limited to 'em-format')
44 files changed, 300 insertions, 446 deletions
diff --git a/em-format/e-mail-extension-registry.c b/em-format/e-mail-extension-registry.c index 3097d93212..41a3d6f664 100644 --- a/em-format/e-mail-extension-registry.c +++ b/em-format/e-mail-extension-registry.c @@ -106,8 +106,8 @@ void e_mail_extension_registry_add_extension (EMailExtensionRegistry *reg, EMailExtension *extension) { - gint i; - const gchar **types; + EMailExtensionInterface *interface; + gint ii; g_return_if_fail (E_IS_MAIL_EXTENSION_REGISTRY (reg)); g_return_if_fail (E_IS_MAIL_EXTENSION (extension)); @@ -115,15 +115,26 @@ e_mail_extension_registry_add_extension (EMailExtensionRegistry *reg, /* One reference per extension is enough */ g_object_ref (extension); - types = e_mail_extension_get_mime_types (extension); - for (i = 0; types && types[i]; i++) { + interface = E_MAIL_EXTENSION_GET_INTERFACE (extension); + if (interface->mime_types == NULL) { + g_critical ( + "%s does not define any MIME types", + G_OBJECT_TYPE_NAME (extension)); + return; + } + + for (ii = 0; interface->mime_types[ii] != NULL; ii++) { GQueue *queue; - queue = g_hash_table_lookup (reg->priv->table, types[i]); - if (!queue) { + queue = g_hash_table_lookup ( + reg->priv->table, interface->mime_types[ii]); + if (queue == NULL) { queue = g_queue_new (); g_queue_push_head (queue, extension); - g_hash_table_insert (reg->priv->table, (gchar *) types[i], queue); + g_hash_table_insert ( + reg->priv->table, + (gpointer) interface->mime_types[ii], + queue); } else { g_queue_push_head (queue, extension); } @@ -131,7 +142,8 @@ 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]); + G_OBJECT_TYPE_NAME (extension), + interface->mime_types[ii]); } } } @@ -147,28 +159,32 @@ void e_mail_extension_registry_remove_extension (EMailExtensionRegistry *reg, EMailExtension *extension) { - gint i; - const gchar **types; + EMailExtensionInterface *interface; + gint ii; g_return_if_fail (E_IS_MAIL_EXTENSION_REGISTRY (reg)); g_return_if_fail (E_IS_MAIL_EXTENSION (extension)); - types = e_mail_extension_get_mime_types (extension); - for (i = 0; types && types[i]; i++) { + interface = E_MAIL_EXTENSION_GET_INTERFACE (extension); + if (interface->mime_types == NULL) + return; + + for (ii = 0; interface->mime_types[ii] != NULL; ii++) { GQueue *queue; - queue = g_hash_table_lookup (reg->priv->table, types[i]); - if (!queue) { - i++; + queue = g_hash_table_lookup ( + reg->priv->table, + interface->mime_types[ii]); + if (queue == NULL) continue; - } g_queue_remove (queue, extension); if (camel_debug ("emformat:registry")) { printf ( "Removed extension '%s' from type '%s'\n", - G_OBJECT_TYPE_NAME (extension), types[i]); + G_OBJECT_TYPE_NAME (extension), + interface->mime_types[ii]); } } diff --git a/em-format/e-mail-extension.c b/em-format/e-mail-extension.c index 9516974824..ee319773c1 100644 --- a/em-format/e-mail-extension.c +++ b/em-format/e-mail-extension.c @@ -39,29 +39,3 @@ e_mail_extension_default_init (EMailExtensionInterface *iface) * of extensions. */ -/** - * e_mail_extension_get_mime_types: - * @extension: an #EMailExtension - * - * A virtual function reimplemented in all mail extensions that returns a - * @NULL-terminated array of mime types that the particular extension is able - * to process. - * - * The mime-types can be either full (like text/plain), or with common subtype, - * e.g. text/ *. User should try to find the best mathing mime-type handler and - * use the latter type only as a fallback. - * - * Return value: a @NULL-terminated array or @NULL - */ -const gchar ** -e_mail_extension_get_mime_types (EMailExtension *extension) -{ - EMailExtensionInterface *interface; - - g_return_val_if_fail (E_IS_MAIL_EXTENSION (extension), NULL); - - interface = E_MAIL_EXTENSION_GET_INTERFACE (extension); - g_return_val_if_fail (interface->mime_types != NULL, NULL); - - return interface->mime_types (extension); -} diff --git a/em-format/e-mail-extension.h b/em-format/e-mail-extension.h index 941638aed8..4050cce169 100644 --- a/em-format/e-mail-extension.h +++ b/em-format/e-mail-extension.h @@ -48,12 +48,13 @@ typedef struct _EMailExtensionInterface EMailExtensionInterface; struct _EMailExtensionInterface { GTypeInterface parent_interface; - const gchar ** (*mime_types) (EMailExtension *extension); + /* This is a NULL-terminated array of supported MIME types. + * The MIME types can be exact (e.g. "text/plain") or use a + * wildcard (e.g. "text/ *"). */ + const gchar **mime_types; }; -GType e_mail_extension_get_type (void); - -const gchar ** e_mail_extension_get_mime_types (EMailExtension *extension); +GType e_mail_extension_get_type (void) G_GNUC_CONST; G_END_DECLS diff --git a/em-format/e-mail-formatter-attachment-bar.c b/em-format/e-mail-formatter-attachment-bar.c index 83cb5cad8d..33b13675a9 100644 --- a/em-format/e-mail-formatter-attachment-bar.c +++ b/em-format/e-mail-formatter-attachment-bar.c @@ -51,7 +51,10 @@ G_DEFINE_TYPE_EXTENDED ( E_TYPE_MAIL_FORMATTER_EXTENSION, e_mail_formatter_formatter_extension_interface_init)); -static const gchar *formatter_mime_types[] = { "application/vnd.evolution.widget.attachment-bar", NULL }; +static const gchar *formatter_mime_types[] = { + "application/vnd.evolution.widget.attachment-bar", + NULL +}; static gboolean emfe_attachment_bar_format (EMailFormatterExtension *extension, @@ -122,12 +125,6 @@ emfe_attachment_bar_get_description (EMailFormatterExtension *extension) return NULL; } -static const gchar ** -emfe_attachment_bar_mime_types (EMailExtension *extension) -{ - return formatter_mime_types; -} - static void e_mail_formatter_attachment_bar_class_init (EMailFormatterAttachmentBarClass *class) { @@ -145,7 +142,7 @@ e_mail_formatter_formatter_extension_interface_init (EMailFormatterExtensionInte static void e_mail_formatter_mail_extension_interface_init (EMailExtensionInterface *iface) { - iface->mime_types = emfe_attachment_bar_mime_types; + iface->mime_types = formatter_mime_types; } static void diff --git a/em-format/e-mail-formatter-attachment.c b/em-format/e-mail-formatter-attachment.c index 8d049deddc..d583801a0a 100644 --- a/em-format/e-mail-formatter-attachment.c +++ b/em-format/e-mail-formatter-attachment.c @@ -64,9 +64,11 @@ G_DEFINE_TYPE_EXTENDED ( e_mail_formatter_formatter_extension_interface_init) ) -static const gchar *formatter_mime_types[] = { "application/vnd.evolution.attachment", - "application/vnd.evolution.widget.attachment-button", - NULL }; +static const gchar *formatter_mime_types[] = { + "application/vnd.evolution.attachment", + "application/vnd.evolution.widget.attachment-button", + NULL +}; static EAttachmentStore * find_attachment_store (EMailPartList *part_list, @@ -388,12 +390,6 @@ emfe_attachment_get_description (EMailFormatterExtension *extension) return _("Display as attachment"); } -static const gchar ** -emfe_attachment_mime_types (EMailExtension *extension) -{ - return formatter_mime_types; -} - static void e_mail_formatter_attachment_class_init (EMailFormatterAttachmentClass *class) { @@ -411,7 +407,7 @@ e_mail_formatter_formatter_extension_interface_init (EMailFormatterExtensionInte static void e_mail_formatter_mail_extension_interface_init (EMailExtensionInterface *iface) { - iface->mime_types = emfe_attachment_mime_types; + iface->mime_types = formatter_mime_types; } static void diff --git a/em-format/e-mail-formatter-error.c b/em-format/e-mail-formatter-error.c index 505f1dd10f..0c183a0aeb 100644 --- a/em-format/e-mail-formatter-error.c +++ b/em-format/e-mail-formatter-error.c @@ -52,7 +52,10 @@ G_DEFINE_TYPE_EXTENDED ( E_TYPE_MAIL_FORMATTER_EXTENSION, e_mail_formatter_formatter_extension_interface_init)); -static const gchar *formatter_mime_types[] = { "application/vnd.evolution.error", NULL }; +static const gchar *formatter_mime_types[] = { + "application/vnd.evolution.error", + NULL +}; static gboolean emfe_error_format (EMailFormatterExtension *extension, @@ -128,12 +131,6 @@ emfe_error_get_description (EMailFormatterExtension *extension) return NULL; } -static const gchar ** -emfe_error_mime_types (EMailExtension *extension) -{ - return formatter_mime_types; -} - static void e_mail_formatter_error_class_init (EMailFormatterErrorClass *class) { @@ -150,7 +147,7 @@ e_mail_formatter_formatter_extension_interface_init (EMailFormatterExtensionInte static void e_mail_formatter_mail_extension_interface_init (EMailExtensionInterface *iface) { - iface->mime_types = emfe_error_mime_types; + iface->mime_types = formatter_mime_types; } static void diff --git a/em-format/e-mail-formatter-headers.c b/em-format/e-mail-formatter-headers.c index dde0e5a682..5b62d5659d 100644 --- a/em-format/e-mail-formatter-headers.c +++ b/em-format/e-mail-formatter-headers.c @@ -45,7 +45,10 @@ typedef struct _EMailFormatterHeadersClass { GObjectClass parent_class; } EMailFormatterHeadersClass; -static const gchar *formatter_mime_types[] = { "application/vnd.evolution.headers", NULL }; +static const gchar *formatter_mime_types[] = { + "application/vnd.evolution.headers", + NULL +}; static void e_mail_formatter_formatter_extension_interface_init (EMailFormatterExtensionInterface *iface); static void e_mail_formatter_mail_extension_interface_init (EMailExtensionInterface *iface); @@ -583,12 +586,6 @@ emfe_headers_get_description (EMailFormatterExtension *extension) return NULL; } -static const gchar ** -emfe_headers_mime_types (EMailExtension *extension) -{ - return formatter_mime_types; -} - static void e_mail_formatter_headers_class_init (EMailFormatterHeadersClass *class) { @@ -605,7 +602,7 @@ e_mail_formatter_formatter_extension_interface_init (EMailFormatterExtensionInte static void e_mail_formatter_mail_extension_interface_init (EMailExtensionInterface *iface) { - iface->mime_types = emfe_headers_mime_types; + iface->mime_types = formatter_mime_types; } static void diff --git a/em-format/e-mail-formatter-image.c b/em-format/e-mail-formatter-image.c index aa20e8ce51..24ee2ef217 100644 --- a/em-format/e-mail-formatter-image.c +++ b/em-format/e-mail-formatter-image.c @@ -33,18 +33,26 @@ #include <glib/gi18n-lib.h> #include <camel/camel.h> -static const gchar *formatter_mime_types[] = { "image/gif", "image/jpeg", - "image/png", "image/x-png", - "image/x-bmp", "image/bmp", - "image/svg", "image/x-cmu-raster", - "image/x-ico", - "image/x-portable-anymap", - "image/x-portable-bitmap", - "image/x-portable-graymap", - "image/x-portable-pixmap", - "image/x-xpixmap", - "image/jpg", "image/pjpeg", - "image/*", NULL }; +static const gchar *formatter_mime_types[] = { + "image/gif", + "image/jpeg", + "image/png", + "image/x-png", + "image/x-bmp", + "image/bmp", + "image/svg", + "image/x-cmu-raster", + "image/x-ico", + "image/x-portable-anymap", + "image/x-portable-bitmap", + "image/x-portable-graymap", + "image/x-portable-pixmap", + "image/x-xpixmap", + "image/jpg", + "image/pjpeg", + "image/*", + NULL +}; typedef struct _EMailFormatterImage { GObject parent; @@ -158,12 +166,6 @@ emfe_image_get_description (EMailFormatterExtension *extension) return _("Display part as an image"); } -static const gchar ** -emfe_image_mime_types (EMailExtension *extension) -{ - return formatter_mime_types; -} - static void e_mail_formatter_image_class_init (EMailFormatterImageClass *class) { @@ -180,7 +182,7 @@ e_mail_formatter_formatter_extension_interface_init (EMailFormatterExtensionInte static void e_mail_formatter_mail_extension_interface_init (EMailExtensionInterface *iface) { - iface->mime_types = emfe_image_mime_types; + iface->mime_types = formatter_mime_types; } static void diff --git a/em-format/e-mail-formatter-message-rfc822.c b/em-format/e-mail-formatter-message-rfc822.c index 06f7e49603..f2d7d1cc66 100644 --- a/em-format/e-mail-formatter-message-rfc822.c +++ b/em-format/e-mail-formatter-message-rfc822.c @@ -35,9 +35,11 @@ #include <string.h> -static const gchar * formatter_mime_types[] = { "message/rfc822", - "application/vnd.evolution.rfc822.end", - NULL }; +static const gchar *formatter_mime_types[] = { + "message/rfc822", + "application/vnd.evolution.rfc822.end", + NULL +}; typedef struct _EMailFormatterMessageRFC822 { GObject parent; @@ -255,12 +257,6 @@ emfe_message_rfc822_get_description (EMailFormatterExtension *extension) return _("Format part as an RFC822 message"); } -static const gchar ** -emfe_message_rfc822_mime_types (EMailExtension *extension) -{ - return formatter_mime_types; -} - static void e_mail_formatter_message_rfc822_class_init (EMailFormatterMessageRFC822Class *class) { @@ -277,7 +273,7 @@ e_mail_formatter_formatter_extension_interface_init (EMailFormatterExtensionInte static void e_mail_formatter_mail_extension_interface_init (EMailExtensionInterface *iface) { - iface->mime_types = emfe_message_rfc822_mime_types; + iface->mime_types = formatter_mime_types; } static void diff --git a/em-format/e-mail-formatter-print-headers.c b/em-format/e-mail-formatter-print-headers.c index 03ba7b2ccd..2397f92308 100644 --- a/em-format/e-mail-formatter-print-headers.c +++ b/em-format/e-mail-formatter-print-headers.c @@ -43,7 +43,10 @@ typedef struct _EMailFormatterPrintHeadersClass { GObjectClass parent_class; } EMailFormatterPrintHeadersClass; -static const gchar *formatter_mime_types[] = { "application/vnd.evolution.headers", NULL }; +static const gchar *formatter_mime_types[] = { + "application/vnd.evolution.headers", + NULL +}; static void e_mail_formatter_print_formatter_extension_interface_init (EMailFormatterExtensionInterface *iface); @@ -232,12 +235,6 @@ emfpe_headers_get_description (EMailFormatterExtension *extension) return NULL; } -static const gchar ** -emfpe_headers_mime_types (EMailExtension *extension) -{ - return formatter_mime_types; -} - static void e_mail_formatter_print_headers_class_init (EMailFormatterPrintHeadersClass *class) { @@ -254,7 +251,7 @@ e_mail_formatter_print_formatter_extension_interface_init (EMailFormatterExtensi static void e_mail_formatter_print_mail_extension_interface_init (EMailExtensionInterface *iface) { - iface->mime_types = emfpe_headers_mime_types; + iface->mime_types = formatter_mime_types; } static void diff --git a/em-format/e-mail-formatter-quote-attachment.c b/em-format/e-mail-formatter-quote-attachment.c index 822c93fc2b..8dff36af53 100644 --- a/em-format/e-mail-formatter-quote-attachment.c +++ b/em-format/e-mail-formatter-quote-attachment.c @@ -57,8 +57,10 @@ G_DEFINE_TYPE_EXTENDED ( e_mail_formatter_quote_formatter_extension_interface_init) ) -static const gchar *formatter_mime_types[] = { "application/vnd.evolution.attachment", - NULL }; +static const gchar *formatter_mime_types[] = { + "application/vnd.evolution.attachment", + NULL +}; static gboolean emfqe_attachment_format (EMailFormatterExtension *extension, @@ -133,12 +135,6 @@ emfqe_attachment_get_description (EMailFormatterExtension *extension) return NULL; } -static const gchar ** -emfqe_attachment_mime_types (EMailExtension *extension) -{ - return formatter_mime_types; -} - static void e_mail_formatter_quote_attachment_class_init (EMailFormatterQuoteAttachmentClass *class) { @@ -155,7 +151,7 @@ e_mail_formatter_quote_formatter_extension_interface_init (EMailFormatterExtensi static void e_mail_formatter_quote_mail_extension_interface_init (EMailExtensionInterface *iface) { - iface->mime_types = emfqe_attachment_mime_types; + iface->mime_types = formatter_mime_types; } static void diff --git a/em-format/e-mail-formatter-quote-headers.c b/em-format/e-mail-formatter-quote-headers.c index 9d0ea33d2d..368245c931 100644 --- a/em-format/e-mail-formatter-quote-headers.c +++ b/em-format/e-mail-formatter-quote-headers.c @@ -43,8 +43,6 @@ typedef struct _EMailFormatterQuoteHeadersClass { GObjectClass parent_class; } EMailFormatterQuoteHeadersClass; -static const gchar *formatter_mime_types[] = { "application/vnd.evolution.headers", NULL }; - static void e_mail_formatter_quote_formatter_extension_interface_init (EMailFormatterExtensionInterface *iface); static void e_mail_formatter_quote_mail_extension_interface_init @@ -62,6 +60,11 @@ G_DEFINE_TYPE_EXTENDED ( E_TYPE_MAIL_FORMATTER_EXTENSION, e_mail_formatter_quote_formatter_extension_interface_init)) +static const gchar *formatter_mime_types[] = { + "application/vnd.evolution.headers", + NULL +}; + static void emfqe_format_text_header (EMailFormatter *emf, GString *buffer, @@ -258,12 +261,6 @@ emqfe_headers_get_description (EMailFormatterExtension *extension) return NULL; } -static const gchar ** -emqfe_headers_mime_types (EMailExtension *extension) -{ - return formatter_mime_types; -} - static void e_mail_formatter_quote_headers_class_init (EMailFormatterQuoteHeadersClass *class) { @@ -280,7 +277,7 @@ e_mail_formatter_quote_formatter_extension_interface_init (EMailFormatterExtensi static void e_mail_formatter_quote_mail_extension_interface_init (EMailExtensionInterface *iface) { - iface->mime_types = emqfe_headers_mime_types; + iface->mime_types = formatter_mime_types; } static void diff --git a/em-format/e-mail-formatter-quote-message-rfc822.c b/em-format/e-mail-formatter-quote-message-rfc822.c index 2bb8de9eb2..d1b5ae5b68 100644 --- a/em-format/e-mail-formatter-quote-message-rfc822.c +++ b/em-format/e-mail-formatter-quote-message-rfc822.c @@ -35,10 +35,6 @@ #include <string.h> -static const gchar * formatter_mime_types[] = { "message/rfc822", - "application/vnd.evolution.rfc822.end", - NULL }; - typedef struct _EMailFormatterQuoteMessageRFC822 { GObject parent; } EMailFormatterQuoteMessageRFC822; @@ -62,6 +58,12 @@ G_DEFINE_TYPE_EXTENDED ( E_TYPE_MAIL_FORMATTER_EXTENSION, e_mail_formatter_quote_formatter_extension_interface_init)); +static const gchar *formatter_mime_types[] = { + "message/rfc822", + "application/vnd.evolution.rfc822.end", + NULL +}; + static gboolean emfqe_message_rfc822_format (EMailFormatterExtension *extension, EMailFormatter *formatter, @@ -161,12 +163,6 @@ emfqe_message_rfc822_get_description (EMailFormatterExtension *extension) return NULL; } -static const gchar ** -emfqe_message_rfc822_mime_types (EMailExtension *extension) -{ - return formatter_mime_types; -} - static void e_mail_formatter_quote_message_rfc822_class_init (EMailFormatterQuoteMessageRFC822Class *class) { @@ -183,7 +179,7 @@ e_mail_formatter_quote_formatter_extension_interface_init (EMailFormatterExtensi static void e_mail_formatter_quote_mail_extension_interface_init (EMailExtensionInterface *iface) { - iface->mime_types = emfqe_message_rfc822_mime_types; + iface->mime_types = formatter_mime_types; } static void diff --git a/em-format/e-mail-formatter-quote-text-enriched.c b/em-format/e-mail-formatter-quote-text-enriched.c index 9768259c02..68d19ab633 100644 --- a/em-format/e-mail-formatter-quote-text-enriched.c +++ b/em-format/e-mail-formatter-quote-text-enriched.c @@ -30,10 +30,6 @@ #include <glib/gi18n-lib.h> #include <camel/camel.h> -static const gchar *formatter_mime_types[] = { "text/enriched", - "text/richtext", - NULL }; - typedef struct _EMailFormatterQuoteTextEnriched { GObject parent; } EMailFormatterQuoteTextEnriched; @@ -59,6 +55,12 @@ G_DEFINE_TYPE_EXTENDED ( E_TYPE_MAIL_FORMATTER_EXTENSION, e_mail_formatter_quote_formatter_extension_interace_init)); +static const gchar *formatter_mime_types[] = { + "text/enriched", + "text/richtext", + NULL +}; + static gboolean emqfe_text_enriched_format (EMailFormatterExtension *extension, EMailFormatter *formatter, @@ -108,12 +110,6 @@ emqfe_text_enriched_get_description (EMailFormatterExtension *extension) return _("Display part as enriched text"); } -static const gchar ** -emqfe_text_enriched_mime_types (EMailExtension *extension) -{ - return formatter_mime_types; -} - static void e_mail_formatter_quote_text_enriched_class_init (EMailFormatterQuoteTextEnrichedClass *class) { @@ -130,7 +126,7 @@ e_mail_formatter_quote_formatter_extension_interace_init (EMailFormatterExtensio static void e_mail_formatter_quote_mail_extension_interface_init (EMailExtensionInterface *iface) { - iface->mime_types = emqfe_text_enriched_mime_types; + iface->mime_types = formatter_mime_types; } static void diff --git a/em-format/e-mail-formatter-quote-text-html.c b/em-format/e-mail-formatter-quote-text-html.c index 21cb444818..d592150c28 100644 --- a/em-format/e-mail-formatter-quote-text-html.c +++ b/em-format/e-mail-formatter-quote-text-html.c @@ -33,8 +33,6 @@ #include <string.h> -static const gchar *formatter_mime_types[] = { "text/html", NULL }; - typedef struct _EMailFormatterQuoteTextHTML { GObject parent; } EMailFormatterQuoteTextHTML; @@ -60,6 +58,11 @@ G_DEFINE_TYPE_EXTENDED ( E_TYPE_MAIL_FORMATTER_EXTENSION, e_mail_formatter_quote_formatter_extension_interface_init)); +static const gchar *formatter_mime_types[] = { + "text/html", + NULL +}; + static gboolean emqfe_text_html_format (EMailFormatterExtension *extension, EMailFormatter *formatter, @@ -110,12 +113,6 @@ emqfe_text_html_get_description (EMailFormatterExtension *extension) return _("Format part as HTML"); } -static const gchar ** -emqfe_text_html_mime_types (EMailExtension *extension) -{ - return formatter_mime_types; -} - static void e_mail_formatter_quote_text_html_class_init (EMailFormatterQuoteTextHTMLClass *class) { @@ -132,7 +129,7 @@ e_mail_formatter_quote_formatter_extension_interface_init (EMailFormatterExtensi static void e_mail_formatter_quote_mail_extension_interface_init (EMailExtensionInterface *iface) { - iface->mime_types = emqfe_text_html_mime_types; + iface->mime_types = formatter_mime_types; } static void diff --git a/em-format/e-mail-formatter-quote-text-plain.c b/em-format/e-mail-formatter-quote-text-plain.c index 4da491cf8e..584c6d1aeb 100644 --- a/em-format/e-mail-formatter-quote-text-plain.c +++ b/em-format/e-mail-formatter-quote-text-plain.c @@ -31,8 +31,6 @@ #include <glib/gi18n-lib.h> #include <camel/camel.h> -static const gchar *formatter_mime_types[] = { "text/plain", NULL }; - typedef struct _EMailFormatterQuoteTextPlain { GObject parent; } EMailFormatterQuoteTextPlain; @@ -58,6 +56,11 @@ G_DEFINE_TYPE_EXTENDED ( E_TYPE_MAIL_FORMATTER_EXTENSION, e_mail_formatter_quote_formatter_extension_interface_init)); +static const gchar *formatter_mime_types[] = { + "text/plain", + NULL +}; + static gboolean emqfe_text_plain_format (EMailFormatterExtension *extension, EMailFormatter *formatter, @@ -129,12 +132,6 @@ emqfe_text_plain_get_description (EMailFormatterExtension *extension) return _("Format part as plain text"); } -static const gchar ** -emqfe_text_plain_mime_types (EMailExtension *extension) -{ - return formatter_mime_types; -} - static void e_mail_formatter_quote_text_plain_class_init (EMailFormatterQuoteTextPlainClass *class) { @@ -151,7 +148,7 @@ e_mail_formatter_quote_formatter_extension_interface_init (EMailFormatterExtensi static void e_mail_formatter_quote_mail_extension_interface_init (EMailExtensionInterface *iface) { - iface->mime_types = emqfe_text_plain_mime_types; + iface->mime_types = formatter_mime_types; } static void diff --git a/em-format/e-mail-formatter-secure-button.c b/em-format/e-mail-formatter-secure-button.c index 8d6df161fd..6c41467c7c 100644 --- a/em-format/e-mail-formatter-secure-button.c +++ b/em-format/e-mail-formatter-secure-button.c @@ -57,7 +57,10 @@ G_DEFINE_TYPE_EXTENDED ( E_TYPE_MAIL_FORMATTER_EXTENSION, e_mail_formatter_formatter_extension_interface_init)); -static const gchar *formatter_mime_types[] = { "application/vnd.evolution.widget.secure-button", NULL }; +static const gchar *formatter_mime_types[] = { + "application/vnd.evolution.widget.secure-button", + NULL +}; static const struct { const gchar *icon, *shortdesc, *description; @@ -483,12 +486,6 @@ emfe_secure_button_get_description (EMailFormatterExtension *extension) return NULL; } -static const gchar ** -emfe_secure_button_mime_types (EMailExtension *extension) -{ - return formatter_mime_types; -} - static void e_mail_formatter_secure_button_class_init (EMailFormatterSecureButtonClass *class) { @@ -506,7 +503,7 @@ e_mail_formatter_formatter_extension_interface_init (EMailFormatterExtensionInte static void e_mail_formatter_mail_extension_interface_init (EMailExtensionInterface *iface) { - iface->mime_types = emfe_secure_button_mime_types; + iface->mime_types = formatter_mime_types; } static void diff --git a/em-format/e-mail-formatter-source.c b/em-format/e-mail-formatter-source.c index c9d4e17890..becf1a81b5 100644 --- a/em-format/e-mail-formatter-source.c +++ b/em-format/e-mail-formatter-source.c @@ -54,7 +54,10 @@ G_DEFINE_TYPE_EXTENDED ( e_mail_formatter_formatter_extension_interface_init) ) -static const gchar *formatter_mime_types[] = { "application/vnd.evolution.source", NULL }; +static const gchar *formatter_mime_types[] = { + "application/vnd.evolution.source", + NULL +}; static gboolean emfe_source_format (EMailFormatterExtension *extension, @@ -146,12 +149,6 @@ emfe_source_get_description (EMailFormatterExtension *extension) return _("Display source of a MIME part"); } -static const gchar ** -emfe_source_mime_types (EMailExtension *extension) -{ - return formatter_mime_types; -} - static void e_mail_formatter_source_class_init (EMailFormatterSourceClass *class) { @@ -168,7 +165,7 @@ e_mail_formatter_formatter_extension_interface_init (EMailFormatterExtensionInte static void e_mail_formatter_mail_extension_interface_init (EMailExtensionInterface *iface) { - iface->mime_types = emfe_source_mime_types; + iface->mime_types = formatter_mime_types; } static void diff --git a/em-format/e-mail-formatter-text-enriched.c b/em-format/e-mail-formatter-text-enriched.c index 344d7a62a6..ca24c354dd 100644 --- a/em-format/e-mail-formatter-text-enriched.c +++ b/em-format/e-mail-formatter-text-enriched.c @@ -30,9 +30,11 @@ #include <glib/gi18n-lib.h> #include <camel/camel.h> -static const gchar *formatter_mime_types[] = { "text/enriched", - "text/richtext", - NULL }; +static const gchar *formatter_mime_types[] = { + "text/enriched", + "text/richtext", + NULL +}; typedef struct _EMailFormatterTextEnriched { GObject parent; @@ -122,12 +124,6 @@ emfe_text_enriched_get_description (EMailFormatterExtension *extension) return _("Display part as enriched text"); } -static const gchar ** -emfe_text_enriched_mime_types (EMailExtension *extension) -{ - return formatter_mime_types; -} - static void e_mail_formatter_text_enriched_class_init (EMailFormatterTextEnrichedClass *class) { @@ -144,7 +140,7 @@ e_mail_formatter_formatter_extension_interace_init (EMailFormatterExtensionInter static void e_mail_formatter_mail_extension_interface_init (EMailExtensionInterface *iface) { - iface->mime_types = emfe_text_enriched_mime_types; + iface->mime_types = formatter_mime_types; } static void diff --git a/em-format/e-mail-formatter-text-html.c b/em-format/e-mail-formatter-text-html.c index eef51d4bad..838de92a92 100644 --- a/em-format/e-mail-formatter-text-html.c +++ b/em-format/e-mail-formatter-text-html.c @@ -34,7 +34,10 @@ #include <ctype.h> #include <string.h> -static const gchar *formatter_mime_types[] = { "text/html", NULL }; +static const gchar *formatter_mime_types[] = { + "text/html", + NULL +}; typedef struct _EMailFormatterTextHTML { GObject parent; @@ -360,12 +363,6 @@ emfe_text_html_get_description (EMailFormatterExtension *extension) return _("Format part as HTML"); } -static const gchar ** -emfe_text_html_mime_types (EMailExtension *extension) -{ - return formatter_mime_types; -} - static void e_mail_formatter_text_html_class_init (EMailFormatterTextHTMLClass *class) { @@ -382,7 +379,7 @@ e_mail_formatter_formatter_extension_interface_init (EMailFormatterExtensionInte static void e_mail_formatter_mail_extension_interface_init (EMailExtensionInterface *iface) { - iface->mime_types = emfe_text_html_mime_types; + iface->mime_types = formatter_mime_types; } static void diff --git a/em-format/e-mail-formatter-text-plain.c b/em-format/e-mail-formatter-text-plain.c index c5770f017a..4fc01187ce 100644 --- a/em-format/e-mail-formatter-text-plain.c +++ b/em-format/e-mail-formatter-text-plain.c @@ -31,11 +31,13 @@ #include <glib/gi18n-lib.h> #include <camel/camel.h> -static const gchar *formatter_mime_types[] = { "text/plain", - "text/*", - "message/*", - "application/vnd.evolution.plaintext", - NULL }; +static const gchar *formatter_mime_types[] = { + "text/plain", + "text/*", + "message/*", + "application/vnd.evolution.plaintext", + NULL +}; typedef struct _EMailFormatterTextPlain { GObject parent; @@ -196,12 +198,6 @@ emfe_text_plain_get_description (EMailFormatterExtension *extension) return _("Format part as plain text"); } -static const gchar ** -emfe_text_plain_mime_types (EMailExtension *extension) -{ - return formatter_mime_types; -} - static void e_mail_formatter_text_plain_class_init (EMailFormatterTextPlainClass *class) { @@ -218,7 +214,7 @@ e_mail_formatter_formatter_extension_interface_init (EMailFormatterExtensionInte static void e_mail_formatter_mail_extension_interface_init (EMailExtensionInterface *iface) { - iface->mime_types = emfe_text_plain_mime_types; + iface->mime_types = formatter_mime_types; } static void diff --git a/em-format/e-mail-parser-application-mbox.c b/em-format/e-mail-parser-application-mbox.c index 35eedf9a5e..d7b41b0c86 100644 --- a/em-format/e-mail-parser-application-mbox.c +++ b/em-format/e-mail-parser-application-mbox.c @@ -57,8 +57,10 @@ G_DEFINE_TYPE_EXTENDED ( E_TYPE_MAIL_PARSER_EXTENSION, e_mail_parser_parser_extension_interface_init)); -static const gchar * parser_mime_types[] = { "application/mbox", - NULL }; +static const gchar *parser_mime_types[] = { + "application/mbox", + NULL +}; static gboolean empe_app_mbox_parse (EMailParserExtension *extension, @@ -180,12 +182,6 @@ empe_app_mbox_get_flags (EMailParserExtension *extension) E_MAIL_PARSER_EXTENSION_COMPOUND_TYPE; } -static const gchar ** -empe_app_mbox_mime_types (EMailExtension *extension) -{ - return parser_mime_types; -} - static void e_mail_parser_application_mbox_class_init (EMailParserApplicationMBoxClass *class) { @@ -201,7 +197,7 @@ e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *in static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *interface) { - interface->mime_types = empe_app_mbox_mime_types; + interface->mime_types = parser_mime_types; } static void diff --git a/em-format/e-mail-parser-application-smime.c b/em-format/e-mail-parser-application-smime.c index 919af9d1f2..ba47fdf736 100644 --- a/em-format/e-mail-parser-application-smime.c +++ b/em-format/e-mail-parser-application-smime.c @@ -57,13 +57,15 @@ G_DEFINE_TYPE_EXTENDED ( E_TYPE_MAIL_PARSER_EXTENSION, e_mail_parser_parser_extension_interface_init)); -static const gchar * parser_mime_types[] = { "application/xpkcs7mime", - "application/x-pkcs7-mime", - "application/pkcs7-mime", - "application/pkcs7-signature", - "application/xpkcs7-signature", - "application/x-pkcs7-signature", - NULL }; +static const gchar *parser_mime_types[] = { + "application/xpkcs7mime", + "application/x-pkcs7-mime", + "application/pkcs7-mime", + "application/pkcs7-signature", + "application/xpkcs7-signature", + "application/x-pkcs7-signature", + NULL +}; static gboolean empe_app_smime_parse (EMailParserExtension *extension, @@ -169,12 +171,6 @@ empe_app_smime_get_flags (EMailParserExtension *extension) return E_MAIL_PARSER_EXTENSION_INLINE; } -static const gchar ** -empe_application_smime_mime_types (EMailExtension *extension) -{ - return parser_mime_types; -} - static void e_mail_parser_application_smime_class_init (EMailParserApplicationSMIMEClass *class) { @@ -190,7 +186,7 @@ e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *in static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *interface) { - interface->mime_types = empe_application_smime_mime_types; + interface->mime_types = parser_mime_types; } static void diff --git a/em-format/e-mail-parser-attachment-bar.c b/em-format/e-mail-parser-attachment-bar.c index f8c45fb327..a2b8ddd0be 100644 --- a/em-format/e-mail-parser-attachment-bar.c +++ b/em-format/e-mail-parser-attachment-bar.c @@ -65,7 +65,10 @@ G_DEFINE_TYPE_EXTENDED ( E_TYPE_MAIL_PARSER_EXTENSION, e_mail_parser_parser_extension_interface_init)) -static const gchar *parser_mime_types[] = { "application/vnd.evolution.widget.attachment-bar", NULL }; +static const gchar *parser_mime_types[] = { + "application/vnd.evolution.widget.attachment-bar", + NULL +}; static gboolean empe_attachment_bar_parse (EMailParserExtension *extension, @@ -92,12 +95,6 @@ empe_attachment_bar_parse (EMailParserExtension *extension, return TRUE; } -static const gchar ** -empe_attachment_bar_mime_types (EMailExtension *extension) -{ - return parser_mime_types; -} - static void e_mail_parser_attachment_bar_class_init (EMailParserAttachmentBarClass *class) { @@ -112,7 +109,7 @@ e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *if static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface) { - iface->mime_types = empe_attachment_bar_mime_types; + iface->mime_types = parser_mime_types; } static void diff --git a/em-format/e-mail-parser-headers.c b/em-format/e-mail-parser-headers.c index edb6de4407..366cedd4d2 100644 --- a/em-format/e-mail-parser-headers.c +++ b/em-format/e-mail-parser-headers.c @@ -56,7 +56,10 @@ G_DEFINE_TYPE_EXTENDED ( E_TYPE_MAIL_PARSER_EXTENSION, e_mail_parser_parser_extension_interface_init)); -static const gchar *parser_mime_types[] = { "application/vnd.evolution.headers", NULL }; +static const gchar *parser_mime_types[] = { + "application/vnd.evolution.headers", + NULL +}; static void empe_headers_bind_dom (EMailPart *part, @@ -112,12 +115,6 @@ empe_headers_parse (EMailParserExtension *extension, return TRUE; } -static const gchar ** -empe_headers_mime_types (EMailExtension *extension) -{ - return parser_mime_types; -} - static void e_mail_parser_headers_class_init (EMailParserHeadersClass *class) { @@ -132,7 +129,7 @@ e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *if static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface) { - iface->mime_types = empe_headers_mime_types; + iface->mime_types = parser_mime_types; } static void diff --git a/em-format/e-mail-parser-image.c b/em-format/e-mail-parser-image.c index 12242746f2..d2ca8d69d0 100644 --- a/em-format/e-mail-parser-image.c +++ b/em-format/e-mail-parser-image.c @@ -53,23 +53,25 @@ G_DEFINE_TYPE_EXTENDED ( E_TYPE_MAIL_PARSER_EXTENSION, e_mail_parser_parser_extension_interface_init)); -static const gchar *parser_mime_types[] = { "image/gif", - "image/jpeg", - "image/png", - "image/x-png", - "image/x-bmp", - "image/bmp", - "image/svg", - "image/x-cmu-raster", - "image/x-ico", - "image/x-portable-anymap", - "image/x-portable-bitmap", - "image/x-portable-graymap", - "image/x-portable-pixmap", - "image/x-xpixmap", - "image/jpg", - "image/pjpeg", - NULL }; +static const gchar *parser_mime_types[] = { + "image/gif", + "image/jpeg", + "image/png", + "image/x-png", + "image/x-bmp", + "image/bmp", + "image/svg", + "image/x-cmu-raster", + "image/x-ico", + "image/x-portable-anymap", + "image/x-portable-bitmap", + "image/x-portable-graymap", + "image/x-portable-pixmap", + "image/x-xpixmap", + "image/jpg", + "image/pjpeg", + NULL +}; static gboolean empe_image_parse (EMailParserExtension *extension, @@ -117,12 +119,6 @@ empe_image_parse (EMailParserExtension *extension, return TRUE; } -static const gchar ** -empe_image_mime_types (EMailExtension *extension) -{ - return parser_mime_types; -} - static void e_mail_parser_image_class_init (EMailParserImageClass *class) { @@ -137,7 +133,7 @@ e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *if static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface) { - iface->mime_types = empe_image_mime_types; + iface->mime_types = parser_mime_types; } static void diff --git a/em-format/e-mail-parser-inlinepgp-encrypted.c b/em-format/e-mail-parser-inlinepgp-encrypted.c index ce3f372cc1..6a8ff8e1e1 100644 --- a/em-format/e-mail-parser-inlinepgp-encrypted.c +++ b/em-format/e-mail-parser-inlinepgp-encrypted.c @@ -55,8 +55,10 @@ G_DEFINE_TYPE_EXTENDED ( E_TYPE_MAIL_PARSER_EXTENSION, e_mail_parser_parser_extension_interface_init)); -static const gchar * parser_mime_types[] = { "application/x-inlinepgp-encrypted", - NULL }; +static const gchar *parser_mime_types[] = { + "application/x-inlinepgp-encrypted", + NULL +}; static gboolean empe_inlinepgp_encrypted_parse (EMailParserExtension *extension, @@ -173,12 +175,6 @@ empe_inlinepgp_encrypted_parse (EMailParserExtension *extension, return TRUE; } -static const gchar ** -empe_inlinepgp_encrypted_mime_types (EMailExtension *extension) -{ - return parser_mime_types; -} - static void e_mail_parser_inline_pgp_encrypted_class_init (EMailParserInlinePGPEncryptedClass *class) { @@ -193,7 +189,7 @@ e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *if static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface) { - iface->mime_types = empe_inlinepgp_encrypted_mime_types; + iface->mime_types = parser_mime_types; } static void diff --git a/em-format/e-mail-parser-inlinepgp-signed.c b/em-format/e-mail-parser-inlinepgp-signed.c index 723acc23cf..dc8f4aa31f 100644 --- a/em-format/e-mail-parser-inlinepgp-signed.c +++ b/em-format/e-mail-parser-inlinepgp-signed.c @@ -55,8 +55,10 @@ G_DEFINE_TYPE_EXTENDED ( E_TYPE_MAIL_PARSER_EXTENSION, e_mail_parser_parser_extension_interface_init)); -static const gchar * parser_mime_types[] = { "application/x-inlinepgp-signed", - NULL }; +static const gchar *parser_mime_types[] = { + "application/x-inlinepgp-signed", + NULL +}; static gboolean empe_inlinepgp_signed_parse (EMailParserExtension *extension, @@ -197,12 +199,6 @@ empe_inlinepgp_signed_parse (EMailParserExtension *extension, return TRUE; } -static const gchar ** -empe_inlinepgp_signed_mime_types (EMailExtension *extension) -{ - return parser_mime_types; -} - static void e_mail_parser_inline_pgp_signed_class_init (EMailParserInlinePGPSignedClass *class) { @@ -217,7 +213,7 @@ e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *if static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface) { - iface->mime_types = empe_inlinepgp_signed_mime_types; + iface->mime_types = parser_mime_types; } static void diff --git a/em-format/e-mail-parser-message-deliverystatus.c b/em-format/e-mail-parser-message-deliverystatus.c index f219a9745c..6bec6e64ef 100644 --- a/em-format/e-mail-parser-message-deliverystatus.c +++ b/em-format/e-mail-parser-message-deliverystatus.c @@ -55,10 +55,12 @@ G_DEFINE_TYPE_EXTENDED ( E_TYPE_MAIL_PARSER_EXTENSION, e_mail_parser_parser_extension_interface_init)); -static const gchar * parser_mime_types[] = { "message/delivery-status", - "message/feedback-report", - "message/disposition-notification", - NULL }; +static const gchar *parser_mime_types[] = { + "message/delivery-status", + "message/feedback-report", + "message/disposition-notification", + NULL +}; static gboolean empe_msg_deliverystatus_parse (EMailParserExtension *extension, @@ -90,12 +92,6 @@ empe_msg_deliverystatus_parse (EMailParserExtension *extension, return TRUE; } -static const gchar ** -empe_msg_deliverystatus_mime_types (EMailExtension *extension) -{ - return parser_mime_types; -} - static void e_mail_parser_message_delivery_status_class_init (EMailParserMessageDeliveryStatusClass *class) { @@ -110,7 +106,7 @@ e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *if static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface) { - iface->mime_types = empe_msg_deliverystatus_mime_types; + iface->mime_types = parser_mime_types; } static void diff --git a/em-format/e-mail-parser-message-external.c b/em-format/e-mail-parser-message-external.c index 5768e6e34c..79bbfd7247 100644 --- a/em-format/e-mail-parser-message-external.c +++ b/em-format/e-mail-parser-message-external.c @@ -55,8 +55,10 @@ G_DEFINE_TYPE_EXTENDED ( E_TYPE_MAIL_PARSER_EXTENSION, e_mail_parser_parser_extension_interface_init)); -static const gchar * parser_mime_types[] = { "message/external-body", - NULL }; +static const gchar *parser_mime_types[] = { + "message/external-body", + NULL +}; static gboolean empe_msg_external_parse (EMailParserExtension *extension, @@ -180,12 +182,6 @@ addPart: return TRUE; } -static const gchar ** -empe_msg_external_mime_types (EMailExtension *extension) -{ - return parser_mime_types; -} - static void e_mail_parser_message_external_class_init (EMailParserMessageExternalClass *class) { @@ -200,7 +196,7 @@ e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *if static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface) { - iface->mime_types = empe_msg_external_mime_types; + iface->mime_types = parser_mime_types; } static void diff --git a/em-format/e-mail-parser-message-rfc822.c b/em-format/e-mail-parser-message-rfc822.c index 70bf8c89ed..8ddf4806b9 100644 --- a/em-format/e-mail-parser-message-rfc822.c +++ b/em-format/e-mail-parser-message-rfc822.c @@ -58,9 +58,11 @@ G_DEFINE_TYPE_EXTENDED ( E_TYPE_MAIL_PARSER_EXTENSION, e_mail_parser_parser_extension_interface_init)); -static const gchar * parser_mime_types[] = { "message/rfc822", - "message/news", - NULL }; +static const gchar *parser_mime_types[] = { + "message/rfc822", + "message/news", + NULL +}; static gboolean empe_msg_rfc822_parse (EMailParserExtension *extension, @@ -143,12 +145,6 @@ empe_msg_rfc822_get_flags (EMailParserExtension *extension) E_MAIL_PARSER_EXTENSION_COMPOUND_TYPE; } -static const gchar ** -empe_msg_rfc822_mime_types (EMailExtension *extension) -{ - return parser_mime_types; -} - static void e_mail_parser_message_rfc822_class_init (EMailParserMessageRFC822Class *class) { @@ -164,7 +160,7 @@ e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *if static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface) { - iface->mime_types = empe_msg_rfc822_mime_types; + iface->mime_types = parser_mime_types; } static void diff --git a/em-format/e-mail-parser-message.c b/em-format/e-mail-parser-message.c index df7d4b3320..dcb9d998af 100644 --- a/em-format/e-mail-parser-message.c +++ b/em-format/e-mail-parser-message.c @@ -57,7 +57,10 @@ G_DEFINE_TYPE_EXTENDED ( E_TYPE_MAIL_PARSER_EXTENSION, e_mail_parser_parser_extension_interface_init)); -static const gchar *parser_mime_types[] = { "application/vnd.evolution.message", NULL }; +static const gchar *parser_mime_types[] = { + "application/vnd.evolution.message", + NULL +}; static gboolean empe_message_parse (EMailParserExtension *extension, @@ -109,12 +112,6 @@ empe_message_parse (EMailParserExtension *extension, return TRUE; } -static const gchar ** -empe_message_mime_types (EMailExtension *extension) -{ - return parser_mime_types; -} - static void e_mail_parser_message_class_init (EMailParserMessageClass *class) { @@ -129,7 +126,7 @@ e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *if static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface) { - iface->mime_types = empe_message_mime_types; + iface->mime_types = parser_mime_types; } static void diff --git a/em-format/e-mail-parser-multipart-alternative.c b/em-format/e-mail-parser-multipart-alternative.c index de4261bf0c..ca7fbddd57 100644 --- a/em-format/e-mail-parser-multipart-alternative.c +++ b/em-format/e-mail-parser-multipart-alternative.c @@ -54,7 +54,10 @@ G_DEFINE_TYPE_EXTENDED ( E_TYPE_MAIL_PARSER_EXTENSION, e_mail_parser_parser_extension_interface_init)); -static const gchar * parser_mime_types[] = { "multipart/alternative", NULL }; +static const gchar *parser_mime_types[] = { + "multipart/alternative", + NULL +}; static gboolean related_display_part_is_attachment (CamelMimePart *part) @@ -158,12 +161,6 @@ empe_mp_alternative_parse (EMailParserExtension *extension, return TRUE; } -static const gchar ** -empe_mp_alternative_mime_types (EMailExtension *extension) -{ - return parser_mime_types; -} - static void e_mail_parser_multipart_alternative_class_init (EMailParserMultipartAlternativeClass *class) { @@ -178,7 +175,7 @@ e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *if static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface) { - iface->mime_types = empe_mp_alternative_mime_types; + iface->mime_types = parser_mime_types; } static void diff --git a/em-format/e-mail-parser-multipart-appledouble.c b/em-format/e-mail-parser-multipart-appledouble.c index 297ded6243..08ea90faea 100644 --- a/em-format/e-mail-parser-multipart-appledouble.c +++ b/em-format/e-mail-parser-multipart-appledouble.c @@ -50,7 +50,10 @@ G_DEFINE_TYPE_EXTENDED ( E_TYPE_MAIL_PARSER_EXTENSION, e_mail_parser_parser_extension_interface_init)); -static const gchar * parser_mime_types[] = { "multipart/appledouble", NULL }; +static const gchar *parser_mime_types[] = { + "multipart/appledouble", + NULL +}; static gboolean empe_mp_appledouble_parse (EMailParserExtension *extension, @@ -96,12 +99,6 @@ empe_mp_appledouble_parse (EMailParserExtension *extension, return TRUE; } -static const gchar ** -empe_mp_appledouble_mime_types (EMailExtension *extension) -{ - return parser_mime_types; -} - static void e_mail_parser_multipart_apple_double_class_init (EMailParserMultipartAppleDoubleClass *class) { @@ -116,7 +113,7 @@ e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *if static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface) { - iface->mime_types = empe_mp_appledouble_mime_types; + iface->mime_types = parser_mime_types; } static void diff --git a/em-format/e-mail-parser-multipart-digest.c b/em-format/e-mail-parser-multipart-digest.c index 70f5eebda0..ed6a6daa63 100644 --- a/em-format/e-mail-parser-multipart-digest.c +++ b/em-format/e-mail-parser-multipart-digest.c @@ -53,8 +53,10 @@ G_DEFINE_TYPE_EXTENDED ( E_TYPE_MAIL_PARSER_EXTENSION, e_mail_parser_parser_extension_interface_init)); -static const gchar * parser_mime_types[] = { "multipart/digest", - NULL }; +static const gchar *parser_mime_types[] = { + "multipart/digest", + NULL +}; static gboolean empe_mp_digest_parse (EMailParserExtension *extension, @@ -136,12 +138,6 @@ empe_mp_digest_get_flags (EMailParserExtension *extension) return E_MAIL_PARSER_EXTENSION_COMPOUND_TYPE; } -static const gchar ** -empe_mp_digest_mime_types (EMailExtension *extension) -{ - return parser_mime_types; -} - static void e_mail_parser_multipart_digest_class_init (EMailParserMultipartDigestClass *class) { @@ -157,7 +153,7 @@ e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *if static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface) { - iface->mime_types = empe_mp_digest_mime_types; + iface->mime_types = parser_mime_types; } static void diff --git a/em-format/e-mail-parser-multipart-encrypted.c b/em-format/e-mail-parser-multipart-encrypted.c index fedef393ef..bae8de5166 100644 --- a/em-format/e-mail-parser-multipart-encrypted.c +++ b/em-format/e-mail-parser-multipart-encrypted.c @@ -53,7 +53,10 @@ G_DEFINE_TYPE_EXTENDED ( E_TYPE_MAIL_PARSER_EXTENSION, e_mail_parser_parser_extension_interface_init)) -static const gchar * parser_mime_types[] = { "multipart/encrypted", NULL }; +static const gchar *parser_mime_types[] = { + "multipart/encrypted", + NULL +}; static gboolean empe_mp_encrypted_parse (EMailParserExtension *extension, @@ -182,12 +185,6 @@ empe_mp_encrypted_parse (EMailParserExtension *extension, return TRUE; } -static const gchar ** -empe_mp_encrypted_mime_types (EMailExtension *extension) -{ - return parser_mime_types; -} - static void e_mail_parser_multipart_encrypted_class_init (EMailParserMultipartEncryptedClass *class) { @@ -202,7 +199,7 @@ e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *if static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface) { - iface->mime_types = empe_mp_encrypted_mime_types; + iface->mime_types = parser_mime_types; } static void diff --git a/em-format/e-mail-parser-multipart-mixed.c b/em-format/e-mail-parser-multipart-mixed.c index f416ffda24..77feb71bcb 100644 --- a/em-format/e-mail-parser-multipart-mixed.c +++ b/em-format/e-mail-parser-multipart-mixed.c @@ -54,10 +54,12 @@ G_DEFINE_TYPE_EXTENDED ( E_TYPE_MAIL_PARSER_EXTENSION, e_mail_parser_parser_extension_interface_init)); -static const gchar * parser_mime_types[] = { "multipart/mixed", - "multipart/report", - "multipart/*", - NULL }; +static const gchar *parser_mime_types[] = { + "multipart/mixed", + "multipart/report", + "multipart/*", + NULL +}; static gboolean empe_mp_mixed_parse (EMailParserExtension *extension, @@ -134,12 +136,6 @@ empe_mp_mixed_get_flags (EMailParserExtension *extension) return E_MAIL_PARSER_EXTENSION_COMPOUND_TYPE; } -static const gchar ** -empe_mp_mixed_mime_types (EMailExtension *extension) -{ - return parser_mime_types; -} - static void e_mail_parser_multipart_mixed_class_init (EMailParserMultipartMixedClass *class) { @@ -155,7 +151,7 @@ e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *if static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface) { - iface->mime_types = empe_mp_mixed_mime_types; + iface->mime_types = parser_mime_types; } static void diff --git a/em-format/e-mail-parser-multipart-related.c b/em-format/e-mail-parser-multipart-related.c index 0a368ea0c8..f9e893f060 100644 --- a/em-format/e-mail-parser-multipart-related.c +++ b/em-format/e-mail-parser-multipart-related.c @@ -54,8 +54,10 @@ G_DEFINE_TYPE_EXTENDED ( E_TYPE_MAIL_PARSER_EXTENSION, e_mail_parser_parser_extension_interface_init)); -static const gchar * parser_mime_types[] = { "multipart/related", - NULL }; +static const gchar *parser_mime_types[] = { + "multipart/related", + NULL +}; static gboolean empe_mp_related_parse (EMailParserExtension *extension, @@ -128,12 +130,6 @@ empe_mp_related_parse (EMailParserExtension *extension, return TRUE; } -static const gchar ** -empe_mp_related_mime_types (EMailExtension *extension) -{ - return parser_mime_types; -} - static void e_mail_parser_multipart_related_class_init (EMailParserMultipartRelatedClass *class) { @@ -148,7 +144,7 @@ e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *if static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface) { - iface->mime_types = empe_mp_related_mime_types; + iface->mime_types = parser_mime_types; } static void diff --git a/em-format/e-mail-parser-multipart-signed.c b/em-format/e-mail-parser-multipart-signed.c index 60fac35c7f..45b29ff8aa 100644 --- a/em-format/e-mail-parser-multipart-signed.c +++ b/em-format/e-mail-parser-multipart-signed.c @@ -53,9 +53,11 @@ G_DEFINE_TYPE_EXTENDED ( E_TYPE_MAIL_PARSER_EXTENSION, e_mail_parser_parser_extension_interface_init)); -static const gchar * parser_mime_types[] = { "multipart/signed", - "application/pgp-signature", - NULL }; +static const gchar *parser_mime_types[] = { + "multipart/signed", + "application/pgp-signature", + NULL +}; static gboolean empe_mp_signed_parse (EMailParserExtension *extension, @@ -217,12 +219,6 @@ empe_mp_signed_parse (EMailParserExtension *extension, return TRUE; } -static const gchar ** -empe_mp_signed_mime_types (EMailExtension *extension) -{ - return parser_mime_types; -} - static void e_mail_parser_multipart_signed_class_init (EMailParserMultipartSignedClass *class) { @@ -237,7 +233,7 @@ e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *if static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface) { - iface->mime_types = empe_mp_signed_mime_types; + iface->mime_types = parser_mime_types; } static void diff --git a/em-format/e-mail-parser-secure-button.c b/em-format/e-mail-parser-secure-button.c index cb4282cef0..4f49dd99a0 100644 --- a/em-format/e-mail-parser-secure-button.c +++ b/em-format/e-mail-parser-secure-button.c @@ -52,7 +52,10 @@ G_DEFINE_TYPE_EXTENDED ( E_TYPE_MAIL_PARSER_EXTENSION, e_mail_parser_parser_extension_interface_init)) -static const gchar *parser_mime_types[] = { "application/vnd.evolution.widget.secure-button", NULL }; +static const gchar *parser_mime_types[] = { + "application/vnd.evolution.widget.secure-button", + NULL +}; static gboolean empe_secure_button_parse (EMailParserExtension *extension, @@ -76,12 +79,6 @@ empe_secure_button_parse (EMailParserExtension *extension, return TRUE; } -static const gchar ** -empe_secure_button_mime_types (EMailExtension *extension) -{ - return parser_mime_types; -} - static void e_mail_parser_secure_button_class_init (EMailParserSecureButtonClass *class) { @@ -96,7 +93,7 @@ e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *if static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface) { - iface->mime_types = empe_secure_button_mime_types; + iface->mime_types = parser_mime_types; } static void diff --git a/em-format/e-mail-parser-source.c b/em-format/e-mail-parser-source.c index ee563acf9f..ce22b0805b 100644 --- a/em-format/e-mail-parser-source.c +++ b/em-format/e-mail-parser-source.c @@ -52,7 +52,10 @@ G_DEFINE_TYPE_EXTENDED ( E_TYPE_MAIL_PARSER_EXTENSION, e_mail_parser_parser_extension_interface_init)); -static const gchar *parser_mime_types[] = { "application/vnd.evolution.source", NULL }; +static const gchar *parser_mime_types[] = { + "application/vnd.evolution.source", + NULL +}; static gboolean empe_source_parse (EMailParserExtension *extension, @@ -77,12 +80,6 @@ empe_source_parse (EMailParserExtension *extension, return TRUE; } -static const gchar ** -empe_source_mime_types (EMailExtension *extension) -{ - return parser_mime_types; -} - static void e_mail_parser_source_class_init (EMailParserSourceClass *class) { @@ -97,7 +94,7 @@ e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *if static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface) { - iface->mime_types = empe_source_mime_types; + iface->mime_types = parser_mime_types; } static void diff --git a/em-format/e-mail-parser-text-enriched.c b/em-format/e-mail-parser-text-enriched.c index 34a64c38f0..503176ff6c 100644 --- a/em-format/e-mail-parser-text-enriched.c +++ b/em-format/e-mail-parser-text-enriched.c @@ -53,9 +53,11 @@ G_DEFINE_TYPE_EXTENDED ( E_TYPE_MAIL_PARSER_EXTENSION, e_mail_parser_parser_extension_interface_init)); -static const gchar *parser_mime_types[] = { "text/richtext", - "text/enriched", - NULL }; +static const gchar *parser_mime_types[] = { + "text/richtext", + "text/enriched", + NULL +}; static gboolean empe_text_enriched_parse (EMailParserExtension *extension, @@ -98,12 +100,6 @@ empe_text_enriched_parse (EMailParserExtension *extension, return TRUE; } -static const gchar ** -empe_text_enriched_mime_types (EMailExtension *extension) -{ - return parser_mime_types; -} - static void e_mail_parser_text_enriched_class_init (EMailParserTextEnrichedClass *class) { @@ -118,7 +114,7 @@ e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *if static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface) { - iface->mime_types = empe_text_enriched_mime_types; + iface->mime_types = parser_mime_types; } static void diff --git a/em-format/e-mail-parser-text-html.c b/em-format/e-mail-parser-text-html.c index a28a8ff5f0..98f359e573 100644 --- a/em-format/e-mail-parser-text-html.c +++ b/em-format/e-mail-parser-text-html.c @@ -55,7 +55,10 @@ G_DEFINE_TYPE_EXTENDED ( E_TYPE_MAIL_PARSER_EXTENSION, e_mail_parser_parser_extension_interface_init)); -static const gchar *parser_mime_types[] = { "text/html", NULL }; +static const gchar *parser_mime_types[] = { + "text/html", + NULL +}; static gboolean empe_text_html_parse (EMailParserExtension *extension, @@ -108,12 +111,6 @@ empe_text_html_parse (EMailParserExtension *extension, return TRUE; } -static const gchar ** -empe_text_html_mime_types (EMailExtension *extension) -{ - return parser_mime_types; -} - static void e_mail_parser_text_html_class_init (EMailParserTextHTMLClass *class) { @@ -128,7 +125,7 @@ e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *if static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface) { - iface->mime_types = empe_text_html_mime_types; + iface->mime_types = parser_mime_types; } static void diff --git a/em-format/e-mail-parser-text-plain.c b/em-format/e-mail-parser-text-plain.c index 4c9c0b36a5..0ed85c2806 100644 --- a/em-format/e-mail-parser-text-plain.c +++ b/em-format/e-mail-parser-text-plain.c @@ -55,7 +55,11 @@ G_DEFINE_TYPE_EXTENDED ( E_TYPE_MAIL_PARSER_EXTENSION, e_mail_parser_parser_extension_interface_init)); -static const gchar *parser_mime_types[] = { "text/plain", "text/*", NULL }; +static const gchar *parser_mime_types[] = { + "text/plain", + "text/*", + NULL +}; static gboolean part_is_empty (CamelMimePart *part) @@ -234,12 +238,6 @@ empe_text_plain_parse (EMailParserExtension *extension, return n_parts_added; } -static const gchar ** -empe_text_plain_mime_types (EMailExtension *extension) -{ - return parser_mime_types; -} - static void e_mail_parser_text_plain_class_init (EMailParserTextPlainClass *class) { @@ -254,7 +252,7 @@ e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *if static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface) { - iface->mime_types = empe_text_plain_mime_types; + iface->mime_types = parser_mime_types; } static void |