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/vcard-inline/e-mail-formatter-vcard-inline.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'modules/vcard-inline/e-mail-formatter-vcard-inline.c') diff --git a/modules/vcard-inline/e-mail-formatter-vcard-inline.c b/modules/vcard-inline/e-mail-formatter-vcard-inline.c index 13e87139ac..7d2abfc626 100644 --- a/modules/vcard-inline/e-mail-formatter-vcard-inline.c +++ b/modules/vcard-inline/e-mail-formatter-vcard-inline.c @@ -60,8 +60,12 @@ G_DEFINE_DYNAMIC_TYPE_EXTENDED ( E_TYPE_MAIL_FORMATTER_EXTENSION, e_mail_formatter_formatter_extension_interface_init)); -static const gchar * formatter_mime_types[] = { "text/vcard", "text/x-vcard", - "text/directory", NULL }; +static const gchar *formatter_mime_types[] = { + "text/vcard", + "text/x-vcard", + "text/directory", + NULL +}; static gboolean emfe_vcard_inline_format (EMailFormatterExtension *extension, @@ -207,12 +211,6 @@ emfe_vcard_inline_get_description (EMailFormatterExtension *extension) return _("Display the part as an addressbook contact"); } -static const gchar ** -emfe_vcard_inline_mime_types (EMailExtension *extension) -{ - return formatter_mime_types; -} - static void e_mail_formatter_vcard_inline_constructed (GObject *object) { @@ -249,7 +247,7 @@ e_mail_formatter_formatter_extension_interface_init (EMailFormatterExtensionInte static void e_mail_formatter_mail_extension_interface_init (EMailExtensionInterface *iface) { - iface->mime_types = emfe_vcard_inline_mime_types; + iface->mime_types = formatter_mime_types; } static void -- cgit v1.2.3