summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2019-08-15 02:00:37 +0200
committerVictor Kareh <[email protected]>2019-08-20 13:34:13 -0400
commit6f6d1fd3daf9e7e1395fa04834ca29ef404f5d2a (patch)
treeba932e6a9d3de8b61a275e6db7f4ea6e7edde311 /src
parentef3772fc6ba6ba94fb0439766f56e4576fb97a37 (diff)
downloadmate-power-manager-6f6d1fd3daf9e7e1395fa04834ca29ef404f5d2a.tar.bz2
mate-power-manager-6f6d1fd3daf9e7e1395fa04834ca29ef404f5d2a.tar.xz
gpm-prefs-core: avoid 'g_type_class_add_private'
Diffstat (limited to 'src')
-rw-r--r--src/gpm-prefs-core.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/gpm-prefs-core.c b/src/gpm-prefs-core.c
index 4d62794..58db4b4 100644
--- a/src/gpm-prefs-core.c
+++ b/src/gpm-prefs-core.c
@@ -43,8 +43,6 @@
static void gpm_prefs_finalize (GObject *object);
-#define GPM_PREFS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GPM_TYPE_PREFS, GpmPrefsPrivate))
-
struct GpmPrefsPrivate
{
UpClient *client;
@@ -69,7 +67,7 @@ enum {
static guint signals [LAST_SIGNAL] = { 0 };
-G_DEFINE_TYPE (GpmPrefs, gpm_prefs, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (GpmPrefs, gpm_prefs, G_TYPE_OBJECT)
/**
* gpm_prefs_class_init:
@@ -80,7 +78,6 @@ gpm_prefs_class_init (GpmPrefsClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gpm_prefs_finalize;
- g_type_class_add_private (klass, sizeof (GpmPrefsPrivate));
signals [ACTION_HELP] =
g_signal_new ("action-help",
@@ -685,7 +682,7 @@ gpm_prefs_init (GpmPrefs *prefs)
GVariant *res, *inner;
gchar * r;
- prefs->priv = GPM_PREFS_GET_PRIVATE (prefs);
+ prefs->priv = gpm_prefs_get_instance_private (prefs);
prefs->priv->client = up_client_new ();
prefs->priv->console = egg_console_kit_new ();
@@ -882,7 +879,7 @@ gpm_prefs_finalize (GObject *object)
g_return_if_fail (GPM_IS_PREFS (object));
prefs = GPM_PREFS (object);
- prefs->priv = GPM_PREFS_GET_PRIVATE (prefs);
+ prefs->priv = gpm_prefs_get_instance_private (prefs);
g_object_unref (prefs->priv->settings);
g_object_unref (prefs->priv->client);