From 3f621733493cf37357de552d8e8d9e0a06a5a34a Mon Sep 17 00:00:00 2001 From: Pablo Barciela Date: Wed, 14 Aug 2019 04:21:47 +0200 Subject: gpm-control: avoid 'g_type_class_add_private' --- src/gpm-control.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/gpm-control.c b/src/gpm-control.c index 05bd85d..25bc392 100644 --- a/src/gpm-control.c +++ b/src/gpm-control.c @@ -51,8 +51,6 @@ #include "gpm-control.h" #include "gpm-networkmanager.h" -#define GPM_CONTROL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GPM_TYPE_CONTROL, GpmControlPrivate)) - struct GpmControlPrivate { GSettings *settings; @@ -67,7 +65,7 @@ enum { static guint signals [LAST_SIGNAL] = { 0 }; static gpointer gpm_control_object = NULL; -G_DEFINE_TYPE (GpmControl, gpm_control, G_TYPE_OBJECT) +G_DEFINE_TYPE_WITH_PRIVATE (GpmControl, gpm_control, G_TYPE_OBJECT) /** * gpm_control_error_quark: @@ -480,8 +478,6 @@ gpm_control_class_init (GpmControlClass *klass) NULL, g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT); - - g_type_class_add_private (klass, sizeof (GpmControlPrivate)); } /** @@ -491,7 +487,7 @@ gpm_control_class_init (GpmControlClass *klass) static void gpm_control_init (GpmControl *control) { - control->priv = GPM_CONTROL_GET_PRIVATE (control); + control->priv = gpm_control_get_instance_private (control); control->priv->settings = g_settings_new (GPM_SETTINGS_SCHEMA); } -- cgit v1.2.1