Skip to content

Commit

Permalink
use G_DEFINE_TYPE_WITH_PRIVATE to replace g_type_class_add_private
Browse files Browse the repository at this point in the history
gnc_tree_view_owner_get_type is being replaced by that provided by G_DEFINE_TYPE_WITH_PRIVATE
  • Loading branch information
c-holtermann committed Jan 26, 2019
1 parent df74ac3 commit 3eb5c88
Showing 1 changed file with 1 addition and 29 deletions.
30 changes: 1 addition & 29 deletions gnucash/gnome-utils/gnc-tree-view-owner.c
Expand Up @@ -96,33 +96,7 @@ typedef struct GncTreeViewOwnerPrivate

static GObjectClass *parent_class = NULL;

GType
gnc_tree_view_owner_get_type (void)
{
static GType gnc_tree_view_owner_type = 0;

if (gnc_tree_view_owner_type == 0)
{
static const GTypeInfo our_info =
{
sizeof (GncTreeViewOwnerClass),
NULL,
NULL,
(GClassInitFunc) gnc_tree_view_owner_class_init,
NULL,
NULL,
sizeof (GncTreeViewOwner),
0,
(GInstanceInitFunc) gnc_tree_view_owner_init
};

gnc_tree_view_owner_type = g_type_register_static (
GNC_TYPE_TREE_VIEW, GNC_TREE_VIEW_OWNER_NAME,
&our_info, 0);
}

return gnc_tree_view_owner_type;
}
G_DEFINE_TYPE_WITH_PRIVATE(GncTreeViewOwner, gnc_tree_view_owner, GNC_TYPE_TREE_VIEW)

static void
gnc_tree_view_owner_class_init (GncTreeViewOwnerClass *klass)
Expand All @@ -135,8 +109,6 @@ gnc_tree_view_owner_class_init (GncTreeViewOwnerClass *klass)
o_class = G_OBJECT_CLASS (klass);
o_class->finalize = gnc_tree_view_owner_finalize;

g_type_class_add_private(klass, sizeof(GncTreeViewOwnerPrivate));

gnc_hook_add_dangler(HOOK_CURRENCY_CHANGED,
(GFunc)gtvo_currency_changed_cb, NULL);
}
Expand Down

0 comments on commit 3eb5c88

Please sign in to comment.