[gnome-control-center/gbsneto/cleanup-network-panel: 18/21] net-device-ethernet: Turn into a final class
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/gbsneto/cleanup-network-panel: 18/21] net-device-ethernet: Turn into a final class
- Date: Thu, 1 Nov 2018 03:16:06 +0000 (UTC)
commit 7ee56afee3c9b1474cbba8d4306b0ba7936bd04d
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]