[gnome-control-center] network: Remove NetDevice class
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] network: Remove NetDevice class
- Date: Tue, 5 Nov 2019 23:07:29 +0000 (UTC)
commit 577762b60c3f501b96261242afeefb096e6465d5
Author: Robert Ancell <robert ancell canonical com>
Date: Thu Oct 24 13:10:01 2019 +1300
network: Remove NetDevice class
We don't need the NetObject/NetDevice class separation anymore
panels/network/cc-network-panel.c | 27 ++++++++++---------
panels/network/cc-wifi-panel.c | 1 -
panels/network/meson.build | 1 -
panels/network/net-device-bluetooth.c | 4 +--
panels/network/net-device-bluetooth.h | 4 +--
panels/network/net-device-ethernet.c | 4 +--
panels/network/net-device-ethernet.h | 4 +--
panels/network/net-device-mobile.c | 4 +--
panels/network/net-device-mobile.h | 4 +--
panels/network/net-device-wifi.c | 4 +--
panels/network/net-device-wifi.h | 4 +--
panels/network/net-device.c | 49 -----------------------------------
panels/network/net-device.h | 37 --------------------------
13 files changed, 29 insertions(+), 118 deletions(-)
---
diff --git a/panels/network/cc-network-panel.c b/panels/network/cc-network-panel.c
index aaafea5d8..4b27324e7 100644
--- a/panels/network/cc-network-panel.c
+++ b/panels/network/cc-network-panel.c
@@ -30,7 +30,6 @@
#include <NetworkManager.h>
-#include "net-device.h"
#include "net-device-bluetooth.h"
#include "net-device-ethernet.h"
#include "net-device-mobile.h"
@@ -251,7 +250,7 @@ panel_refresh_device_titles (CcNetworkPanel *self)
{
g_autoptr(GPtrArray) ndarray = NULL;
g_autoptr(GPtrArray) nmdarray = NULL;
- NetDevice **devices;
+ NetObject **devices;
NMDevice **nm_devices;
g_auto(GStrv) titles = NULL;
guint i, num_devices;
@@ -277,7 +276,7 @@ panel_refresh_device_titles (CcNetworkPanel *self)
if (ndarray->len == 0)
return;
- devices = (NetDevice **)ndarray->pdata;
+ devices = (NetObject **)ndarray->pdata;
nm_devices = (NMDevice **)nmdarray->pdata;
num_devices = ndarray->len;
@@ -290,9 +289,9 @@ panel_refresh_device_titles (CcNetworkPanel *self)
/* For bluetooth devices, use their device name. */
if (bt_name)
- net_object_set_title (NET_OBJECT (devices[i]), bt_name);
+ net_object_set_title (devices[i], bt_name);
else
- net_object_set_title (NET_OBJECT (devices[i]), titles[i]);
+ net_object_set_title (devices[i], titles[i]);
}
}
@@ -416,7 +415,7 @@ static void
panel_add_device (CcNetworkPanel *self, NMDevice *device)
{
NMDeviceType type;
- NetDevice *net_device;
+ NetObject *net_device;
g_autoptr(GDBusObject) modem_object = NULL;
if (!nm_device_get_managed (device))
@@ -436,8 +435,8 @@ panel_add_device (CcNetworkPanel *self, NMDevice *device)
switch (type) {
case NM_DEVICE_TYPE_ETHERNET:
case NM_DEVICE_TYPE_INFINIBAND:
- net_device = NET_DEVICE (net_device_ethernet_new (self->client, device));
- add_object (self, NET_OBJECT (net_device), GTK_CONTAINER (self->box_wired));
+ net_device = NET_OBJECT (net_device_ethernet_new (self->client, device));
+ add_object (self, net_device, GTK_CONTAINER (self->box_wired));
g_ptr_array_add (self->ethernet_devices, net_device);
break;
case NM_DEVICE_TYPE_MODEM:
@@ -457,13 +456,13 @@ panel_add_device (CcNetworkPanel *self, NMDevice *device)
}
}
- net_device = NET_DEVICE (net_device_mobile_new (self->client, device, modem_object));
- add_object (self, NET_OBJECT (net_device), GTK_CONTAINER (self->box_wired));
+ net_device = NET_OBJECT (net_device_mobile_new (self->client, device, modem_object));
+ add_object (self, net_device, GTK_CONTAINER (self->box_wired));
g_ptr_array_add (self->mobile_devices, net_device);
break;
case NM_DEVICE_TYPE_BT:
- net_device = NET_DEVICE (net_device_bluetooth_new (self->client, device));
- add_object (self, NET_OBJECT (net_device), GTK_CONTAINER (self->box_bluetooth));
+ net_device = NET_OBJECT (net_device_bluetooth_new (self->client, device));
+ add_object (self, net_device, GTK_CONTAINER (self->box_bluetooth));
g_ptr_array_add (self->bluetooth_devices, net_device);
break;
@@ -492,14 +491,14 @@ panel_add_device (CcNetworkPanel *self, NMDevice *device)
static void
panel_remove_device (CcNetworkPanel *self, NMDevice *device)
{
- NetDevice *net_device = NULL;
+ NetObject *net_device = NULL;
net_device = g_hash_table_lookup (self->nm_device_to_device, device);
if (net_device == NULL)
return;
/* NMObject will not fire the "removed" signal, so handle the UI removal explicitly */
- object_removed_cb (self, NET_OBJECT (net_device));
+ object_removed_cb (self, net_device);
g_ptr_array_remove (self->bluetooth_devices, net_device);
g_ptr_array_remove (self->ethernet_devices, net_device);
g_ptr_array_remove (self->mobile_devices, net_device);
diff --git a/panels/network/cc-wifi-panel.c b/panels/network/cc-wifi-panel.c
index 542ececc0..880bcc065 100644
--- a/panels/network/cc-wifi-panel.c
+++ b/panels/network/cc-wifi-panel.c
@@ -19,7 +19,6 @@
#include "cc-network-resources.h"
#include "cc-wifi-panel.h"
-#include "net-device.h"
#include "net-device-wifi.h"
#include "network-dialogs.h"
diff --git a/panels/network/meson.build b/panels/network/meson.build
index 553db62d5..742cdac3d 100644
--- a/panels/network/meson.build
+++ b/panels/network/meson.build
@@ -39,7 +39,6 @@ sources = files(
'cc-wifi-connection-list.c',
'cc-wifi-panel.c',
'cc-wifi-hotspot-dialog.c',
- 'net-device.c',
'net-device-bluetooth.c',
'net-device-ethernet.c',
'net-device-mobile.c',
diff --git a/panels/network/net-device-bluetooth.c b/panels/network/net-device-bluetooth.c
index 034f40bdd..c0a6ae067 100644
--- a/panels/network/net-device-bluetooth.c
+++ b/panels/network/net-device-bluetooth.c
@@ -33,7 +33,7 @@
struct _NetDeviceBluetooth
{
- NetDevice parent;
+ NetObject parent;
GtkBuilder *builder;
GtkBox *box;
@@ -47,7 +47,7 @@ struct _NetDeviceBluetooth
gboolean updating_device;
};
-G_DEFINE_TYPE (NetDeviceBluetooth, net_device_bluetooth, NET_TYPE_DEVICE)
+G_DEFINE_TYPE (NetDeviceBluetooth, net_device_bluetooth, NET_TYPE_OBJECT)
void
net_device_bluetooth_set_show_separator (NetDeviceBluetooth *self,
diff --git a/panels/network/net-device-bluetooth.h b/panels/network/net-device-bluetooth.h
index a6c5d5910..9b461389b 100644
--- a/panels/network/net-device-bluetooth.h
+++ b/panels/network/net-device-bluetooth.h
@@ -24,12 +24,12 @@
#include <glib-object.h>
-#include "net-device.h"
+#include "net-object.h"
G_BEGIN_DECLS
#define NET_TYPE_DEVICE_BLUETOOTH (net_device_bluetooth_get_type ())
-G_DECLARE_FINAL_TYPE (NetDeviceBluetooth, net_device_bluetooth, NET, DEVICE_BLUETOOTH, NetDevice)
+G_DECLARE_FINAL_TYPE (NetDeviceBluetooth, net_device_bluetooth, NET, DEVICE_BLUETOOTH, NetObject)
NetDeviceBluetooth *net_device_bluetooth_new (NMClient *client,
NMDevice *device);
diff --git a/panels/network/net-device-ethernet.c b/panels/network/net-device-ethernet.c
index 38a68af87..b83b26038 100644
--- a/panels/network/net-device-ethernet.c
+++ b/panels/network/net-device-ethernet.c
@@ -37,7 +37,7 @@
struct _NetDeviceEthernet
{
- NetDevice parent;
+ NetObject parent;
GtkBuilder *builder;
GtkButton *add_profile_button;
@@ -56,7 +56,7 @@ struct _NetDeviceEthernet
GHashTable *connections;
};
-G_DEFINE_TYPE (NetDeviceEthernet, net_device_ethernet, NET_TYPE_DEVICE)
+G_DEFINE_TYPE (NetDeviceEthernet, net_device_ethernet, NET_TYPE_OBJECT)
static GtkWidget *
device_ethernet_get_widget (NetObject *object,
diff --git a/panels/network/net-device-ethernet.h b/panels/network/net-device-ethernet.h
index 929756ed0..21e136739 100644
--- a/panels/network/net-device-ethernet.h
+++ b/panels/network/net-device-ethernet.h
@@ -23,12 +23,12 @@
#include <glib-object.h>
-#include "net-device.h"
+#include "net-object.h"
G_BEGIN_DECLS
#define NET_TYPE_DEVICE_ETHERNET (net_device_ethernet_get_type ())
-G_DECLARE_FINAL_TYPE (NetDeviceEthernet, net_device_ethernet, NET, DEVICE_ETHERNET, NetDevice)
+G_DECLARE_FINAL_TYPE (NetDeviceEthernet, net_device_ethernet, NET, DEVICE_ETHERNET, NetObject)
NetDeviceEthernet *net_device_ethernet_new (NMClient *client,
NMDevice *device);
diff --git a/panels/network/net-device-mobile.c b/panels/network/net-device-mobile.c
index 8e412bb46..caa4e349f 100644
--- a/panels/network/net-device-mobile.c
+++ b/panels/network/net-device-mobile.c
@@ -37,7 +37,7 @@ static void nm_device_mobile_refresh_ui (NetDeviceMobile *self);
struct _NetDeviceMobile
{
- NetDevice parent;
+ NetObject parent;
GtkBuilder *builder;
GtkBox *box;
@@ -85,7 +85,7 @@ enum {
COLUMN_LAST
};
-G_DEFINE_TYPE (NetDeviceMobile, net_device_mobile, NET_TYPE_DEVICE)
+G_DEFINE_TYPE (NetDeviceMobile, net_device_mobile, NET_TYPE_OBJECT)
static GtkWidget *
device_mobile_get_widget (NetObject *object,
diff --git a/panels/network/net-device-mobile.h b/panels/network/net-device-mobile.h
index 7873a4c67..6ac3220ef 100644
--- a/panels/network/net-device-mobile.h
+++ b/panels/network/net-device-mobile.h
@@ -24,12 +24,12 @@
#include <glib-object.h>
#include <NetworkManager.h>
-#include "net-device.h"
+#include "net-object.h"
G_BEGIN_DECLS
#define NET_TYPE_DEVICE_MOBILE (net_device_mobile_get_type ())
-G_DECLARE_FINAL_TYPE (NetDeviceMobile, net_device_mobile, NET, DEVICE_MOBILE, NetDevice)
+G_DECLARE_FINAL_TYPE (NetDeviceMobile, net_device_mobile, NET, DEVICE_MOBILE, NetObject)
NetDeviceMobile *net_device_mobile_new (NMClient *client,
NMDevice *device,
diff --git a/panels/network/net-device-wifi.c b/panels/network/net-device-wifi.c
index ab9f6e95a..075935081 100644
--- a/panels/network/net-device-wifi.c
+++ b/panels/network/net-device-wifi.c
@@ -56,7 +56,7 @@ static void show_details_for_row (NetDeviceWifi *self, CcWifiConnectionRow *row,
struct _NetDeviceWifi
{
- NetDevice parent;
+ NetObject parent;
GtkBuilder *builder;
GtkBox *center_box;
@@ -100,7 +100,7 @@ enum {
PROP_LAST,
};
-G_DEFINE_TYPE (NetDeviceWifi, net_device_wifi, NET_TYPE_DEVICE)
+G_DEFINE_TYPE (NetDeviceWifi, net_device_wifi, NET_TYPE_OBJECT)
static GtkWidget *
device_wifi_proxy_get_widget (NetObject *object,
diff --git a/panels/network/net-device-wifi.h b/panels/network/net-device-wifi.h
index e74817dcf..063245c4c 100644
--- a/panels/network/net-device-wifi.h
+++ b/panels/network/net-device-wifi.h
@@ -23,12 +23,12 @@
#include <glib-object.h>
-#include "net-device.h"
+#include "net-object.h"
G_BEGIN_DECLS
#define NET_TYPE_DEVICE_WIFI (net_device_wifi_get_type ())
-G_DECLARE_FINAL_TYPE (NetDeviceWifi, net_device_wifi, NET, DEVICE_WIFI, NetDevice)
+G_DECLARE_FINAL_TYPE (NetDeviceWifi, net_device_wifi, NET, DEVICE_WIFI, NetObject)
NetDeviceWifi *net_device_wifi_new (CcPanel *panel,
NMClient *client,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]