From 86240d55421acf5c4b3064e0f9818f8b0c99a4de Mon Sep 17 00:00:00 2001 From: Christoph Holtermann Date: Thu, 13 Dec 2018 12:30:24 +0100 Subject: [PATCH] Revert "revert 630f5ba2a693d0a6a9b3ebced645dfd4c5046c98" This reverts commit f61652fc242ec185833abe36f0a22a5e78a3dd8f. --- gnucash/gnome-utils/gnc-plugin-page.c | 33 +-------------------------- 1 file changed, 1 insertion(+), 32 deletions(-) diff --git a/gnucash/gnome-utils/gnc-plugin-page.c b/gnucash/gnome-utils/gnc-plugin-page.c index 8d5529cf5c..7857d57c68 100644 --- a/gnucash/gnome-utils/gnc-plugin-page.c +++ b/gnucash/gnome-utils/gnc-plugin-page.c @@ -107,36 +107,6 @@ typedef struct _GncPluginPagePrivate #define GNC_PLUGIN_PAGE_GET_PRIVATE(o) \ (G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PLUGIN_PAGE, GncPluginPagePrivate)) -GType -gnc_plugin_page_get_type (void) -{ - static GType gnc_plugin_page_type = 0; - - if (gnc_plugin_page_type == 0) - { - static const GTypeInfo our_info = - { - - sizeof (GncPluginPageClass), - NULL, /* base_init */ - NULL, /* base_finalize */ - (GClassInitFunc) gnc_plugin_page_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof (GncPluginPage), - 0, /* n_preallocs */ - (GInstanceInitFunc) gnc_plugin_page_init, - }; - - gnc_plugin_page_type = g_type_register_static (G_TYPE_OBJECT, - "GncPluginPage", - &our_info, 0); - } - - return gnc_plugin_page_type; -} - - /* Create the display widget that corresponds to this plugin. This * function will be called by the main/embedded window manipulation * code to create a widget that they can display. The returned @@ -379,6 +349,7 @@ gnc_plugin_page_unselected (GncPluginPage *plugin_page) g_signal_emit (G_OBJECT (plugin_page), signals[UNSELECTED], 0); } +G_DEFINE_TYPE_WITH_PRIVATE(GncPluginPage, gnc_plugin_page, G_TYPE_OBJECT) /** Initialize the class for a new generic plugin page. This will set * up any function pointers that override functions in the parent @@ -400,8 +371,6 @@ gnc_plugin_page_class_init (GncPluginPageClass *klass) klass->tab_icon = NULL; klass->plugin_name = NULL; - g_type_class_add_private(klass, sizeof(GncPluginPagePrivate)); - g_object_class_install_property (gobject_class, PROP_PAGE_NAME,