use G_DEFINE_TYPE_WITH_PRIVATE to replace g_type_class_add_private

gnc_search_double_get_type is being replaced by that provided by G_DEFINE_TYPE_WITH_PRIVATE
This commit is contained in:
Christoph Holtermann 2018-12-06 20:43:43 +01:00
parent bd8a687bd6
commit 0ac300889a

View File

@ -62,33 +62,7 @@ struct _GNCSearchDoublePrivate
static GNCSearchCoreTypeClass *parent_class;
GType
gnc_search_double_get_type (void)
{
static GType type = 0;
if (!type)
{
GTypeInfo type_info =
{
sizeof(GNCSearchDoubleClass), /* class_size */
NULL, /* base_init */
NULL, /* base_finalize */
(GClassInitFunc)gnc_search_double_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof(GNCSearchDouble), /* */
0, /* n_preallocs */
(GInstanceInitFunc)gnc_search_double_init,
};
type = g_type_register_static (GNC_TYPE_SEARCH_CORE_TYPE,
"GNCSearchDouble",
&type_info, 0);
}
return type;
}
G_DEFINE_TYPE_WITH_PRIVATE(GNCSearchDouble, gnc_search_double, GNC_TYPE_SEARCH_CORE_TYPE)
static void
gnc_search_double_class_init (GNCSearchDoubleClass *klass)
@ -109,8 +83,6 @@ gnc_search_double_class_init (GNCSearchDoubleClass *klass)
gnc_search_core_type->get_widget = gncs_get_widget;
gnc_search_core_type->get_predicate = gncs_get_predicate;
gnc_search_core_type->clone = gncs_clone;
g_type_class_add_private(klass, sizeof(GNCSearchDoublePrivate));
}
static void