[gnome-control-center/gbsneto/cleanup-network-panel: 19/23] net-device-ethernet: Turn into a final class



commit 5d10d7121b438a7feee10959fa01de2a2ca85e1f
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Wed Oct 31 21:58:34 2018 -0300

    net-device-ethernet: Turn into a final class
    
    This one did not require any specific changes beyond moving
    the struct definition to the .c file, and removing the old
    style GObject boilerplate. Remarkably easy.

 panels/network/net-device-ethernet.c | 16 ++++++++++++++++
 panels/network/net-device-ethernet.h | 33 +--------------------------------
 2 files changed, 17 insertions(+), 32 deletions(-)
---
diff --git a/panels/network/net-device-ethernet.c b/panels/network/net-device-ethernet.c
index afb544352..816653017 100644
--- a/panels/network/net-device-ethernet.c
+++ b/panels/network/net-device-ethernet.c
@@ -34,6 +34,22 @@
 
 #include "net-device-ethernet.h"
 
+struct _NetDeviceEthernet
+{
+        NetDeviceSimple parent;
+
+        GtkBuilder *builder;
+
+        GtkWidget *list;
+        GtkWidget *scrolled_window;
+        GtkWidget *details;
+        GtkWidget *details_button;
+        GtkWidget *add_profile_button;
+        gboolean   updating_device;
+
+        GHashTable *connections;
+};
+
 G_DEFINE_TYPE (NetDeviceEthernet, net_device_ethernet, NET_TYPE_DEVICE_SIMPLE)
 
 static char *
diff --git a/panels/network/net-device-ethernet.h b/panels/network/net-device-ethernet.h
index 0d92fd10b..85da5bf3b 100644
--- a/panels/network/net-device-ethernet.h
+++ b/panels/network/net-device-ethernet.h
@@ -29,38 +29,7 @@
 G_BEGIN_DECLS
 
 #define NET_TYPE_DEVICE_ETHERNET          (net_device_ethernet_get_type ())
-#define NET_DEVICE_ETHERNET(o)            (G_TYPE_CHECK_INSTANCE_CAST ((o), NET_TYPE_DEVICE_ETHERNET, 
NetDeviceEthernet))
-#define NET_DEVICE_ETHERNET_CLASS(k)      (G_TYPE_CHECK_CLASS_CAST((k), NET_TYPE_DEVICE_ETHERNET, 
NetDeviceEthernetClass))
-#define NET_IS_DEVICE_ETHERNET(o)         (G_TYPE_CHECK_INSTANCE_TYPE ((o), NET_TYPE_DEVICE_ETHERNET))
-#define NET_IS_DEVICE_ETHERNET_CLASS(k)   (G_TYPE_CHECK_CLASS_TYPE ((k), NET_TYPE_DEVICE_ETHERNET))
-#define NET_DEVICE_ETHERNET_GET_CLASS(o)  (G_TYPE_INSTANCE_GET_CLASS ((o), NET_TYPE_DEVICE_ETHERNET, 
NetDeviceEthernetClass))
-
-typedef struct _NetDeviceEthernetPrivate   NetDeviceEthernetPrivate;
-typedef struct _NetDeviceEthernet          NetDeviceEthernet;
-typedef struct _NetDeviceEthernetClass     NetDeviceEthernetClass;
-
-struct _NetDeviceEthernet
-{
-        NetDeviceSimple parent;
-
-        GtkBuilder *builder;
-
-        GtkWidget *list;
-        GtkWidget *scrolled_window;
-        GtkWidget *details;
-        GtkWidget *details_button;
-        GtkWidget *add_profile_button;
-        gboolean   updating_device;
-
-        GHashTable *connections;
-};
-
-struct _NetDeviceEthernetClass
-{
-        NetDeviceSimpleClass parent_class;
-};
-
-GType net_device_ethernet_get_type (void);
+G_DECLARE_FINAL_TYPE (NetDeviceEthernet, net_device_ethernet, NET, DEVICE_ETHERNET, NetDeviceSimple)
 
 G_END_DECLS
 


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