summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2019-01-29 19:00:18 +0100
committerZenWalker <[email protected]>2019-01-30 20:17:45 +0100
commit25f0f0a234059d282dbf445c3ca47cb0c08c3ca4 (patch)
treeb7f22c66db03221aca4618bc82063e2800b008f1 /src
parente8ddb38f2b72ae383e4eb35ecb7774e09e29e3e9 (diff)
downloadmate-calc-25f0f0a234059d282dbf445c3ca47cb0c08c3ca4.tar.bz2
mate-calc-25f0f0a234059d282dbf445c3ca47cb0c08c3ca4.tar.xz
unit-category: avoid deprecated 'g_type_class_add_private'
Diffstat (limited to 'src')
-rw-r--r--src/unit-category.c5
1 files 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);
}