aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-shell.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-shell.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-shell.c')
-rw-r--r--src/ephy-shell.c38
1 files changed, 4 insertions, 34 deletions
diff --git a/src/ephy-shell.c b/src/ephy-shell.c
index 22fd81e14..27687f515 100644
--- a/src/ephy-shell.c
+++ b/src/ephy-shell.c
@@ -90,35 +90,7 @@ static void ephy_shell_dispose (GObject *object);
static void ephy_shell_finalize (GObject *object);
static GObject *impl_get_embed_single (EphyEmbedShell *embed_shell);
-static GObjectClass *parent_class;
-
-GType
-ephy_shell_get_type (void)
-{
- static GType type = 0;
-
- if (G_UNLIKELY (type == 0))
- {
- const GTypeInfo our_info =
- {
- sizeof (EphyShellClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) ephy_shell_class_init,
- NULL,
- NULL, /* class_data */
- sizeof (EphyShell),
- 0, /* n_preallocs */
- (GInstanceInitFunc) ephy_shell_init
- };
-
- type = g_type_register_static (EPHY_TYPE_EMBED_SHELL,
- "EphyShell",
- &our_info, 0);
- }
-
- return type;
-}
+G_DEFINE_TYPE (EphyShell, ephy_shell, EPHY_TYPE_EMBED_SHELL)
static void
ephy_shell_class_init (EphyShellClass *klass)
@@ -126,8 +98,6 @@ ephy_shell_class_init (EphyShellClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
EphyEmbedShellClass *embed_shell_class = EPHY_EMBED_SHELL_CLASS (klass);
- parent_class = g_type_class_peek_parent (klass);
-
object_class->dispose = ephy_shell_dispose;
object_class->finalize = ephy_shell_finalize;
@@ -241,7 +211,7 @@ impl_get_embed_single (EphyEmbedShell *embed_shell)
EphyShellPrivate *priv = shell->priv;
GObject *embed_single;
- embed_single = EPHY_EMBED_SHELL_CLASS (parent_class)->get_embed_single (embed_shell);
+ embed_single = EPHY_EMBED_SHELL_CLASS (ephy_shell_parent_class)->get_embed_single (embed_shell);
if (embed_single != NULL &&
priv->embed_single_connected == FALSE)
@@ -370,13 +340,13 @@ ephy_shell_dispose (GObject *object)
}
#endif /* ENABLE_NETWORK_MANAGER */
- G_OBJECT_CLASS (parent_class)->dispose (object);
+ G_OBJECT_CLASS (ephy_shell_parent_class)->dispose (object);
}
static void
ephy_shell_finalize (GObject *object)
{
- G_OBJECT_CLASS (parent_class)->finalize (object);
+ G_OBJECT_CLASS (ephy_shell_parent_class)->finalize (object);
LOG ("Ephy shell finalised");
}