[gnome-control-center/wip/hadess/fix-nm-1.22-build: 1/2] network: Fix build with libnm 1.22
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/wip/hadess/fix-nm-1.22-build: 1/2] network: Fix build with libnm 1.22
- Date: Wed, 16 Sep 2020 12:34:21 +0000 (UTC)
commit 69cdce8b49257f90e6473762c8b314bf42a0e3fb
Author: Bastien Nocera <hadess hadess net>
Date: Wed Sep 16 14:28:44 2020 +0200
network: Fix build with libnm 1.22
/usr/bin/ld: panels/network/libnetwork.a(net-device-wifi.c.o): in function
`nm_client_on_permission_change':
gnome-control-center/panels/network/net-device-wifi.c:1183: undefined reference to
`nm_client_get_permissions_state'
collect2: error: ld returned 1 exit status
Closes: #1120
panels/network/net-device-wifi.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/panels/network/net-device-wifi.c b/panels/network/net-device-wifi.c
index cb86e5b0a..2d3677805 100644
--- a/panels/network/net-device-wifi.c
+++ b/panels/network/net-device-wifi.c
@@ -1179,8 +1179,12 @@ void
nm_client_on_permission_change (NetDeviceWifi *self) {
NMClientPermissionResult perm;
NMDeviceWifiCapabilities caps;
+ NMTernary permissions_state = NM_TERNARY_TRUE;
- if (nm_client_get_permissions_state (self->client) != NM_TERNARY_TRUE) {
+ if (g_object_class_find_property (G_OBJECT_GET_CLASS (self->client), "permissions-state") != NULL)
+ g_object_get (G_OBJECT (self->client), "permissions-state", &permissions_state, NULL);
+
+ if (permissions_state != NM_TERNARY_TRUE) {
/* permissions aren't ready yet */
return;
}
@@ -1227,8 +1231,9 @@ net_device_wifi_new (CcPanel *panel, NMClient *client, NMDevice *device)
G_CALLBACK (ap_activated), self, G_CONNECT_SWAPPED);
g_signal_connect_object (list, "configure",
G_CALLBACK (show_details_for_row), self, G_CONNECT_SWAPPED);
- g_signal_connect_object (client, "notify",
- G_CALLBACK(nm_client_on_permission_change), self, G_CONNECT_SWAPPED);
+ if (g_object_class_find_property (G_OBJECT_GET_CLASS (client), "permissions-state") != NULL)
+ g_signal_connect_object (client, "notify::permissions-state",
+ G_CALLBACK(nm_client_on_permission_change), self,
G_CONNECT_SWAPPED);
nm_client_on_permission_change(self);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]