From 9d34f72ec1b99d58ee1c3a6d1a964a6dde166f79 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 6 Dec 2012 12:57:33 -0500 Subject: 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. --- modules/text-highlight/e-mail-formatter-text-highlight.c | 8 +------- modules/text-highlight/e-mail-parser-text-highlight.c | 8 +------- 2 files changed, 2 insertions(+), 14 deletions(-) (limited to 'modules/text-highlight') diff --git a/modules/text-highlight/e-mail-formatter-text-highlight.c b/modules/text-highlight/e-mail-formatter-text-highlight.c index 43c3a139c5..1400c9488d 100644 --- a/modules/text-highlight/e-mail-formatter-text-highlight.c +++ b/modules/text-highlight/e-mail-formatter-text-highlight.c @@ -376,12 +376,6 @@ emfe_text_highlight_get_description (EMailFormatterExtension *extension) return _("Syntax highlighting of mail parts"); } -static const gchar ** -emfe_text_highlight_mime_types (EMailExtension *extension) -{ - return get_mime_types (); -} - static void emfe_text_highlight_constructed (GObject *object) { @@ -434,5 +428,5 @@ e_mail_formatter_formatter_extension_interface_init (EMailFormatterExtensionInte static void e_mail_formatter_mail_extension_interface_init (EMailExtensionInterface *iface) { - iface->mime_types = emfe_text_highlight_mime_types; + iface->mime_types = get_mime_types (); } diff --git a/modules/text-highlight/e-mail-parser-text-highlight.c b/modules/text-highlight/e-mail-parser-text-highlight.c index eb56162a3d..a8c17fd812 100644 --- a/modules/text-highlight/e-mail-parser-text-highlight.c +++ b/modules/text-highlight/e-mail-parser-text-highlight.c @@ -98,12 +98,6 @@ empe_text_highlight_parse (EMailParserExtension *extension, return TRUE; } -static const gchar ** -empe_mime_types (EMailExtension *extension) -{ - return get_mime_types (); -} - void e_mail_parser_text_highlight_type_register (GTypeModule *type_module) { @@ -113,7 +107,7 @@ e_mail_parser_text_highlight_type_register (GTypeModule *type_module) static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface) { - iface->mime_types = empe_mime_types; + iface->mime_types = get_mime_types (); } static void -- cgit v1.2.3