summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2019-08-15 02:07:38 +0200
committerVictor Kareh <[email protected]>2019-08-20 13:34:13 -0400
commit19b7297855ef254c788affc1ec1214399f00e9e8 (patch)
tree3a54cb92c5d09438d8da70aff19eaa81855c67e7
parent420d4ed73391b9ba09ab6ff8331545fee0e3ae15 (diff)
downloadmate-power-manager-19b7297855ef254c788affc1ec1214399f00e9e8.tar.bz2
mate-power-manager-19b7297855ef254c788affc1ec1214399f00e9e8.tar.xz
egg-console-kit: avoid 'g_type_class_add_private'
-rw-r--r--src/egg-console-kit.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/egg-console-kit.c b/src/egg-console-kit.c
index df47210..32a81bd 100644
--- a/src/egg-console-kit.c
+++ b/src/egg-console-kit.c
@@ -33,8 +33,6 @@
static void egg_console_kit_finalize (GObject *object);
-#define EGG_CONSOLE_KIT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), EGG_TYPE_CONSOLE_KIT, EggConsoleKitPrivate))
-
#define CONSOLEKIT_NAME "org.freedesktop.ConsoleKit"
#define CONSOLEKIT_PATH "/org/freedesktop/ConsoleKit"
#define CONSOLEKIT_INTERFACE "org.freedesktop.ConsoleKit"
@@ -59,7 +57,8 @@ enum {
static gpointer egg_console_kit_object = NULL;
static guint signals [EGG_CONSOLE_KIT_LAST_SIGNAL] = { 0 };
-G_DEFINE_TYPE (EggConsoleKit, egg_console_kit, G_TYPE_OBJECT)
+
+G_DEFINE_TYPE_WITH_PRIVATE (EggConsoleKit, egg_console_kit, G_TYPE_OBJECT)
/**
* egg_console_kit_restart:
@@ -357,7 +356,7 @@ egg_console_kit_class_init (EggConsoleKitClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = egg_console_kit_finalize;
- g_type_class_add_private (klass, sizeof (EggConsoleKitPrivate));
+
signals [EGG_CONSOLE_KIT_ACTIVE_CHANGED] =
g_signal_new ("active-changed",
G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST,
@@ -376,7 +375,7 @@ egg_console_kit_init (EggConsoleKit *console)
GError *error = NULL;
guint32 pid;
- console->priv = EGG_CONSOLE_KIT_GET_PRIVATE (console);
+ console->priv = egg_console_kit_get_instance_private (console);
console->priv->proxy_manager = NULL;
console->priv->session_id = NULL;