diff options
author | Pablo Barciela <[email protected]> | 2019-08-14 04:27:49 +0200 |
---|---|---|
committer | Victor Kareh <[email protected]> | 2019-08-20 13:34:13 -0400 |
commit | 13098cb55071a3945c7f675028ce73a5c560ca4b (patch) | |
tree | 2c5e0181c27ff17d2191561754a4a794784302fc /src/gpm-session.c | |
parent | 99bbb8323e158549436a889937d7e2e9fbb5a4c4 (diff) | |
download | mate-power-manager-13098cb55071a3945c7f675028ce73a5c560ca4b.tar.bz2 mate-power-manager-13098cb55071a3945c7f675028ce73a5c560ca4b.tar.xz |
gpm-session: avoid 'g_type_class_add_private'
Diffstat (limited to 'src/gpm-session.c')
-rw-r--r-- | src/gpm-session.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/gpm-session.c b/src/gpm-session.c index 3baa818..38cee94 100644 --- a/src/gpm-session.c +++ b/src/gpm-session.c @@ -33,8 +33,6 @@ static void gpm_session_finalize (GObject *object); -#define GPM_SESSION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GPM_TYPE_SESSION, GpmSessionPrivate)) - #define GPM_SESSION_MANAGER_SERVICE "org.gnome.SessionManager" #define GPM_SESSION_MANAGER_PATH "/org/gnome/SessionManager" #define GPM_SESSION_MANAGER_INTERFACE "org.gnome.SessionManager" @@ -82,7 +80,7 @@ enum { static guint signals [LAST_SIGNAL] = { 0 }; static gpointer gpm_session_object = NULL; -G_DEFINE_TYPE (GpmSession, gpm_session, G_TYPE_OBJECT) +G_DEFINE_TYPE_WITH_PRIVATE (GpmSession, gpm_session, G_TYPE_OBJECT) /** * gpm_session_logout: @@ -398,7 +396,6 @@ gpm_session_class_init (GpmSessionClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); object_class->finalize = gpm_session_finalize; - g_type_class_add_private (klass, sizeof (GpmSessionPrivate)); signals [IDLE_CHANGED] = g_signal_new ("idle-changed", @@ -454,7 +451,7 @@ gpm_session_init (GpmSession *session) DBusGConnection *connection; GError *error = NULL; - session->priv = GPM_SESSION_GET_PRIVATE (session); + session->priv = gpm_session_get_instance_private (session); session->priv->is_idle_old = FALSE; session->priv->is_idle_inhibited_old = FALSE; session->priv->is_suspend_inhibited_old = FALSE; @@ -523,7 +520,7 @@ gpm_session_finalize (GObject *object) g_return_if_fail (GPM_IS_SESSION (object)); session = GPM_SESSION (object); - session->priv = GPM_SESSION_GET_PRIVATE (session); + session->priv = gpm_session_get_instance_private (session); g_object_unref (session->priv->proxy); g_object_unref (session->priv->proxy_presence); |