aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-location-action.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-location-action.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-location-action.c')
-rw-r--r--src/ephy-location-action.c40
1 files changed, 5 insertions, 35 deletions
diff --git a/src/ephy-location-action.c b/src/ephy-location-action.c
index 73f817089..38ffc47f1 100644
--- a/src/ephy-location-action.c
+++ b/src/ephy-location-action.c
@@ -87,9 +87,9 @@ enum
LOCK_CLICKED,
LAST_SIGNAL
};
-static guint signals[LAST_SIGNAL] = { 0 };
+static guint signals[LAST_SIGNAL];
-static GObjectClass *parent_class = NULL;
+G_DEFINE_TYPE (EphyLocationAction, ephy_location_action, EPHY_TYPE_LINK_ACTION)
static const struct
{
@@ -220,34 +220,6 @@ completion_func (GtkEntryCompletion *completion,
return ret;
}
-GType
-ephy_location_action_get_type (void)
-{
- static GType type = 0;
-
- if (G_UNLIKELY (type == 0))
- {
- const GTypeInfo type_info =
- {
- sizeof (EphyLocationActionClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) ephy_location_action_class_init,
- (GClassFinalizeFunc) NULL,
- NULL,
- sizeof (EphyLocationAction),
- 0, /* n_preallocs */
- (GInstanceInitFunc) ephy_location_action_init,
- };
-
- type = g_type_register_static (EPHY_TYPE_LINK_ACTION,
- "EphyLocationAction",
- &type_info, 0);
- }
-
- return type;
-}
-
static void
action_activated_cb (GtkEntryCompletion *completion,
gint index,
@@ -552,13 +524,13 @@ connect_proxy (GtkAction *action, GtkWidget *proxy)
G_CALLBACK (get_title_cb), action, 0);
}
- GTK_ACTION_CLASS (parent_class)->connect_proxy (action, proxy);
+ GTK_ACTION_CLASS (ephy_location_action_parent_class)->connect_proxy (action, proxy);
}
static void
disconnect_proxy (GtkAction *action, GtkWidget *proxy)
{
- GTK_ACTION_CLASS (parent_class)->disconnect_proxy (action, proxy);
+ GTK_ACTION_CLASS (ephy_location_action_parent_class)->disconnect_proxy (action, proxy);
if (EPHY_IS_LOCATION_ENTRY (proxy))
{
@@ -664,8 +636,6 @@ ephy_location_action_class_init (EphyLocationActionClass *class)
GObjectClass *object_class = G_OBJECT_CLASS (class);
GtkActionClass *action_class = GTK_ACTION_CLASS (class);
- parent_class = g_type_class_peek_parent (class);
-
object_class->finalize = ephy_location_action_finalize;
object_class->get_property = ephy_location_action_get_property;
object_class->set_property = ephy_location_action_set_property;
@@ -904,7 +874,7 @@ ephy_location_action_finalize (GObject *object)
g_free (priv->lock_stock_id);
g_free (priv->lock_tooltip);
- G_OBJECT_CLASS (parent_class)->finalize (object);
+ G_OBJECT_CLASS (ephy_location_action_parent_class)->finalize (object);
}
const char *