diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2012-12-07 05:40:13 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2012-12-08 03:01:05 +0800 |
commit | 54455ca1ad6cae527544fed12d0de4ae95341082 (patch) | |
tree | b223d428459e3be79d1162d8217be6c2856f643b /modules/tnef-attachment | |
parent | 9d34f72ec1b99d58ee1c3a6d1a964a6dde166f79 (diff) | |
download | gsoc2013-evolution-54455ca1ad6cae527544fed12d0de4ae95341082.tar.gz gsoc2013-evolution-54455ca1ad6cae527544fed12d0de4ae95341082.tar.zst gsoc2013-evolution-54455ca1ad6cae527544fed12d0de4ae95341082.zip |
Remove EMailExtension.
EMailExtension is now too trivial to keep as a standalone interface.
Add a 'mime_types' string array to the EMailFormatterExtension and
EMailFormatterParser interface structs.
Alter e_mail_extension_registry_add_extension() to take a 'mime_types'
string array and the GType of an extension to instantiate, rather than
the extension instance directly.
e_mail_extension_registry_remove_extension() is no longer needed.
Diffstat (limited to 'modules/tnef-attachment')
-rw-r--r-- | modules/tnef-attachment/e-mail-parser-tnef-attachment.c | 67 |
1 files changed, 41 insertions, 26 deletions
diff --git a/modules/tnef-attachment/e-mail-parser-tnef-attachment.c b/modules/tnef-attachment/e-mail-parser-tnef-attachment.c index dda02e23b1..27d8c7019b 100644 --- a/modules/tnef-attachment/e-mail-parser-tnef-attachment.c +++ b/modules/tnef-attachment/e-mail-parser-tnef-attachment.c @@ -50,7 +50,7 @@ #define d(x) typedef struct _EMailParserTnefAttachment { - EExtension parent; + GObject parent; GSettings *settings; gint mode; @@ -58,25 +58,30 @@ typedef struct _EMailParserTnefAttachment { } EMailParserTnefAttachment; typedef struct _EMailParserTnefAttachmentClass { - EExtensionClass parent_class; + GObjectClass parent_class; } EMailParserTnefAttachmentClass; +typedef EExtension EMailParserTnefAttachmentLoader; +typedef EExtensionClass EMailParserTnefAttachmentLoaderClass; + GType e_mail_parser_tnef_attachment_get_type (void); -static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface); +GType e_mail_parser_tnef_attachment_loader_get_type (void); static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface); G_DEFINE_DYNAMIC_TYPE_EXTENDED ( EMailParserTnefAttachment, e_mail_parser_tnef_attachment, - E_TYPE_EXTENSION, + G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE_DYNAMIC ( - E_TYPE_MAIL_EXTENSION, - e_mail_parser_mail_extension_interface_init) - G_IMPLEMENT_INTERFACE_DYNAMIC ( E_TYPE_MAIL_PARSER_EXTENSION, e_mail_parser_parser_extension_interface_init)); +G_DEFINE_DYNAMIC_TYPE ( + EMailParserTnefAttachmentLoader, + e_mail_parser_tnef_attachment_loader, + E_TYPE_EXTENSION) + static const gchar *parser_mime_types[] = { "application/vnd.ms-tnef", "application/ms-tnefl", @@ -261,60 +266,70 @@ empe_tnef_attachment_parse (EMailParserExtension *extension, return TRUE; } -void -e_mail_parser_tnef_attachment_type_register (GTypeModule *type_module) +static void +e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface) { - e_mail_parser_tnef_attachment_register_type (type_module); + iface->mime_types = parser_mime_types; + iface->parse = empe_tnef_attachment_parse; } static void -e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface) +e_mail_parser_tnef_attachment_class_init (EMailParserTnefAttachmentClass *class) +{ +} + +void +e_mail_parser_tnef_attachment_class_finalize (EMailParserTnefAttachmentClass *class) { - iface->mime_types = parser_mime_types; } static void -e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface) +e_mail_parser_tnef_attachment_init (EMailParserTnefAttachment *parser) { - iface->parse = empe_tnef_attachment_parse; } static void -e_mail_parser_tnef_attachment_constructed (GObject *object) +mail_parser_tnef_attachment_loader_constructed (GObject *object) { EExtensible *extensible; - EMailExtensionRegistry *reg; extensible = e_extension_get_extensible (E_EXTENSION (object)); - reg = E_MAIL_EXTENSION_REGISTRY (extensible); - e_mail_extension_registry_add_extension (reg, E_MAIL_EXTENSION (object)); + e_mail_extension_registry_add_extension ( + E_MAIL_EXTENSION_REGISTRY (extensible), + parser_mime_types, + e_mail_parser_tnef_attachment_get_type ()); } static void -e_mail_parser_tnef_attachment_class_init (EMailParserTnefAttachmentClass *class) +e_mail_parser_tnef_attachment_loader_class_init (EExtensionClass *class) { GObjectClass *object_class; - EExtensionClass *extension_class; object_class = G_OBJECT_CLASS (class); - object_class->constructed = e_mail_parser_tnef_attachment_constructed; + object_class->constructed = mail_parser_tnef_attachment_loader_constructed; - extension_class = E_EXTENSION_CLASS (class); - extension_class->extensible_type = E_TYPE_MAIL_PARSER_EXTENSION_REGISTRY; + class->extensible_type = E_TYPE_MAIL_PARSER_EXTENSION_REGISTRY; } -void -e_mail_parser_tnef_attachment_class_finalize (EMailParserTnefAttachmentClass *class) +static void +e_mail_parser_tnef_attachment_loader_class_finalize (EExtensionClass *class) { } static void -e_mail_parser_tnef_attachment_init (EMailParserTnefAttachment *parser) +e_mail_parser_tnef_attachment_loader_init (EExtension *extension) { } void +e_mail_parser_tnef_attachment_type_register (GTypeModule *type_module) +{ + e_mail_parser_tnef_attachment_register_type (type_module); + e_mail_parser_tnef_attachment_loader_register_type (type_module); +} + +void processTnef (TNEFStruct *tnef, const gchar *tmpdir) { |