summaryrefslogtreecommitdiff
path: root/src/gpm-screensaver.c
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2019-08-15 01:57:18 +0200
committerVictor Kareh <[email protected]>2019-08-20 13:34:13 -0400
commitef3772fc6ba6ba94fb0439766f56e4576fb97a37 (patch)
tree0636170666abb6759a63fa53de18d741f8d75a06 /src/gpm-screensaver.c
parentd11450491c978d974508323376c9d7736b9ed1f8 (diff)
downloadmate-power-manager-ef3772fc6ba6ba94fb0439766f56e4576fb97a37.tar.bz2
mate-power-manager-ef3772fc6ba6ba94fb0439766f56e4576fb97a37.tar.xz
gpm-screensaver: avoid 'g_type_class_add_private'
Diffstat (limited to 'src/gpm-screensaver.c')
-rw-r--r--src/gpm-screensaver.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/gpm-screensaver.c b/src/gpm-screensaver.c
index 26e72e7..9e90359 100644
--- a/src/gpm-screensaver.c
+++ b/src/gpm-screensaver.c
@@ -32,8 +32,6 @@
static void gpm_screensaver_finalize (GObject *object);
-#define GPM_SCREENSAVER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GPM_TYPE_SCREENSAVER, GpmScreensaverPrivate))
-
#define GS_LISTENER_SERVICE "org.mate.ScreenSaver"
#define GS_LISTENER_PATH "/"
#define GS_LISTENER_INTERFACE "org.mate.ScreenSaver"
@@ -46,7 +44,7 @@ struct GpmScreensaverPrivate
static gpointer gpm_screensaver_object = NULL;
-G_DEFINE_TYPE (GpmScreensaver, gpm_screensaver, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (GpmScreensaver, gpm_screensaver, G_TYPE_OBJECT)
/**
* gpm_screensaver_lock
@@ -233,8 +231,6 @@ gpm_screensaver_class_init (GpmScreensaverClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gpm_screensaver_finalize;
- g_type_class_add_private (klass, sizeof (GpmScreensaverPrivate));
-
}
/**
@@ -246,7 +242,7 @@ gpm_screensaver_init (GpmScreensaver *screensaver)
{
DBusGConnection *connection;
- screensaver->priv = GPM_SCREENSAVER_GET_PRIVATE (screensaver);
+ screensaver->priv = gpm_screensaver_get_instance_private (screensaver);
connection = dbus_g_bus_get (DBUS_BUS_SESSION, NULL);
screensaver->priv->proxy = dbus_g_proxy_new_for_name (connection,
@@ -267,7 +263,7 @@ gpm_screensaver_finalize (GObject *object)
g_return_if_fail (GPM_IS_SCREENSAVER (object));
screensaver = GPM_SCREENSAVER (object);
- screensaver->priv = GPM_SCREENSAVER_GET_PRIVATE (screensaver);
+ screensaver->priv = gpm_screensaver_get_instance_private (screensaver);
g_object_unref (screensaver->priv->proxy);