From 2449d7257e528e546823bc7219619238a2da882f Mon Sep 17 00:00:00 2001 From: Christoph Holtermann Date: Fri, 7 Dec 2018 11:10:02 +0100 Subject: [PATCH] use G_DEFINE_TYPE_WITH_PRIVATE to replace g_type_class_add_private gnc_tree_view_account_get_type is being replaced by that provided by G_DEFINE_TYPE_WITH_PRIVATE. --- gnucash/gnome-utils/gnc-tree-view-account.c | 30 +-------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/gnucash/gnome-utils/gnc-tree-view-account.c b/gnucash/gnome-utils/gnc-tree-view-account.c index 2953cd19e0..93588fc403 100644 --- a/gnucash/gnome-utils/gnc-tree-view-account.c +++ b/gnucash/gnome-utils/gnc-tree-view-account.c @@ -124,33 +124,7 @@ typedef struct GncTreeViewAccountPrivate static GObjectClass *parent_class = NULL; -GType -gnc_tree_view_account_get_type (void) -{ - static GType gnc_tree_view_account_type = 0; - - if (gnc_tree_view_account_type == 0) - { - static const GTypeInfo our_info = - { - sizeof (GncTreeViewAccountClass), - NULL, - NULL, - (GClassInitFunc) gnc_tree_view_account_class_init, - NULL, - NULL, - sizeof (GncTreeViewAccount), - 0, - (GInstanceInitFunc) gnc_tree_view_account_init - }; - - gnc_tree_view_account_type = g_type_register_static ( - GNC_TYPE_TREE_VIEW, GNC_TREE_VIEW_ACCOUNT_NAME, - &our_info, 0); - } - - return gnc_tree_view_account_type; -} +G_DEFINE_TYPE_WITH_PRIVATE(GncTreeViewAccount, gnc_tree_view_account, GNC_TYPE_TREE_VIEW) static void gnc_tree_view_account_class_init (GncTreeViewAccountClass *klass) @@ -163,8 +137,6 @@ gnc_tree_view_account_class_init (GncTreeViewAccountClass *klass) o_class = G_OBJECT_CLASS (klass); o_class->finalize = gnc_tree_view_account_finalize; - g_type_class_add_private(klass, sizeof(GncTreeViewAccountPrivate)); - gnc_hook_add_dangler(HOOK_CURRENCY_CHANGED, (GFunc)gtva_currency_changed_cb, NULL); }