[gnome-flashback] sound-applet: avoid deprecated g_type_class_add_private



commit 7a94d11264f4dc4632c87fffa00704aacc122b58
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Sun Sep 9 00:17:42 2018 +0300

    sound-applet: avoid deprecated g_type_class_add_private

 gnome-flashback/libsound-applet/gvc-channel-bar.c        | 8 ++------
 gnome-flashback/libsound-applet/gvc-stream-status-icon.c | 8 ++------
 2 files changed, 4 insertions(+), 12 deletions(-)
---
diff --git a/gnome-flashback/libsound-applet/gvc-channel-bar.c 
b/gnome-flashback/libsound-applet/gvc-channel-bar.c
index c54ffdf..08bcdc0 100644
--- a/gnome-flashback/libsound-applet/gvc-channel-bar.c
+++ b/gnome-flashback/libsound-applet/gvc-channel-bar.c
@@ -38,8 +38,6 @@
 #define ADJUSTMENT_MAX (bar->priv->is_amplified ? ADJUSTMENT_MAX_AMPLIFIED : ADJUSTMENT_MAX_NORMAL)
 #define SCROLLSTEP (ADJUSTMENT_MAX / 100.0 * 5.0)
 
-#define GVC_CHANNEL_BAR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GVC_TYPE_CHANNEL_BAR, 
GvcChannelBarPrivate))
-
 struct GvcChannelBarPrivate
 {
         GtkOrientation orientation;
@@ -87,7 +85,7 @@ static gboolean on_scale_scroll_event         (GtkWidget      *widget,
                                                GdkEventScroll *event,
                                                GvcChannelBar  *bar);
 
-G_DEFINE_TYPE (GvcChannelBar, gvc_channel_bar, GTK_TYPE_BOX)
+G_DEFINE_TYPE_WITH_PRIVATE (GvcChannelBar, gvc_channel_bar, GTK_TYPE_BOX)
 
 static GtkWidget *
 _scale_box_new (GvcChannelBar *bar)
@@ -719,8 +717,6 @@ gvc_channel_bar_class_init (GvcChannelBarClass *klass)
                                                                "Whether the stream is digitally amplified",
                                                                FALSE,
                                                                G_PARAM_READWRITE|G_PARAM_CONSTRUCT));
-
-        g_type_class_add_private (klass, sizeof (GvcChannelBarPrivate));
 }
 
 static void
@@ -728,7 +724,7 @@ gvc_channel_bar_init (GvcChannelBar *bar)
 {
         GtkWidget *frame;
 
-        bar->priv = GVC_CHANNEL_BAR_GET_PRIVATE (bar);
+        bar->priv = gvc_channel_bar_get_instance_private (bar);
 
         bar->priv->base_volume = ADJUSTMENT_MAX_NORMAL;
         bar->priv->low_icon_name = g_strdup ("audio-volume-low");
diff --git a/gnome-flashback/libsound-applet/gvc-stream-status-icon.c 
b/gnome-flashback/libsound-applet/gvc-stream-status-icon.c
index ca7ad23..1440257 100644
--- a/gnome-flashback/libsound-applet/gvc-stream-status-icon.c
+++ b/gnome-flashback/libsound-applet/gvc-stream-status-icon.c
@@ -32,8 +32,6 @@
 #include "gvc-channel-bar.h"
 #include "gvc-stream-status-icon.h"
 
-#define GVC_STREAM_STATUS_ICON_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), 
GVC_TYPE_STREAM_STATUS_ICON, GvcStreamStatusIconPrivate))
-
 struct GvcStreamStatusIconPrivate
 {
         char          **icon_names;
@@ -55,7 +53,7 @@ enum
 
 static void     gvc_stream_status_icon_finalize   (GObject                  *object);
 
-G_DEFINE_TYPE (GvcStreamStatusIcon, gvc_stream_status_icon, GTK_TYPE_STATUS_ICON)
+G_DEFINE_TYPE_WITH_PRIVATE (GvcStreamStatusIcon, gvc_stream_status_icon, GTK_TYPE_STATUS_ICON)
 
 static void
 on_adjustment_value_changed (GtkAdjustment *adjustment,
@@ -724,8 +722,6 @@ gvc_stream_status_icon_class_init (GvcStreamStatusIconClass *klass)
                                                              "Name of icon to display for this stream",
                                                               G_TYPE_STRV,
                                                               G_PARAM_READWRITE|G_PARAM_CONSTRUCT));
-
-        g_type_class_add_private (klass, sizeof (GvcStreamStatusIconPrivate));
 }
 
 static void
@@ -744,7 +740,7 @@ on_status_icon_visible_notify (GvcStreamStatusIcon *icon)
 static void
 gvc_stream_status_icon_init (GvcStreamStatusIcon *icon)
 {
-        icon->priv = GVC_STREAM_STATUS_ICON_GET_PRIVATE (icon);
+        icon->priv = gvc_stream_status_icon_get_instance_private (icon);
 
         g_signal_connect (icon,
                           "activate",


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