[gnome-panel] panel-session-manager: avoid deprecated g_type_class_add_private



commit 471e40a9438a17ac56ec0229f334c317379a6aed
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Thu Sep 13 02:37:10 2018 +0300

    panel-session-manager: avoid deprecated g_type_class_add_private

 gnome-panel/libpanel-util/panel-session-manager.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/gnome-panel/libpanel-util/panel-session-manager.c 
b/gnome-panel/libpanel-util/panel-session-manager.c
index 1436d854e..0e7949460 100644
--- a/gnome-panel/libpanel-util/panel-session-manager.c
+++ b/gnome-panel/libpanel-util/panel-session-manager.c
@@ -30,13 +30,11 @@ struct _PanelSessionManagerPrivate {
        GDBusProxy *session_proxy;
 };
 
-G_DEFINE_TYPE (PanelSessionManager, panel_session_manager, G_TYPE_OBJECT);
+G_DEFINE_TYPE_WITH_PRIVATE (PanelSessionManager, panel_session_manager, G_TYPE_OBJECT)
 
 static void
 panel_session_manager_class_init (PanelSessionManagerClass *klass)
 {
-       g_type_class_add_private (klass,
-                                 sizeof (PanelSessionManagerPrivate));
 }
 
 static void
@@ -44,9 +42,7 @@ panel_session_manager_init (PanelSessionManager *manager)
 {
        GError *error;
 
-       manager->priv = G_TYPE_INSTANCE_GET_PRIVATE (manager,
-                                                    PANEL_TYPE_SESSION_MANAGER,
-                                                    PanelSessionManagerPrivate);
+       manager->priv = panel_session_manager_get_instance_private (manager);
 
        error = NULL;
        manager->priv->session_proxy = g_dbus_proxy_new_for_bus_sync (


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]