From a7e0a038bf35e7d19ef859ff5035019c1bc0cad3 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. --- 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 ae644cf47d..9034df9fcd 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -6891,11 +6891,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 @@ -6903,7 +6905,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; @@ -6918,7 +6920,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 6b68f14948..e3d58c5bf0 100644 --- a/src/devices/nm-device.h +++ b/src/devices/nm-device.h @@ -374,7 +374,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);