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.
This commit is contained in:
Georges Basile Stavracas Neto 2018-10-31 20:47:54 -03:00
parent 8509270562
commit e3d125860b
No known key found for this signature in database
GPG key ID: 886C17EE170D1385
2 changed files with 9 additions and 23 deletions

View file

@ -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 {

View file

@ -30,28 +30,8 @@
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))
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);