From a042cec8a9dd046f37d0efaeebd75cd5fe425e1b Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 8 Dec 2014 11:30:48 +0100 Subject: [PATCH] device/trivial: rename argument in nm_device_connection_is_available() The argument name should express what the caller wants (he wants to know, whether the connection can be activated for an internal or external activation request). Whether that involves checking device-specific overrides, is not the point -- nm_device_check_connection_compatible() is also a virtual function with device-specific overrides. (cherry picked from commit a7e0a038bf35e7d19ef859ff5035019c1bc0cad3) --- src/devices/nm-device.c | 10 ++++++---- src/devices/nm-device.h | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index c8d742a6ce..461be3f50e 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -6809,11 +6809,13 @@ nm_device_set_dhcp_anycast_address (NMDevice *self, const char *addr) * nm_device_connection_is_available(): * @self: the #NMDevice * @connection: the #NMConnection to check for availability - * @allow_device_override: set to %TRUE to let the device do specific checks + * @for_user_activation_request: set to %TRUE if we are checking whether + * the connection is available on an explicit user request. This + * also checks for device specific overrides. * * Check if @connection is available to be activated on @self. Normally this * only checks if the connection is in @self's AvailableConnections property. - * If @allow_device_override is %TRUE then the device is asked to do specific + * If @for_user_activation_request is %TRUE then the device is asked to do specific * checks that may bypass the AvailableConnections property. * * Returns: %TRUE if @connection can be activated on @self @@ -6821,7 +6823,7 @@ nm_device_set_dhcp_anycast_address (NMDevice *self, const char *addr) gboolean nm_device_connection_is_available (NMDevice *self, NMConnection *connection, - gboolean allow_device_override) + gboolean for_user_activation_request) { NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); gboolean available = FALSE; @@ -6836,7 +6838,7 @@ nm_device_connection_is_available (NMDevice *self, } available = !!g_hash_table_lookup (priv->available_connections, connection); - if (!available && allow_device_override) { + if (!available && for_user_activation_request) { /* FIXME: hack for hidden WiFi becuase clients didn't consistently * set the 'hidden' property to indicate hidden SSID networks. If * activating but the network isn't available let the device recheck diff --git a/src/devices/nm-device.h b/src/devices/nm-device.h index 519ccc48ff..3ba23d9400 100644 --- a/src/devices/nm-device.h +++ b/src/devices/nm-device.h @@ -363,7 +363,7 @@ GPtrArray *nm_device_get_available_connections (NMDevice *device, gboolean nm_device_connection_is_available (NMDevice *device, NMConnection *connection, - gboolean allow_device_override); + gboolean for_user_activation_request); gboolean nm_device_notify_component_added (NMDevice *device, GObject *component);