epiphany r8827 - trunk/lib



Author: xan
Date: Sun Mar  1 12:27:52 2009
New Revision: 8827
URL: http://svn.gnome.org/viewvc/epiphany?rev=8827&view=rev

Log:
ephy-module: use G_DEFINE_TYPE.

Modified:
   trunk/lib/ephy-module.c

Modified: trunk/lib/ephy-module.c
==============================================================================
--- trunk/lib/ephy-module.c	(original)
+++ trunk/lib/ephy-module.c	Sun Mar  1 12:27:52 2009
@@ -49,35 +49,7 @@
 static void ephy_module_init		(EphyModule *action);
 static void ephy_module_class_init	(EphyModuleClass *class);
 
-static GObjectClass *parent_class = NULL;
-
-GType
-ephy_module_get_type (void)
-{
-	static GType type = 0;
-
-	if (G_UNLIKELY (type == 0))
-	{
-		const GTypeInfo type_info =
-		{
-			sizeof (EphyModuleClass),
-			(GBaseInitFunc) NULL,
-			(GBaseFinalizeFunc) NULL,
-			(GClassInitFunc) ephy_module_class_init,
-			(GClassFinalizeFunc) NULL,
-			NULL,
-			sizeof (EphyModule),
-			0, /* n_preallocs */
-			(GInstanceInitFunc) ephy_module_init,
-		};
-
-		type = g_type_register_static (G_TYPE_TYPE_MODULE,
-					       "EphyModule",
-					       &type_info, 0);
-	}
-
-	return type;
-}
+G_DEFINE_TYPE (EphyModule, ephy_module, G_TYPE_TYPE_MODULE)
 
 static gboolean
 ephy_module_load (GTypeModule *gmodule)
@@ -214,7 +186,7 @@
 
 	g_free (module->path);
 
-	G_OBJECT_CLASS (parent_class)->finalize (object);
+	G_OBJECT_CLASS (ephy_module_parent_class)->finalize (object);
 }
 
 static void
@@ -223,8 +195,6 @@
 	GObjectClass *object_class = G_OBJECT_CLASS (class);
 	GTypeModuleClass *module_class = G_TYPE_MODULE_CLASS (class);
 
-	parent_class = (GObjectClass *) g_type_class_peek_parent (class);
-
 	object_class->finalize = ephy_module_finalize;
 
 	module_class->load = ephy_module_load;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]