diff options
Diffstat (limited to 'src/bookmarks/ephy-topic-factory-action.c')
-rw-r--r-- | src/bookmarks/ephy-topic-factory-action.c | 40 |
1 files changed, 9 insertions, 31 deletions
diff --git a/src/bookmarks/ephy-topic-factory-action.c b/src/bookmarks/ephy-topic-factory-action.c index 347738b25..1322b9926 100644 --- a/src/bookmarks/ephy-topic-factory-action.c +++ b/src/bookmarks/ephy-topic-factory-action.c @@ -32,39 +32,13 @@ #include "ephy-stock-icons.h" #include "egg-editable-toolbar.h" +static void ephy_topic_factory_action_init (EphyTopicFactoryAction *factory); static void ephy_topic_factory_action_class_init (EphyTopicFactoryActionClass *class); #define EPHY_TOPIC_FACTORY_ACTION_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), EPHY_TYPE_TOPIC_FACTORY_ACTION, EphyTopicActionPrivate)) #define EGG_TOOLBARS_MODEL_DATA "ephy-topic-factory-menu" -static GObjectClass *parent_class = NULL; - -GType -ephy_topic_factory_action_get_type (void) -{ - static GType type = 0; - - if (!type) - { - const GTypeInfo type_info = - { - sizeof (EphyTopicFactoryActionClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) ephy_topic_factory_action_class_init, - (GClassFinalizeFunc) NULL, - NULL, - sizeof (EphyTopicFactoryAction), - 0, /* n_preallocs */ - NULL - }; - - type = g_type_register_static (GTK_TYPE_ACTION, - "EphyTopicFactoryAction", - &type_info, 0); - } - return type; -} +G_DEFINE_TYPE (EphyTopicFactoryAction, ephy_topic_factory_action, GTK_TYPE_ACTION) static int sort_topics (gconstpointer a, gconstpointer b) @@ -288,7 +262,7 @@ connect_proxy (GtkAction *action, GtkWidget *proxy) { GtkWidget *widget; - (* GTK_ACTION_CLASS (parent_class)->connect_proxy) (action, proxy); + GTK_ACTION_CLASS (ephy_topic_factory_action_parent_class)->connect_proxy (action, proxy); g_return_if_fail (GTK_IS_TOOL_ITEM (proxy)); @@ -303,12 +277,16 @@ connect_proxy (GtkAction *action, GtkWidget *proxy) } static void +ephy_topic_factory_action_init (EphyTopicFactoryAction *factory) +{ + /* Empty, needed for G_DEFINE_TYPE macro */ +} + +static void ephy_topic_factory_action_class_init (EphyTopicFactoryActionClass *class) { GtkActionClass *action_class = GTK_ACTION_CLASS (class); - parent_class = g_type_class_peek_parent (class); - action_class->toolbar_item_type = GTK_TYPE_TOOL_ITEM; action_class->connect_proxy = connect_proxy; action_class->create_tool_item = create_tool_item; |