diff options
author | Xan Lopez <xan@src.gnome.org> | 2008-02-10 18:26:22 +0000 |
---|---|---|
committer | Xan Lopez <xan@src.gnome.org> | 2008-02-10 18:26:22 +0000 |
commit | a6753733856e098e2500487fee87620f72dea530 (patch) | |
tree | 1f5a7d8ae16bd2e3070bbdc31791eef96952a233 /src/ppview-toolbar.c | |
parent | 9a3e4ebc55e11c3b00b0e7464b11ecec121bc6f2 (diff) | |
download | epiphany-a6753733856e098e2500487fee87620f72dea530.tar.gz |
Use G_DEFINE_TYPE* when possible in src/ (#515601)
svn path=/trunk/; revision=7927
Diffstat (limited to 'src/ppview-toolbar.c')
-rw-r--r-- | src/ppview-toolbar.c | 34 |
1 files changed, 2 insertions, 32 deletions
diff --git a/src/ppview-toolbar.c b/src/ppview-toolbar.c index 20659acaa..f501946c3 100644 --- a/src/ppview-toolbar.c +++ b/src/ppview-toolbar.c @@ -54,8 +54,6 @@ enum PROP_WINDOW }; -static GObjectClass *parent_class = NULL; - #define EPHY_PPVIEW_TOOLBAR_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), EPHY_TYPE_PPVIEW_TOOLBAR, PPViewToolbarPrivate)) struct PPViewToolbarPrivate @@ -121,41 +119,13 @@ static const char ui_info[] = "</toolbar>" "</ui>\n"; -GType -ppview_toolbar_get_type (void) -{ - static GType type = 0; - - if (G_UNLIKELY (type == 0)) - { - const GTypeInfo our_info = - { - sizeof (PPViewToolbarClass), - NULL, /* base_init */ - NULL, /* base_finalize */ - (GClassInitFunc) ppview_toolbar_class_init, - NULL, - NULL, /* class_data */ - sizeof (PPViewToolbar), - 0, /* n_preallocs */ - (GInstanceInitFunc) ppview_toolbar_init - }; - - type = g_type_register_static (G_TYPE_OBJECT, - "PPViewToolbar", - &our_info, 0); - } - - return type; -} +G_DEFINE_TYPE (PPViewToolbar, ppview_toolbar, G_TYPE_OBJECT) static void ppview_toolbar_class_init (PPViewToolbarClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - parent_class = g_type_class_peek_parent (klass); - object_class->finalize = ppview_toolbar_finalize; object_class->set_property = ppview_toolbar_set_property; @@ -286,7 +256,7 @@ ppview_toolbar_finalize (GObject *object) t->priv->action_group); g_object_unref (t->priv->action_group); - G_OBJECT_CLASS (parent_class)->finalize (object); + G_OBJECT_CLASS (ppview_toolbar_parent_class)->finalize (object); } PPViewToolbar * |