[gnome-control-center/gbsneto/cleanup-network-panel: 14/21] net-device-simple: Remove GObject boilerplate
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/gbsneto/cleanup-network-panel: 14/21] net-device-simple: Remove GObject boilerplate
- Date: Thu, 1 Nov 2018 03:15:46 +0000 (UTC)
commit 619cf9d3da8664552b853036eed435e3e0a98905
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Wed Oct 31 21:04:29 2018 -0300
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,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]