[gnome-panel] notification-area: avoid deprecated g_type_class_add_private



commit cb2cc3a6840bc17959393bcd78b5800a4a51abeb
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Tue Sep 11 14:33:33 2018 +0300

    notification-area: avoid deprecated g_type_class_add_private

 modules/notification-area/fixedtip.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
---
diff --git a/modules/notification-area/fixedtip.c b/modules/notification-area/fixedtip.c
index a1e015984..b22e2b077 100644
--- a/modules/notification-area/fixedtip.c
+++ b/modules/notification-area/fixedtip.c
@@ -36,7 +36,7 @@ struct _NaFixedTipPrivate
   GtkOrientation  orientation;
 };
 
-G_DEFINE_TYPE (NaFixedTip, na_fixed_tip, GTK_TYPE_WINDOW)
+G_DEFINE_TYPE_WITH_PRIVATE (NaFixedTip, na_fixed_tip, GTK_TYPE_WINDOW)
 
 static gboolean
 button_press_handler (GtkWidget      *fixedtip,
@@ -91,8 +91,6 @@ na_fixed_tip_class_init (NaFixedTipClass *class)
                  G_STRUCT_OFFSET (NaFixedTipClass, clicked),
                  NULL, NULL, NULL,
                  G_TYPE_NONE, 0);
-
-  g_type_class_add_private (class, sizeof (NaFixedTipPrivate));
 }
 
 /* Did you already see this code? Yes, it's gtk_tooltips_ force_window() ;-) */
@@ -101,8 +99,7 @@ na_fixed_tip_init (NaFixedTip *fixedtip)
 {
   GtkWidget *label;
 
-  fixedtip->priv = G_TYPE_INSTANCE_GET_PRIVATE (fixedtip, NA_TYPE_FIXED_TIP,
-                                                NaFixedTipPrivate);
+  fixedtip->priv = na_fixed_tip_get_instance_private (fixedtip);
 
   gtk_window_set_type_hint (GTK_WINDOW (fixedtip),
                             GDK_WINDOW_TYPE_HINT_TOOLTIP);


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