From cab6eac8f14974ea1c2fedaf9143e98cf630c489 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 7 Dec 2012 12:32:32 -0500 Subject: 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. --- em-format/e-mail-parser-multipart-appledouble.c | 33 ++++++------------------- 1 file changed, 8 insertions(+), 25 deletions(-) (limited to 'em-format/e-mail-parser-multipart-appledouble.c') diff --git a/em-format/e-mail-parser-multipart-appledouble.c b/em-format/e-mail-parser-multipart-appledouble.c index 3f47280051..3fe0181ef5 100644 --- a/em-format/e-mail-parser-multipart-appledouble.c +++ b/em-format/e-mail-parser-multipart-appledouble.c @@ -27,24 +27,13 @@ #include -typedef struct _EMailParserMultipartAppleDouble { - GObject parent; -} EMailParserMultipartAppleDouble; +typedef EMailParserExtension EMailParserMultipartAppleDouble; +typedef EMailParserExtensionClass EMailParserMultipartAppleDoubleClass; -typedef struct _EMailParserMultipartAppleDoubleClass { - GObjectClass parent_class; -} EMailParserMultipartAppleDoubleClass; - -static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface); - -G_DEFINE_TYPE_EXTENDED ( +G_DEFINE_TYPE ( EMailParserMultipartAppleDouble, e_mail_parser_multipart_apple_double, - 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[] = { "multipart/appledouble", @@ -96,19 +85,13 @@ empe_mp_appledouble_parse (EMailParserExtension *extension, } static void -e_mail_parser_multipart_apple_double_class_init (EMailParserMultipartAppleDoubleClass *class) +e_mail_parser_multipart_apple_double_class_init (EMailParserExtensionClass *class) { + class->mime_types = parser_mime_types; + class->parse = empe_mp_appledouble_parse; } static void -e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface) +e_mail_parser_multipart_apple_double_init (EMailParserExtension *extension) { - iface->mime_types = parser_mime_types; - iface->parse = empe_mp_appledouble_parse; -} - -static void -e_mail_parser_multipart_apple_double_init (EMailParserMultipartAppleDouble *parser) -{ - } -- cgit