From c4f34569c0bbb42dea201d989a822f8ddde9c1e7 Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Wed, 31 Oct 2018 20:19:46 -0300 Subject: [PATCH] net-device: Remove GObject boilerplate Now that NetDevice is a bit more clean, switch to G_DECLARE_DERIVABLE_TYPE() and remove the old style GObject boilerplate. --- panels/network/net-device.c | 4 ++-- panels/network/net-device.h | 15 +-------------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/panels/network/net-device.c b/panels/network/net-device.c index e8bb0f110..d73b537b9 100644 --- a/panels/network/net-device.c +++ b/panels/network/net-device.c @@ -30,11 +30,11 @@ #include "net-device.h" -struct _NetDevicePrivate +typedef struct { NMDevice *nm_device; guint changed_id; -}; +} NetDevicePrivate; enum { PROP_0, diff --git a/panels/network/net-device.h b/panels/network/net-device.h index 938624ffd..a95419584 100644 --- a/panels/network/net-device.h +++ b/panels/network/net-device.h @@ -30,20 +30,8 @@ G_BEGIN_DECLS #define NET_TYPE_DEVICE (net_device_get_type ()) -#define NET_DEVICE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), NET_TYPE_DEVICE, NetDevice)) -#define NET_DEVICE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), NET_TYPE_DEVICE, NetDeviceClass)) -#define NET_IS_DEVICE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), NET_TYPE_DEVICE)) -#define NET_IS_DEVICE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), NET_TYPE_DEVICE)) -#define NET_DEVICE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), NET_TYPE_DEVICE, NetDeviceClass)) -typedef struct _NetDevicePrivate NetDevicePrivate; -typedef struct _NetDevice NetDevice; -typedef struct _NetDeviceClass NetDeviceClass; - -struct _NetDevice -{ - NetObject parent; -}; +G_DECLARE_DERIVABLE_TYPE (NetDevice, net_device, NET, DEVICE, NetObject) struct _NetDeviceClass { @@ -52,7 +40,6 @@ struct _NetDeviceClass NMConnection * (*get_find_connection) (NetDevice *device); }; -GType net_device_get_type (void); NetDevice *net_device_new (void); NMDevice *net_device_get_nm_device (NetDevice *device); NMConnection *net_device_get_find_connection (NetDevice *device);