[gnome-control-center/gbsneto/cleanup-network-panel: 7/21] net-device-wifi: 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: 7/21] net-device-wifi: Turn into a final class
- Date: Thu, 1 Nov 2018 03:15:11 +0000 (UTC)
commit 2ffa36f9bac3471defc6120640c1af1712e1156d
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Wed Oct 31 20:34:00 2018 -0300
net-device-wifi: Turn into a final class
Remove the old style GObject boilerplate and replace it by
G_DECLARE_FINAL_TYPE(). Move the NetDeviceWifi structure
definition to the .c file too.
panels/network/net-device-wifi.c | 8 +++++++-
panels/network/net-device-wifi.h | 24 ++----------------------
2 files changed, 9 insertions(+), 23 deletions(-)
---
diff --git a/panels/network/net-device-wifi.c b/panels/network/net-device-wifi.c
index d61976402..0251823ec 100644
--- a/panels/network/net-device-wifi.c
+++ b/panels/network/net-device-wifi.c
@@ -52,7 +52,7 @@ static void show_wifi_list (NetDeviceWifi *device_wifi);
static void populate_ap_list (NetDeviceWifi *device_wifi);
static void show_hotspot_ui (NetDeviceWifi *device_wifi);
-struct _NetDeviceWifiPrivate
+typedef struct
{
GtkBuilder *builder;
GtkWidget *details_dialog;
@@ -63,6 +63,12 @@ struct _NetDeviceWifiPrivate
gchar *selected_ap_id;
guint scan_id;
GCancellable *cancellable;
+} NetDeviceWifiPrivate;
+
+struct _NetDeviceWifi
+{
+ NetDevice parent;
+ NetDeviceWifiPrivate *priv;
};
G_DEFINE_TYPE_WITH_PRIVATE (NetDeviceWifi, net_device_wifi, NET_TYPE_DEVICE)
diff --git a/panels/network/net-device-wifi.h b/panels/network/net-device-wifi.h
index d8baf5075..9227d1c19 100644
--- a/panels/network/net-device-wifi.h
+++ b/panels/network/net-device-wifi.h
@@ -29,28 +29,8 @@
G_BEGIN_DECLS
#define NET_TYPE_DEVICE_WIFI (net_device_wifi_get_type ())
-#define NET_DEVICE_WIFI(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), NET_TYPE_DEVICE_WIFI, NetDeviceWifi))
-#define NET_DEVICE_WIFI_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), NET_TYPE_DEVICE_WIFI,
NetDeviceWifiClass))
-#define NET_IS_DEVICE_WIFI(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), NET_TYPE_DEVICE_WIFI))
-#define NET_IS_DEVICE_WIFI_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), NET_TYPE_DEVICE_WIFI))
-#define NET_DEVICE_WIFI_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), NET_TYPE_DEVICE_WIFI,
NetDeviceWifiClass))
-
-typedef struct _NetDeviceWifiPrivate NetDeviceWifiPrivate;
-typedef struct _NetDeviceWifi NetDeviceWifi;
-typedef struct _NetDeviceWifiClass NetDeviceWifiClass;
-
-struct _NetDeviceWifi
-{
- NetDevice parent;
- NetDeviceWifiPrivate *priv;
-};
-
-struct _NetDeviceWifiClass
-{
- NetDeviceClass parent_class;
-};
-
-GType net_device_wifi_get_type (void) G_GNUC_CONST;
+G_DECLARE_FINAL_TYPE (NetDeviceWifi, net_device_wifi, NET, DEVICE_WIFI, NetDevice)
+
GtkWidget *net_device_wifi_get_header_widget (NetDeviceWifi *device_wifi);
GtkWidget *net_device_wifi_get_title_widget (NetDeviceWifi *device_wifi);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]