aboutsummaryrefslogtreecommitdiffstats
path: root/modules/itip-formatter/e-mail-parser-itip.c
diff options
context:
space:
mode:
Diffstat (limited to 'modules/itip-formatter/e-mail-parser-itip.c')
-rw-r--r--modules/itip-formatter/e-mail-parser-itip.c72
1 files changed, 35 insertions, 37 deletions
diff --git a/modules/itip-formatter/e-mail-parser-itip.c b/modules/itip-formatter/e-mail-parser-itip.c
index f8fb4f68fb..2894b525e6 100644
--- a/modules/itip-formatter/e-mail-parser-itip.c
+++ b/modules/itip-formatter/e-mail-parser-itip.c
@@ -44,30 +44,30 @@
#define d(x)
-typedef struct _EMailParserItip {
- EExtension parent;
-} EMailParserItip;
+typedef GObject EMailParserItip;
+typedef GObjectClass EMailParserItipClass;
-typedef struct _EMailParserItipClass {
- EExtensionClass parent_class;
-} EMailParserItipClass;
+typedef EExtension EMailParserItipLoader;
+typedef EExtensionClass EMailParserItipLoaderClass;
GType e_mail_parser_itip_get_type (void);
-static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface);
+GType e_mail_parser_itip_loader_get_type (void);
static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface);
G_DEFINE_DYNAMIC_TYPE_EXTENDED (
EMailParserItip,
e_mail_parser_itip,
- 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 (
+ EMailParserItipLoader,
+ e_mail_parser_itip_loader,
+ E_TYPE_EXTENSION)
+
static const gchar *parser_mime_types[] = {
"text/calendar",
"application/ics",
@@ -259,70 +259,68 @@ empe_itip_get_flags (EMailParserExtension *extension)
return E_MAIL_PARSER_EXTENSION_INLINE_DISPOSITION;
}
-void
-e_mail_parser_itip_type_register (GTypeModule *type_module)
+static void
+e_mail_parser_itip_class_init (EMailParserItipClass *class)
{
- e_mail_parser_itip_register_type (type_module);
}
static void
-e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface)
+e_mail_parser_itip_class_finalize (EMailParserItipClass *class)
{
- iface->mime_types = parser_mime_types;
+
}
static void
e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface)
{
+ iface->mime_types = parser_mime_types;
iface->parse = empe_itip_parse;
iface->get_flags = empe_itip_get_flags;
}
static void
-e_mail_parser_itip_constructed (GObject *object)
+e_mail_parser_itip_init (EMailParserItip *self)
{
- 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));
}
static void
-e_mail_parser_itip_finalize (GObject *object)
+mail_parser_itip_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_remove_extension (reg, E_MAIL_EXTENSION (object));
+ e_mail_extension_registry_add_extension (
+ E_MAIL_EXTENSION_REGISTRY (extensible),
+ parser_mime_types,
+ e_mail_parser_itip_get_type ());
}
static void
-e_mail_parser_itip_class_init (EMailParserItipClass *class)
+e_mail_parser_itip_loader_class_init (EExtensionClass *class)
{
GObjectClass *object_class;
- EExtensionClass *extension_class;
object_class = G_OBJECT_CLASS (class);
- object_class->constructed = e_mail_parser_itip_constructed;
- object_class->finalize = e_mail_parser_itip_finalize;
+ object_class->constructed = mail_parser_itip_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;
}
static void
-e_mail_parser_itip_class_finalize (EMailParserItipClass *class)
+e_mail_parser_itip_loader_class_finalize (EExtensionClass *class)
{
-
}
static void
-e_mail_parser_itip_init (EMailParserItip *self)
+e_mail_parser_itip_loader_init (EExtension *extension)
{
}
+
+void
+e_mail_parser_itip_type_register (GTypeModule *type_module)
+{
+ e_mail_parser_itip_register_type (type_module);
+ e_mail_parser_itip_loader_register_type (type_module);
+}
+