summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2019-08-14 17:57:13 +0200
committerVictor Kareh <[email protected]>2019-08-20 13:34:13 -0400
commit88d89a99a81c8ddb942bb6b5c17eb8db9ee03b42 (patch)
tree80cbd20c3cdf9fc74cf0c6f9d4692d5ae0f0f8f0
parent201475782c82452433b3855d85e5630510239f24 (diff)
downloadmate-power-manager-88d89a99a81c8ddb942bb6b5c17eb8db9ee03b42.tar.bz2
mate-power-manager-88d89a99a81c8ddb942bb6b5c17eb8db9ee03b42.tar.xz
gpm-tray-icon: avoid 'g_type_class_add_private'
-rw-r--r--src/gpm-tray-icon.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/gpm-tray-icon.c b/src/gpm-tray-icon.c
index 903835d..ede1941 100644
--- a/src/gpm-tray-icon.c
+++ b/src/gpm-tray-icon.c
@@ -50,8 +50,6 @@
static void gpm_tray_icon_finalize (GObject *object);
-#define GPM_TRAY_ICON_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GPM_TYPE_TRAY_ICON, GpmTrayIconPrivate))
-
struct GpmTrayIconPrivate
{
GSettings *settings;
@@ -60,7 +58,7 @@ struct GpmTrayIconPrivate
gboolean show_actions;
};
-G_DEFINE_TYPE (GpmTrayIcon, gpm_tray_icon, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (GpmTrayIcon, gpm_tray_icon, G_TYPE_OBJECT)
/**
* gpm_tray_icon_enable_actions:
@@ -208,7 +206,6 @@ gpm_tray_icon_class_init (GpmTrayIconClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gpm_tray_icon_finalize;
- g_type_class_add_private (klass, sizeof (GpmTrayIconPrivate));
}
/**
@@ -469,7 +466,7 @@ gpm_tray_icon_init (GpmTrayIcon *icon)
{
gboolean allowed_in_menu;
- icon->priv = GPM_TRAY_ICON_GET_PRIVATE (icon);
+ icon->priv = gpm_tray_icon_get_instance_private (icon);
icon->priv->engine = gpm_engine_new ();