summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2019-08-14 14:05:55 +0200
committerVictor Kareh <[email protected]>2019-08-20 13:34:13 -0400
commit2c4e0084e084c8c96ef5d595d5553b65f62a3c56 (patch)
tree5b781a5ae8db83b48a8453fcf3272167e0e0d02e /src
parentf790b7082578d628b1117a1b5ddb03924f763877 (diff)
downloadmate-power-manager-2c4e0084e084c8c96ef5d595d5553b65f62a3c56.tar.bz2
mate-power-manager-2c4e0084e084c8c96ef5d595d5553b65f62a3c56.tar.xz
gpm-manager: avoid 'g_type_class_add_private'
Diffstat (limited to 'src')
-rw-r--r--src/gpm-manager.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/gpm-manager.c b/src/gpm-manager.c
index 71e5de9..1d70c5c 100644
--- a/src/gpm-manager.c
+++ b/src/gpm-manager.c
@@ -66,7 +66,6 @@
static void gpm_manager_finalize (GObject *object);
-#define GPM_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GPM_TYPE_MANAGER, GpmManagerPrivate))
#define GPM_MANAGER_NOTIFY_TIMEOUT_NEVER 0 /* ms */
#define GPM_MANAGER_NOTIFY_TIMEOUT_SHORT 10 * 1000 /* ms */
#define GPM_MANAGER_NOTIFY_TIMEOUT_LONG 30 * 1000 /* ms */
@@ -117,7 +116,7 @@ typedef enum {
GPM_MANAGER_SOUND_LAST
} GpmManagerSound;
-G_DEFINE_TYPE (GpmManager, gpm_manager, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (GpmManager, gpm_manager, G_TYPE_OBJECT)
/**
* gpm_manager_error_quark:
@@ -1048,7 +1047,6 @@ gpm_manager_class_init (GpmManagerClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gpm_manager_finalize;
- g_type_class_add_private (klass, sizeof (GpmManagerPrivate));
}
/**
@@ -1823,7 +1821,7 @@ gpm_manager_init (GpmManager *manager)
GDBusConnection *g_connection;
GError *error = NULL;
- manager->priv = GPM_MANAGER_GET_PRIVATE (manager);
+ manager->priv = gpm_manager_get_instance_private (manager);
connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
g_connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error);