aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-go-action.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ephy-go-action.c')
-rw-r--r--src/ephy-go-action.c43
1 files changed, 10 insertions, 33 deletions
diff --git a/src/ephy-go-action.c b/src/ephy-go-action.c
index 8a6079182..d67ad962d 100644
--- a/src/ephy-go-action.c
+++ b/src/ephy-go-action.c
@@ -30,35 +30,7 @@
static void ephy_go_action_class_init (EphyGoActionClass *class);
-static GObjectClass *parent_class = NULL;
-
-GType
-ephy_go_action_get_type (void)
-{
- static GType type = 0;
-
- if (G_UNLIKELY (type == 0))
- {
- const GTypeInfo type_info =
- {
- sizeof (EphyGoActionClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) ephy_go_action_class_init,
- (GClassFinalizeFunc) NULL,
- NULL,
- sizeof (EphyGoAction),
- 0, /* n_preallocs */
- (GInstanceInitFunc) NULL,
- };
-
- type = g_type_register_static (EPHY_TYPE_LINK_ACTION,
- "EphyGoAction",
- &type_info, 0);
- }
-
- return type;
-}
+G_DEFINE_TYPE (EphyGoAction, ephy_go_action, EPHY_TYPE_LINK_ACTION)
static GtkWidget *
create_tool_item (GtkAction *action)
@@ -93,7 +65,7 @@ static void
connect_proxy (GtkAction *action,
GtkWidget *proxy)
{
- GTK_ACTION_CLASS (parent_class)->connect_proxy (action, proxy);
+ GTK_ACTION_CLASS (ephy_go_action_parent_class)->connect_proxy (action, proxy);
if (GTK_IS_TOOL_ITEM (proxy))
{
@@ -110,7 +82,7 @@ disconnect_proxy (GtkAction *action,
g_signal_handlers_disconnect_by_func
(proxy, G_CALLBACK (gtk_action_activate), action);
- GTK_ACTION_CLASS (parent_class)->disconnect_proxy (action, proxy);
+ GTK_ACTION_CLASS (ephy_go_action_parent_class)->disconnect_proxy (action, proxy);
}
static void
@@ -118,9 +90,14 @@ ephy_go_action_class_init (EphyGoActionClass *class)
{
GtkActionClass *action_class = GTK_ACTION_CLASS (class);
- parent_class = g_type_class_peek_parent (class);
-
action_class->create_tool_item = create_tool_item;
action_class->connect_proxy = connect_proxy;
action_class->disconnect_proxy = disconnect_proxy;
}
+
+static void
+ephy_go_action_init (EphyGoAction *action)
+{
+ /* Empty, needed for G_DEFINE_TYPE macro */
+}
+