From 66ed8916f0a4432310dc97de1e07b3d2dae444a0 Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Wed, 31 Oct 2018 21:04:29 -0300 Subject: [PATCH] net-device-simple: Remove GObject boilerplate Now that NetDeviceSimple is cleaned up, switch to G_DECLARE_DERIVABLE_TYPE() and remove the old style GObject boilerplate. --- panels/network/net-device-simple.c | 4 ++-- panels/network/net-device-simple.h | 19 ++----------------- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/panels/network/net-device-simple.c b/panels/network/net-device-simple.c index 2eb326884..8694d4142 100644 --- a/panels/network/net-device-simple.c +++ b/panels/network/net-device-simple.c @@ -31,11 +31,11 @@ #include "net-device-simple.h" -struct _NetDeviceSimplePrivate +typedef struct { GtkBuilder *builder; gboolean updating_device; -}; +} NetDeviceSimplePrivate; G_DEFINE_TYPE_WITH_PRIVATE (NetDeviceSimple, net_device_simple, NET_TYPE_DEVICE) diff --git a/panels/network/net-device-simple.h b/panels/network/net-device-simple.h index a13a306f3..738c0ddee 100644 --- a/panels/network/net-device-simple.h +++ b/panels/network/net-device-simple.h @@ -29,21 +29,8 @@ G_BEGIN_DECLS -#define NET_TYPE_DEVICE_SIMPLE (net_device_simple_get_type ()) -#define NET_DEVICE_SIMPLE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), NET_TYPE_DEVICE_SIMPLE, NetDeviceSimple)) -#define NET_DEVICE_SIMPLE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), NET_TYPE_DEVICE_SIMPLE, NetDeviceSimpleClass)) -#define NET_IS_DEVICE_SIMPLE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), NET_TYPE_DEVICE_SIMPLE)) -#define NET_IS_DEVICE_SIMPLE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), NET_TYPE_DEVICE_SIMPLE)) -#define NET_DEVICE_SIMPLE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), NET_TYPE_DEVICE_SIMPLE, NetDeviceSimpleClass)) - -typedef struct _NetDeviceSimplePrivate NetDeviceSimplePrivate; -typedef struct _NetDeviceSimple NetDeviceSimple; -typedef struct _NetDeviceSimpleClass NetDeviceSimpleClass; - -struct _NetDeviceSimple -{ - NetDevice parent; -}; +#define NET_TYPE_DEVICE_SIMPLE (net_device_simple_get_type ()) +G_DECLARE_DERIVABLE_TYPE (NetDeviceSimple, net_device_simple, NET, DEVICE_SIMPLE, NetDevice) struct _NetDeviceSimpleClass { @@ -52,8 +39,6 @@ struct _NetDeviceSimpleClass char *(*get_speed) (NetDeviceSimple *device_simple); }; -GType net_device_simple_get_type (void); - char *net_device_simple_get_speed (NetDeviceSimple *device_simple); void net_device_simple_add_row (NetDeviceSimple *device_simple,