[gnome-control-center/gbsneto/cleanup-network-panel: 10/21] net-vpn: Turn into a final class



commit 6ac5de2791e300f93e7f19951141cc57824d1abe
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Wed Oct 31 20:47:54 2018 -0300

    net-vpn: Turn into a final class
    
    Remove the old style GObject boilerplate and replace it by
    G_DECLARE_FINAL_TYPE(). Move the NetVpn structure definition
    to the .c file too.

 panels/network/net-vpn.c |  8 +++++++-
 panels/network/net-vpn.h | 26 +++-----------------------
 2 files changed, 10 insertions(+), 24 deletions(-)
---
diff --git a/panels/network/net-vpn.c b/panels/network/net-vpn.c
index a11221972..7fb14e55b 100644
--- a/panels/network/net-vpn.c
+++ b/panels/network/net-vpn.c
@@ -31,7 +31,7 @@
 
 #include "connection-editor/net-connection-editor.h"
 
-struct _NetVpnPrivate
+typedef struct
 {
         GtkBuilder              *builder;
         NMConnection            *connection;
@@ -39,6 +39,12 @@ struct _NetVpnPrivate
         gchar                   *service_type;
         gboolean                 valid;
         gboolean                 updating_device;
+} NetVpnPrivate;
+
+struct _NetVpn
+{
+         NetObject               parent;
+         NetVpnPrivate          *priv;
 };
 
 enum {
diff --git a/panels/network/net-vpn.h b/panels/network/net-vpn.h
index adcf8ad75..e12c377ca 100644
--- a/panels/network/net-vpn.h
+++ b/panels/network/net-vpn.h
@@ -29,29 +29,9 @@
 
 G_BEGIN_DECLS
 
-#define NET_TYPE_VPN          (net_vpn_get_type ())
-#define NET_VPN(o)            (G_TYPE_CHECK_INSTANCE_CAST ((o), NET_TYPE_VPN, NetVpn))
-#define NET_VPN_CLASS(k)      (G_TYPE_CHECK_CLASS_CAST((k), NET_TYPE_VPN, NetVpnClass))
-#define NET_IS_VPN(o)         (G_TYPE_CHECK_INSTANCE_TYPE ((o), NET_TYPE_VPN))
-#define NET_IS_VPN_CLASS(k)   (G_TYPE_CHECK_CLASS_TYPE ((k), NET_TYPE_VPN))
-#define NET_VPN_GET_CLASS(o)  (G_TYPE_INSTANCE_GET_CLASS ((o), NET_TYPE_VPN, NetVpnClass))
-
-typedef struct _NetVpnPrivate         NetVpnPrivate;
-typedef struct _NetVpn                NetVpn;
-typedef struct _NetVpnClass           NetVpnClass;
-
-struct _NetVpn
-{
-         NetObject               parent;
-         NetVpnPrivate          *priv;
-};
-
-struct _NetVpnClass
-{
-        NetObjectClass               parent_class;
-};
-
-GType            net_vpn_get_type               (void);
+#define NET_TYPE_VPN (net_vpn_get_type ())
+G_DECLARE_FINAL_TYPE (NetVpn, net_vpn, NET, VPN, NetObject)
+
 void             net_vpn_set_show_separator     (NetVpn   *self,
                                                  gboolean  show_separator);
 


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