diff options
author | Pablo Barciela <[email protected]> | 2019-08-14 04:25:05 +0200 |
---|---|---|
committer | Victor Kareh <[email protected]> | 2019-08-20 13:34:13 -0400 |
commit | 99bbb8323e158549436a889937d7e2e9fbb5a4c4 (patch) | |
tree | 032f3698a44d6308cb170b28ad7abfc54d3fa772 | |
parent | 3f621733493cf37357de552d8e8d9e0a06a5a34a (diff) | |
download | mate-power-manager-99bbb8323e158549436a889937d7e2e9fbb5a4c4.tar.bz2 mate-power-manager-99bbb8323e158549436a889937d7e2e9fbb5a4c4.tar.xz |
gpm-idle: avoid 'g_type_class_add_private'
-rw-r--r-- | src/gpm-idle.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/gpm-idle.c b/src/gpm-idle.c index d2e92e0..a2f1cfc 100644 --- a/src/gpm-idle.c +++ b/src/gpm-idle.c @@ -44,8 +44,6 @@ #include "gpm-load.h" #include "gpm-session.h" -#define GPM_IDLE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GPM_TYPE_IDLE, GpmIdlePrivate)) - /* Sets the idle percent limit, i.e. how hard the computer can work while considered "at idle" */ #define GPM_IDLE_CPU_LIMIT 5 @@ -74,7 +72,7 @@ enum { static guint signals [LAST_SIGNAL] = { 0 }; static gpointer gpm_idle_object = NULL; -G_DEFINE_TYPE (GpmIdle, gpm_idle, G_TYPE_OBJECT) +G_DEFINE_TYPE_WITH_PRIVATE (GpmIdle, gpm_idle, G_TYPE_OBJECT) /** * gpm_idle_mode_to_string: @@ -451,8 +449,6 @@ gpm_idle_class_init (GpmIdleClass *klass) G_STRUCT_OFFSET (GpmIdleClass, idle_changed), NULL, NULL, g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT); - - g_type_class_add_private (klass, sizeof (GpmIdlePrivate)); } /** @@ -465,7 +461,7 @@ gpm_idle_class_init (GpmIdleClass *klass) static void gpm_idle_init (GpmIdle *idle) { - idle->priv = GPM_IDLE_GET_PRIVATE (idle); + idle->priv = gpm_idle_get_instance_private (idle); idle->priv->timeout_dim = G_MAXUINT; idle->priv->timeout_blank = G_MAXUINT; |