[gnome-control-center/gbsneto/cleanup-network-panel: 6/23] net-device: Remove GObject boilerplate



commit c4f34569c0bbb42dea201d989a822f8ddde9c1e7
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Wed Oct 31 20:19:46 2018 -0300

    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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]