From a0da580e7e2355b6f6e084cbd968dd6176156082 Mon Sep 17 00:00:00 2001 From: JP Rosevear Date: Tue, 21 Dec 2004 15:42:46 +0000 Subject: Convert to G_DEFINE_TYPE 2004-12-21 JP Rosevear * e-corba-config-page.c: Convert to G_DEFINE_TYPE * e-history.c: ditto * e-shell-folder-title-bar.c: ditto * e-shell-offline-handler.c: ditto * e-shell-settings-dialog.c: ditto * e-shell-window.c: ditto * e-sidebar.c: ditto * e-user-creatable-items-handler.c: ditto * e-component-registry.c: ditto * importer/evolution-importer-client.c: ditto svn path=/trunk/; revision=28164 --- shell/e-component-registry.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'shell/e-component-registry.c') diff --git a/shell/e-component-registry.c b/shell/e-component-registry.c index d83c0ae572..a314118305 100644 --- a/shell/e-component-registry.c +++ b/shell/e-component-registry.c @@ -30,7 +30,6 @@ #include #include -#include #include #include @@ -38,17 +37,13 @@ #include #include - -#define PARENT_TYPE G_TYPE_OBJECT -static GObjectClass *parent_class = NULL; - - struct _EComponentRegistryPrivate { GSList *infos; int init:1; }; +G_DEFINE_TYPE (EComponentRegistry, e_component_registry, G_TYPE_OBJECT) /* EComponentInfo handling. */ @@ -261,24 +256,22 @@ impl_finalize (GObject *object) g_slist_foreach (priv->infos, (GFunc) component_info_free, NULL); g_free (priv); - (* G_OBJECT_CLASS (parent_class)->finalize) (object); + (* G_OBJECT_CLASS (e_component_registry_parent_class)->finalize) (object); } static void -class_init (EComponentRegistryClass *klass) +e_component_registry_class_init (EComponentRegistryClass *klass) { GObjectClass *object_class; object_class = G_OBJECT_CLASS (klass); object_class->finalize = impl_finalize; - - parent_class = g_type_class_ref(PARENT_TYPE); } static void -init (EComponentRegistry *registry) +e_component_registry_init (EComponentRegistry *registry) { registry->priv = g_new0 (EComponentRegistryPrivate, 1); } @@ -354,7 +347,3 @@ e_component_registry_activate (EComponentRegistry *registry, /* it isn't in the registry unless it is already activated */ return bonobo_object_dup_ref (info->iface, NULL); } - - -E_MAKE_TYPE (e_component_registry, "EComponentRegistry", EComponentRegistry, - class_init, init, PARENT_TYPE) -- cgit v1.2.3