Commit d4da2cde authored by Philip Withnall's avatar Philip Withnall

lib: Drop use of deprecated g_type_class_add_private()

Use G_DEFINE_TYPE_WITH_PRIVATE instead. It’s existed since GLib 2.38, so
we need to bump our dependency.
Signed-off-by: default avatarPhilip Withnall <withnall@endlessm.com>
parent d8deb395
......@@ -76,7 +76,7 @@ struct _UhmResolverPrivate {
GList *fake_SRV;
};
G_DEFINE_TYPE (UhmResolver, uhm_resolver, G_TYPE_RESOLVER)
G_DEFINE_TYPE_WITH_PRIVATE (UhmResolver, uhm_resolver, G_TYPE_RESOLVER)
static void
uhm_resolver_class_init (UhmResolverClass *klass)
......@@ -84,8 +84,6 @@ uhm_resolver_class_init (UhmResolverClass *klass)
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GResolverClass *resolver_class = G_RESOLVER_CLASS (klass);
g_type_class_add_private (klass, sizeof (UhmResolverPrivate));
gobject_class->finalize = uhm_resolver_finalize;
resolver_class->lookup_by_name = uhm_resolver_lookup_by_name;
......@@ -99,7 +97,7 @@ uhm_resolver_class_init (UhmResolverClass *klass)
static void
uhm_resolver_init (UhmResolver *self)
{
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, UHM_TYPE_RESOLVER, UhmResolverPrivate);
self->priv = uhm_resolver_get_instance_private (self);
}
static void
......
......@@ -152,15 +152,13 @@ enum {
static guint signals[LAST_SIGNAL] = { 0, };
G_DEFINE_TYPE (UhmServer, uhm_server, G_TYPE_OBJECT)
G_DEFINE_TYPE_WITH_PRIVATE (UhmServer, uhm_server, G_TYPE_OBJECT)
static void
uhm_server_class_init (UhmServerClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
g_type_class_add_private (klass, sizeof (UhmServerPrivate));
gobject_class->get_property = uhm_server_get_property;
gobject_class->set_property = uhm_server_set_property;
gobject_class->dispose = uhm_server_dispose;
......@@ -335,7 +333,7 @@ uhm_server_class_init (UhmServerClass *klass)
static void
uhm_server_init (UhmServer *self)
{
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, UHM_TYPE_SERVER, UhmServerPrivate);
self->priv = uhm_server_get_instance_private (self);
}
static void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment