From eab5753aa68474ecd0a07acbf936798a5a2e58fe Mon Sep 17 00:00:00 2001 From: Christoph Holtermann Date: Thu, 6 Dec 2018 23:36:23 +0100 Subject: [PATCH] use G_DEFINE_TYPE_WITH_PRIVATE to replace g_type_class_add_private gnc_plugin_budget_get_type is being replaced by that provided by G_DEFINE_TYPE_WITH_PRIVATE --- gnucash/gnome/gnc-plugin-budget.c | 30 ++---------------------------- 1 file changed, 2 insertions(+), 28 deletions(-) diff --git a/gnucash/gnome/gnc-plugin-budget.c b/gnucash/gnome/gnc-plugin-budget.c index 5d7aeb591d..c1afd95f79 100644 --- a/gnucash/gnome/gnc-plugin-budget.c +++ b/gnucash/gnome/gnc-plugin-budget.c @@ -87,33 +87,6 @@ typedef struct GncPluginBudgetPrivate static GObjectClass *parent_class = NULL; -GType -gnc_plugin_budget_get_type (void) -{ - static GType gnc_plugin_budget_type = 0; - - if (!gnc_plugin_budget_type) - { - static const GTypeInfo our_info = - { - sizeof (GncPluginBudgetClass), - NULL, /* base_init */ - NULL, /* base_finalize */ - (GClassInitFunc) gnc_plugin_budget_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof (GncPluginBudget), - 0, /* n_preallocs */ - (GInstanceInitFunc) gnc_plugin_budget_init - }; - - gnc_plugin_budget_type = g_type_register_static( - GNC_TYPE_PLUGIN, "GncPluginBudget", &our_info, 0); - } - - return gnc_plugin_budget_type; -} - GncPlugin * gnc_plugin_budget_new (void) { GncPluginBudget *plugin; @@ -149,6 +122,8 @@ gnc_plugin_budget_main_window_page_changed (GncMainWindow *window, } } +G_DEFINE_TYPE_WITH_PRIVATE(GncPluginBudget, gnc_plugin_budget, GNC_TYPE_PLUGIN) + static void gnc_plugin_budget_class_init (GncPluginBudgetClass *klass) { @@ -168,7 +143,6 @@ gnc_plugin_budget_class_init (GncPluginBudgetClass *klass) plugin_class->n_actions = gnc_plugin_n_actions; plugin_class->ui_filename = PLUGIN_UI_FILENAME; - g_type_class_add_private(klass, sizeof(GncPluginBudgetPrivate)); LEAVE (" "); }