Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
mp-serializer: avoid deprecated 'g_type_class_add_private'
  • Loading branch information
sc0w committed Jan 30, 2019
1 parent e0e01b8 commit 5ffa9d9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/mp-serializer.c
Expand Up @@ -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)
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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)) : '.';
Expand Down

0 comments on commit 5ffa9d9

Please sign in to comment.