aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-dbus.c
diff options
context:
space:
mode:
authorXan Lopez <xan@src.gnome.org>2008-02-11 02:26:22 +0800
committerXan Lopez <xan@src.gnome.org>2008-02-11 02:26:22 +0800
commita6753733856e098e2500487fee87620f72dea530 (patch)
tree1f5a7d8ae16bd2e3070bbdc31791eef96952a233 /src/ephy-dbus.c
parent9a3e4ebc55e11c3b00b0e7464b11ecec121bc6f2 (diff)
downloadgsoc2013-epiphany-a6753733856e098e2500487fee87620f72dea530.tar
gsoc2013-epiphany-a6753733856e098e2500487fee87620f72dea530.tar.gz
gsoc2013-epiphany-a6753733856e098e2500487fee87620f72dea530.tar.bz2
gsoc2013-epiphany-a6753733856e098e2500487fee87620f72dea530.tar.lz
gsoc2013-epiphany-a6753733856e098e2500487fee87620f72dea530.tar.xz
gsoc2013-epiphany-a6753733856e098e2500487fee87620f72dea530.tar.zst
gsoc2013-epiphany-a6753733856e098e2500487fee87620f72dea530.zip
Use G_DEFINE_TYPE* when possible in src/ (#515601)
svn path=/trunk/; revision=7927
Diffstat (limited to 'src/ephy-dbus.c')
-rw-r--r--src/ephy-dbus.c77
1 files changed, 24 insertions, 53 deletions
diff --git a/src/ephy-dbus.c b/src/ephy-dbus.c
index df903b6b4..9e0e2a9e8 100644
--- a/src/ephy-dbus.c
+++ b/src/ephy-dbus.c
@@ -77,7 +77,6 @@ enum
static EphyDbus *ephy_dbus_instance;
static guint signals[LAST_SIGNAL];
-static GObjectClass *parent_class;
GQuark ephy_dbus_error_quark;
/* Filter signals form session bus */
@@ -344,28 +343,7 @@ ephy_dbus_shutdown (EphyDbus *dbus)
/* Class implementation */
-static void
-ephy_dbus_init (EphyDbus *dbus)
-{
- dbus->priv = EPHY_DBUS_GET_PRIVATE (dbus);
-
- LOG ("EphyDbus initialising");
-}
-
-static void
-ephy_dbus_finalize (GObject *object)
-{
- EphyDbus *dbus = EPHY_DBUS (object);
-
- /* Have to do this after the object's weak ref notifiers have
- * been called, see https://bugs.freedesktop.org/show_bug.cgi?id=5688
- */
- ephy_dbus_shutdown (dbus);
-
- LOG ("EphyDbus finalised");
-
- parent_class->finalize (object);
-}
+G_DEFINE_TYPE (EphyDbus, ephy_dbus, G_TYPE_OBJECT)
static void
ephy_dbus_get_property (GObject *object,
@@ -395,12 +373,33 @@ ephy_dbus_set_property (GObject *object,
}
static void
+ephy_dbus_finalize (GObject *object)
+{
+ EphyDbus *dbus = EPHY_DBUS (object);
+
+ /* Have to do this after the object's weak ref notifiers have
+ * been called, see https://bugs.freedesktop.org/show_bug.cgi?id=5688
+ */
+ ephy_dbus_shutdown (dbus);
+
+ LOG ("EphyDbus finalised");
+
+ G_OBJECT_CLASS (ephy_dbus_parent_class)->finalize (object);
+}
+
+static void
+ephy_dbus_init (EphyDbus *dbus)
+{
+ dbus->priv = EPHY_DBUS_GET_PRIVATE (dbus);
+
+ LOG ("EphyDbus initialising");
+}
+
+static void
ephy_dbus_class_init (EphyDbusClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- parent_class = g_type_class_peek_parent (klass);
-
object_class->get_property = ephy_dbus_get_property;
object_class->set_property = ephy_dbus_set_property;
object_class->finalize = ephy_dbus_finalize;
@@ -439,34 +438,6 @@ ephy_dbus_class_init (EphyDbusClass *klass)
g_type_class_add_private (object_class, sizeof(EphyDbusPrivate));
}
-GType
-ephy_dbus_get_type (void)
-{
- static GType type = 0;
-
- if (G_UNLIKELY (type == 0))
- {
- const GTypeInfo our_info =
- {
- sizeof (EphyDbusClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) ephy_dbus_class_init,
- NULL,
- NULL, /* class_data */
- sizeof (EphyDbus),
- 0, /* n_preallocs */
- (GInstanceInitFunc) ephy_dbus_init
- };
-
- type = g_type_register_static (G_TYPE_OBJECT,
- "EphyDbus",
- &our_info, 0);
- }
-
- return type;
-}
-
EphyDbus *
ephy_dbus_get_default (void)
{