diff options
author | Pablo Barciela <[email protected]> | 2019-01-29 18:48:14 +0100 |
---|---|---|
committer | ZenWalker <[email protected]> | 2019-01-30 20:17:06 +0100 |
commit | 5ffa9d9f00360485763e0e72655e152acf9ed5d6 (patch) | |
tree | dde4dd48daa69ed74115fd6d5c6cf2416316e06f /src | |
parent | e0e01b806ca252ef07147527c1e51bd4e2b523ff (diff) | |
download | mate-calc-5ffa9d9f00360485763e0e72655e152acf9ed5d6.tar.bz2 mate-calc-5ffa9d9f00360485763e0e72655e152acf9ed5d6.tar.xz |
mp-serializer: avoid deprecated 'g_type_class_add_private'
Diffstat (limited to 'src')
-rw-r--r-- | src/mp-serializer.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/mp-serializer.c b/src/mp-serializer.c index 356fc55..560aa64 100644 --- a/src/mp-serializer.c +++ b/src/mp-serializer.c @@ -42,7 +42,7 @@ struct MpSerializerPrivate }; -G_DEFINE_TYPE(MpSerializer, mp_serializer, G_TYPE_OBJECT); +G_DEFINE_TYPE_WITH_PRIVATE (MpSerializer, mp_serializer, G_TYPE_OBJECT); MpSerializer * mp_serializer_new(MpDisplayFormat format, int base, int trailing_digits) @@ -559,8 +559,6 @@ mp_serializer_class_init(MpSerializerClass *klass) object_class->get_property = mp_serializer_get_property; object_class->set_property = mp_serializer_set_property; - g_type_class_add_private(klass, sizeof(MpSerializerPrivate)); - g_object_class_install_property(object_class, PROP_SHOW_THOUSANDS_SEPARATORS, g_param_spec_boolean("show-thousands-separators", @@ -597,7 +595,7 @@ static void mp_serializer_init(MpSerializer *serializer) { gchar *radix, *tsep; - serializer->priv = G_TYPE_INSTANCE_GET_PRIVATE(serializer, mp_serializer_get_type(), MpSerializerPrivate); + serializer->priv = mp_serializer_get_instance_private (serializer); radix = nl_langinfo(RADIXCHAR); serializer->priv->radix = radix ? g_utf8_get_char(g_locale_to_utf8(radix, -1, NULL, NULL, NULL)) : '.'; |