Skip to content

Commit

Permalink
unit-category: avoid deprecated 'g_type_class_add_private'
Browse files Browse the repository at this point in the history
  • Loading branch information
sc0w committed Jan 30, 2019
1 parent e8ddb38 commit 25f0f0a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/unit-category.c
Expand Up @@ -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 *
Expand Down Expand Up @@ -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);
}

0 comments on commit 25f0f0a

Please sign in to comment.