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 /modules/prefer-plain | |
parent | 3ae26f0ab68776e230a2be58939e5bf69c8fa2d5 (diff) | |
download | gsoc2013-evolution-cab6eac8f14974ea1c2fedaf9143e98cf630c489.tar gsoc2013-evolution-cab6eac8f14974ea1c2fedaf9143e98cf630c489.tar.gz gsoc2013-evolution-cab6eac8f14974ea1c2fedaf9143e98cf630c489.tar.bz2 gsoc2013-evolution-cab6eac8f14974ea1c2fedaf9143e98cf630c489.tar.lz gsoc2013-evolution-cab6eac8f14974ea1c2fedaf9143e98cf630c489.tar.xz 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 'modules/prefer-plain')
-rw-r--r-- | modules/prefer-plain/e-mail-parser-prefer-plain.c | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/modules/prefer-plain/e-mail-parser-prefer-plain.c b/modules/prefer-plain/e-mail-parser-prefer-plain.c index eea1d280b5..d434c20bc8 100644 --- a/modules/prefer-plain/e-mail-parser-prefer-plain.c +++ b/modules/prefer-plain/e-mail-parser-prefer-plain.c @@ -39,7 +39,7 @@ typedef EExtension EMailParserPreferPlainLoader; typedef EExtensionClass EMailParserPreferPlainLoaderClass; struct _EMailParserPreferPlain { - GObject parent; + EMailParserExtension parent; GSettings *settings; gint mode; @@ -47,12 +47,11 @@ struct _EMailParserPreferPlain { }; struct _EMailParserPreferPlainClass { - GObjectClass parent_class; + EMailParserExtensionClass parent_class; }; GType e_mail_parser_prefer_plain_get_type (void); GType e_mail_parser_prefer_plain_loader_get_type (void); -static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface); enum { PREFER_HTML, @@ -60,14 +59,10 @@ enum { ONLY_PLAIN }; -G_DEFINE_DYNAMIC_TYPE_EXTENDED ( +G_DEFINE_DYNAMIC_TYPE ( EMailParserPreferPlain, e_mail_parser_prefer_plain, - G_TYPE_OBJECT, - 0, - G_IMPLEMENT_INTERFACE_DYNAMIC ( - E_TYPE_MAIL_PARSER_EXTENSION, - e_mail_parser_parser_extension_interface_init)); + E_TYPE_MAIL_PARSER_EXTENSION) G_DEFINE_DYNAMIC_TYPE ( EMailParserPreferPlainLoader, @@ -332,13 +327,6 @@ empe_prefer_plain_parse (EMailParserExtension *extension, } static void -e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface) -{ - iface->mime_types = parser_mime_types; - iface->parse = empe_prefer_plain_parse; -} - -static void e_mail_parser_prefer_plain_get_property (GObject *object, guint property_id, GValue *value, @@ -400,12 +388,17 @@ static void e_mail_parser_prefer_plain_class_init (EMailParserPreferPlainClass *class) { GObjectClass *object_class; + EMailParserExtensionClass *extension_class; object_class = G_OBJECT_CLASS (class); object_class->get_property = e_mail_parser_prefer_plain_get_property; object_class->set_property = e_mail_parser_prefer_plain_set_property; object_class->dispose = e_mail_parser_prefer_plain_dispose; + extension_class = E_MAIL_PARSER_EXTENSION_CLASS (class); + extension_class->mime_types = parser_mime_types; + extension_class->parse = empe_prefer_plain_parse; + g_object_class_install_property ( object_class, PROP_MODE, |