[gnome-control-center/gbsneto/cleanup-network-panel: 9/21] net-vpn: Remove macro to get private field



commit 32cef315c90e4e46250f9ae278fd733ce4a98c5d
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Wed Oct 31 20:44:39 2018 -0300

    net-vpn: Remove macro to get private field
    
    We can just use the standard, non-deprecated G_DEFINE_TYPE_WITH_PRIVATE
    and avoid g_type_class_add_private(), which is deprecated now.

 panels/network/net-vpn.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/panels/network/net-vpn.c b/panels/network/net-vpn.c
index 490cfee46..a11221972 100644
--- a/panels/network/net-vpn.c
+++ b/panels/network/net-vpn.c
@@ -31,8 +31,6 @@
 
 #include "connection-editor/net-connection-editor.h"
 
-#define NET_VPN_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NET_TYPE_VPN, NetVpnPrivate))
-
 struct _NetVpnPrivate
 {
         GtkBuilder              *builder;
@@ -49,7 +47,7 @@ enum {
         PROP_LAST
 };
 
-G_DEFINE_TYPE (NetVpn, net_vpn, NET_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (NetVpn, net_vpn, NET_TYPE_OBJECT)
 
 static void nm_device_refresh_vpn_ui (NetVpn *vpn);
 
@@ -412,8 +410,6 @@ net_vpn_class_init (NetVpnClass *klass)
                                      NM_TYPE_CONNECTION,
                                      G_PARAM_READWRITE | G_PARAM_CONSTRUCT);
         g_object_class_install_property (object_class, PROP_CONNECTION, pspec);
-
-        g_type_class_add_private (klass, sizeof (NetVpnPrivate));
 }
 
 static void
@@ -422,7 +418,7 @@ net_vpn_init (NetVpn *vpn)
         GError *error = NULL;
         GtkWidget *widget;
 
-        vpn->priv = NET_VPN_GET_PRIVATE (vpn);
+        vpn->priv = net_vpn_get_instance_private (vpn);
 
         vpn->priv->builder = gtk_builder_new ();
         gtk_builder_add_from_resource (vpn->priv->builder,


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