[gnome-panel] panel-toplevel: avoid deprecated g_type_class_add_private



commit 91c194e515583232f3ea310d2443908d65972f1c
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Thu Sep 13 17:24:16 2018 +0300

    panel-toplevel: avoid deprecated g_type_class_add_private

 gnome-panel/panel-toplevel.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
---
diff --git a/gnome-panel/panel-toplevel.c b/gnome-panel/panel-toplevel.c
index 4365a0c78..0747c8205 100644
--- a/gnome-panel/panel-toplevel.c
+++ b/gnome-panel/panel-toplevel.c
@@ -47,10 +47,6 @@
 #include "panel-lockdown.h"
 #include "panel-schemas.h"
 
-G_DEFINE_TYPE (PanelToplevel, panel_toplevel, GTK_TYPE_WINDOW)
-
-#define PANEL_TOPLEVEL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), PANEL_TYPE_TOPLEVEL, 
PanelToplevelPrivate))
-
 #define DEFAULT_SIZE              48
 #define DEFAULT_AUTO_HIDE_SIZE    1
 #define DEFAULT_HIDE_DELAY        300
@@ -238,6 +234,8 @@ enum {
 static guint         toplevel_signals [LAST_SIGNAL] = { 0 };
 static GSList       *toplevel_list = NULL;
 
+G_DEFINE_TYPE_WITH_PRIVATE (PanelToplevel, panel_toplevel, GTK_TYPE_WINDOW)
+
 static void panel_toplevel_calculate_animation_end_geometry (PanelToplevel *toplevel);
 
 static gboolean panel_toplevel_position_is_writable (PanelToplevel *toplevel);
@@ -3697,8 +3695,6 @@ panel_toplevel_class_init (PanelToplevelClass *klass)
        klass->begin_move       = panel_toplevel_begin_move;
        klass->begin_resize     = panel_toplevel_begin_resize;
 
-       g_type_class_add_private (klass, sizeof (PanelToplevelPrivate));
-
        g_object_class_install_property (
                gobject_class,
                PROP_TOPLEVEL_ID,
@@ -4071,7 +4067,7 @@ panel_toplevel_init (PanelToplevel *toplevel)
 {
        GtkWidget *widget;
 
-       toplevel->priv = PANEL_TOPLEVEL_GET_PRIVATE (toplevel);
+       toplevel->priv = panel_toplevel_get_instance_private (toplevel);
 
        toplevel->priv->toplevel_id      = NULL;
 


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