[gnome-panel] panel-action-button: avoid deprecated g_type_class_add_private



commit 5982aa63c975be8720dd07344fe8b871ea63a1e9
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Thu Sep 13 17:28:32 2018 +0300

    panel-action-button: avoid deprecated g_type_class_add_private

 gnome-panel/panel-action-button.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
---
diff --git a/gnome-panel/panel-action-button.c b/gnome-panel/panel-action-button.c
index 3319e783f..3f80ce870 100644
--- a/gnome-panel/panel-action-button.c
+++ b/gnome-panel/panel-action-button.c
@@ -48,10 +48,6 @@
 #include "panel-lockdown.h"
 #include "panel-icon-names.h"
 
-G_DEFINE_TYPE (PanelActionButton, panel_action_button, BUTTON_TYPE_WIDGET)
-
-#define PANEL_ACTION_BUTTON_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), PANEL_TYPE_ACTION_BUTTON, 
PanelActionButtonPrivate))
-
 enum {
        PROP_0,
        PROP_ACTION_TYPE,
@@ -65,6 +61,8 @@ struct _PanelActionButtonPrivate {
        guint                  dnd_enabled : 1;
 };
 
+G_DEFINE_TYPE_WITH_PRIVATE (PanelActionButton, panel_action_button, BUTTON_TYPE_WIDGET)
+
 typedef struct {
        gint enum_value;
        const gchar* str;
@@ -629,8 +627,6 @@ panel_action_button_class_init (PanelActionButtonClass *klass)
 
        button_class->clicked       = panel_action_button_clicked;
 
-       g_type_class_add_private (klass, sizeof (PanelActionButtonPrivate));
-
        g_object_class_install_property (
                        gobject_class,
                        PROP_ACTION_TYPE,
@@ -654,7 +650,7 @@ panel_action_button_class_init (PanelActionButtonClass *klass)
 static void
 panel_action_button_init (PanelActionButton *button)
 {
-       button->priv = PANEL_ACTION_BUTTON_GET_PRIVATE (button);
+       button->priv = panel_action_button_get_instance_private (button);
 
        button->priv->type = PANEL_ACTION_NONE;
        button->priv->info = NULL;


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