From e3d125860b676cfeb8682ae612531bc4b3866aef Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Wed, 31 Oct 2018 20:47:54 -0300 Subject: [PATCH] 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 | 24 ++---------------------- 2 files changed, 9 insertions(+), 23 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)) +#define NET_TYPE_VPN (net_vpn_get_type ()) +G_DECLARE_FINAL_TYPE (NetVpn, net_vpn, NET, VPN, NetObject) -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); void net_vpn_set_show_separator (NetVpn *self, gboolean show_separator);