From f0f2a211a474b2b5fccdaa5a15a5e3fb27866f3a Mon Sep 17 00:00:00 2001 From: Xan Lopez Date: Sun, 17 Feb 2008 23:23:36 +0000 Subject: Use G_DEFINE_TYPE* where possible in embed/* (#517090) svn path=/trunk/; revision=7964 --- embed/ephy-encodings.c | 34 ++-------------------------------- 1 file changed, 2 insertions(+), 32 deletions(-) (limited to 'embed/ephy-encodings.c') diff --git a/embed/ephy-encodings.c b/embed/ephy-encodings.c index 7172dad64..b6aa7e680 100644 --- a/embed/ephy-encodings.c +++ b/embed/ephy-encodings.c @@ -187,35 +187,7 @@ enum static void ephy_encodings_class_init (EphyEncodingsClass *klass); static void ephy_encodings_init (EphyEncodings *ma); -static GObjectClass *parent_class = NULL; - -GType -ephy_encodings_get_type (void) -{ - static GType type = 0; - - if (G_UNLIKELY (type == 0)) - { - const GTypeInfo our_info = - { - sizeof (EphyEncodingsClass), - NULL, - NULL, - (GClassInitFunc) ephy_encodings_class_init, - NULL, - NULL, - sizeof (EphyEncodings), - 0, - (GInstanceInitFunc) ephy_encodings_init - }; - - type = g_type_register_static (G_TYPE_OBJECT, - "EphyEncodings", - &our_info, 0); - } - - return type; -} +G_DEFINE_TYPE (EphyEncodings, ephy_encodings, G_TYPE_OBJECT) static void ephy_encodings_finalize (GObject *object) @@ -235,7 +207,7 @@ ephy_encodings_finalize (GObject *object) LOG ("EphyEncodings finalised"); - G_OBJECT_CLASS (parent_class)->finalize (object); + G_OBJECT_CLASS (ephy_encodings_parent_class)->finalize (object); } static void @@ -243,8 +215,6 @@ ephy_encodings_class_init (EphyEncodingsClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - parent_class = g_type_class_peek_parent (klass); - object_class->finalize = ephy_encodings_finalize; g_type_class_add_private (object_class, sizeof (EphyEncodingsPrivate)); -- cgit v1.2.3