From 25f0f0a234059d282dbf445c3ca47cb0c08c3ca4 Mon Sep 17 00:00:00 2001 From: Pablo Barciela Date: Tue, 29 Jan 2019 19:00:18 +0100 Subject: unit-category: avoid deprecated 'g_type_class_add_private' --- src/unit-category.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/unit-category.c b/src/unit-category.c index 56a90e2..875ea58 100644 --- a/src/unit-category.c +++ b/src/unit-category.c @@ -20,7 +20,7 @@ struct UnitCategoryPrivate GList *units; }; -G_DEFINE_TYPE (UnitCategory, unit_category, G_TYPE_OBJECT); +G_DEFINE_TYPE_WITH_PRIVATE (UnitCategory, unit_category, G_TYPE_OBJECT); UnitCategory * @@ -125,12 +125,11 @@ unit_category_convert(UnitCategory *category, const MPNumber *x, Unit *x_units, static void unit_category_class_init(UnitCategoryClass *klass) { - g_type_class_add_private(klass, sizeof(UnitCategoryPrivate)); } static void unit_category_init(UnitCategory *category) { - category->priv = G_TYPE_INSTANCE_GET_PRIVATE(category, unit_category_get_type(), UnitCategoryPrivate); + category->priv = unit_category_get_instance_private (category); } -- cgit v1.2.1