use G_DEFINE_TYPE_WITH_PRIVATE to replace g_type_class_add_private

gnc_search_boolean_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:17:53 +01:00
parent 0c011e25b6
commit 837b70ed33

View File

@ -58,33 +58,7 @@ struct _GNCSearchBooleanPrivate
static GNCSearchCoreTypeClass *parent_class;
GType
gnc_search_boolean_get_type (void)
{
static GType type = 0;
if (!type)
{
GTypeInfo type_info =
{
sizeof(GNCSearchBooleanClass), /* class_size */
NULL, /* base_init */
NULL, /* base_finalize */
(GClassInitFunc)gnc_search_boolean_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof(GNCSearchBoolean), /* */
0, /* n_preallocs */
(GInstanceInitFunc)gnc_search_boolean_init,
};
type = g_type_register_static (GNC_TYPE_SEARCH_CORE_TYPE,
"GNCSearchBoolean",
&type_info, 0);
}
return type;
}
G_DEFINE_TYPE_WITH_PRIVATE(GNCSearchBoolean, gnc_search_boolean, GNC_TYPE_SEARCH_CORE_TYPE)
static void
gnc_search_boolean_class_init (GNCSearchBooleanClass *klass)
@ -103,8 +77,6 @@ gnc_search_boolean_class_init (GNCSearchBooleanClass *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(GNCSearchBooleanPrivate));
}
static void