aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-home-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-home-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-home-action.c')
-rw-r--r--src/ephy-home-action.c38
1 files changed, 7 insertions, 31 deletions
diff --git a/src/ephy-home-action.c b/src/ephy-home-action.c
index 2758a6e4c..72b73292e 100644
--- a/src/ephy-home-action.c
+++ b/src/ephy-home-action.c
@@ -40,14 +40,14 @@ typedef struct
EphyLinkFlags flags;
} ClipboardCtx;
+G_DEFINE_TYPE (EphyHomeAction, ephy_home_action, EPHY_TYPE_LINK_ACTION)
+
static const GtkTargetEntry url_drag_types [] =
{
{ EPHY_DND_URI_LIST_TYPE, 0, 0 },
{ EPHY_DND_URL_TYPE, 0, 1 }
};
-static GObjectClass *parent_class = NULL;
-
static void
clipboard_text_received_cb (GtkClipboard *clipboard,
const char *text,
@@ -236,7 +236,7 @@ connect_proxy (GtkAction *action,
{
gchar *action_name;
- GTK_ACTION_CLASS (parent_class)->connect_proxy (action, proxy);
+ GTK_ACTION_CLASS (ephy_home_action_parent_class)->connect_proxy (action, proxy);
g_object_get (action, "name", &action_name, NULL);
@@ -259,7 +259,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_home_action_parent_class)->disconnect_proxy (action, proxy);
}
static void
@@ -267,37 +267,13 @@ ephy_home_action_class_init (EphyHomeActionClass *class)
{
GtkActionClass *action_class = GTK_ACTION_CLASS (class);
- parent_class = g_type_class_peek_parent (class);
-
action_class->activate = ephy_home_action_activate;
action_class->connect_proxy = connect_proxy;
action_class->disconnect_proxy = disconnect_proxy;
}
-GType
-ephy_home_action_get_type (void)
+static void
+ephy_home_action_init (EphyHomeAction *action)
{
- static GType type = 0;
-
- if (G_UNLIKELY (type == 0))
- {
- const GTypeInfo type_info =
- {
- sizeof (EphyHomeActionClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) ephy_home_action_class_init,
- (GClassFinalizeFunc) NULL,
- NULL,
- sizeof (EphyHomeAction),
- 0, /* n_preallocs */
- (GInstanceInitFunc) NULL,
- };
-
- type = g_type_register_static (EPHY_TYPE_LINK_ACTION,
- "EphyHomeAction",
- &type_info, 0);
- }
-
- return type;
+ /* Empty, needed for G_DEFINE_TYPE macro */
}