[gnome-panel] panel-applet-container: avoid deprecated g_type_class_add_private



commit 63799f7bd5e4a676ae3f57082104240c314cff29
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Thu Sep 13 02:30:46 2018 +0300

    panel-applet-container: avoid deprecated g_type_class_add_private

 gnome-panel/libpanel-applet-private/panel-applet-container.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
---
diff --git a/gnome-panel/libpanel-applet-private/panel-applet-container.c 
b/gnome-panel/libpanel-applet-private/panel-applet-container.c
index 7534390bf..006bbe611 100644
--- a/gnome-panel/libpanel-applet-private/panel-applet-container.c
+++ b/gnome-panel/libpanel-applet-private/panel-applet-container.c
@@ -58,15 +58,14 @@ static const AppletPropertyInfo applet_properties [] = {
        { "locked-down",   "LockedDown" }
 };
 
-#define PANEL_APPLET_CONTAINER_GET_PRIVATE(o) \
-       (G_TYPE_INSTANCE_GET_PRIVATE ((o), PANEL_TYPE_APPLET_CONTAINER, PanelAppletContainerPrivate))
-
 #define PANEL_APPLET_BUS_NAME            "org.gnome.panel.applet.%s"
 #define PANEL_APPLET_FACTORY_INTERFACE   "org.gnome.panel.applet.AppletFactory"
 #define PANEL_APPLET_FACTORY_OBJECT_PATH "/org/gnome/panel/applet/%s"
 #define PANEL_APPLET_INTERFACE           "org.gnome.panel.applet.Applet"
 
-G_DEFINE_TYPE (PanelAppletContainer, panel_applet_container, GTK_TYPE_EVENT_BOX);
+G_DEFINE_TYPE_WITH_PRIVATE (PanelAppletContainer,
+                            panel_applet_container,
+                            GTK_TYPE_EVENT_BOX)
 
 GQuark
 panel_applet_container_error_quark (void)
@@ -77,7 +76,7 @@ panel_applet_container_error_quark (void)
 static void
 panel_applet_container_init (PanelAppletContainer *container)
 {
-       container->priv = PANEL_APPLET_CONTAINER_GET_PRIVATE (container);
+       container->priv = panel_applet_container_get_instance_private (container);
 
        container->priv->pending_ops = g_hash_table_new_full (g_direct_hash,
                                                              g_direct_equal,
@@ -152,8 +151,6 @@ panel_applet_container_class_init (PanelAppletContainerClass *klass)
 {
        GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
 
-       g_type_class_add_private (klass, sizeof (PanelAppletContainerPrivate));
-
        gobject_class->dispose = panel_applet_container_dispose;
 
        signals[APPLET_MOVE] =


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