diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2012-12-08 01:32:32 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2012-12-08 03:01:05 +0800 |
commit | cab6eac8f14974ea1c2fedaf9143e98cf630c489 (patch) | |
tree | 38cd8e6e510b6c461f7537c64aea88a11c385f4f /em-format/e-mail-parser-source.c | |
parent | 3ae26f0ab68776e230a2be58939e5bf69c8fa2d5 (diff) | |
download | gsoc2013-evolution-cab6eac8f14974ea1c2fedaf9143e98cf630c489.tar.gz gsoc2013-evolution-cab6eac8f14974ea1c2fedaf9143e98cf630c489.tar.zst gsoc2013-evolution-cab6eac8f14974ea1c2fedaf9143e98cf630c489.zip |
Convert EMailParserExtension to an abstract class.
With the previous changes, all parser extensions derive from
GObjectClass and implement the EMailParserExtensionInterface.
Simplify things further by making EMailParserExtension an abstract base
class so parser extensions are now just direct subclasses and need not
bother with implementing GObject interfaces.
Diffstat (limited to 'em-format/e-mail-parser-source.c')
-rw-r--r-- | em-format/e-mail-parser-source.c | 33 |
1 files changed, 8 insertions, 25 deletions
diff --git a/em-format/e-mail-parser-source.c b/em-format/e-mail-parser-source.c index 1aef5fc074..b41fdccdf6 100644 --- a/em-format/e-mail-parser-source.c +++ b/em-format/e-mail-parser-source.c @@ -29,24 +29,13 @@ #include <glib/gi18n-lib.h> #include <camel/camel.h> -typedef struct _EMailParserSource { - GObject parent; -} EMailParserSource; +typedef EMailParserExtension EMailParserSource; +typedef EMailParserExtensionClass EMailParserSourceClass; -typedef struct _EMailParserSourceClass { - GObjectClass parent_class; -} EMailParserSourceClass; - -static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface); - -G_DEFINE_TYPE_EXTENDED ( +G_DEFINE_TYPE ( EMailParserSource, e_mail_parser_source, - G_TYPE_OBJECT, - 0, - G_IMPLEMENT_INTERFACE ( - E_TYPE_MAIL_PARSER_EXTENSION, - e_mail_parser_parser_extension_interface_init)); + E_TYPE_MAIL_PARSER_EXTENSION) static const gchar *parser_mime_types[] = { "application/vnd.evolution.source", @@ -77,19 +66,13 @@ empe_source_parse (EMailParserExtension *extension, } static void -e_mail_parser_source_class_init (EMailParserSourceClass *class) +e_mail_parser_source_class_init (EMailParserExtensionClass *class) { + class->mime_types = parser_mime_types; + class->parse = empe_source_parse; } static void -e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface) +e_mail_parser_source_init (EMailParserExtension *extension) { - iface->mime_types = parser_mime_types; - iface->parse = empe_source_parse; -} - -static void -e_mail_parser_source_init (EMailParserSource *parser) -{ - } |