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.
This commit is contained in:
Thomas Haller
2014-12-08 11:30:48 +01:00
parent b9da094da9
commit a7e0a038bf
2 changed files with 7 additions and 5 deletions

View File

@@ -6891,11 +6891,13 @@ nm_device_set_dhcp_anycast_address (NMDevice *self, const char *addr)
* nm_device_connection_is_available(): * nm_device_connection_is_available():
* @self: the #NMDevice * @self: the #NMDevice
* @connection: the #NMConnection to check for availability * @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 * Check if @connection is available to be activated on @self. Normally this
* only checks if the connection is in @self's AvailableConnections property. * 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. * checks that may bypass the AvailableConnections property.
* *
* Returns: %TRUE if @connection can be activated on @self * 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 gboolean
nm_device_connection_is_available (NMDevice *self, nm_device_connection_is_available (NMDevice *self,
NMConnection *connection, NMConnection *connection,
gboolean allow_device_override) gboolean for_user_activation_request)
{ {
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
gboolean available = FALSE; gboolean available = FALSE;
@@ -6918,7 +6920,7 @@ nm_device_connection_is_available (NMDevice *self,
} }
available = !!g_hash_table_lookup (priv->available_connections, connection); 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 /* FIXME: hack for hidden WiFi becuase clients didn't consistently
* set the 'hidden' property to indicate hidden SSID networks. If * set the 'hidden' property to indicate hidden SSID networks. If
* activating but the network isn't available let the device recheck * activating but the network isn't available let the device recheck

View File

@@ -374,7 +374,7 @@ GPtrArray *nm_device_get_available_connections (NMDevice *device,
gboolean nm_device_connection_is_available (NMDevice *device, gboolean nm_device_connection_is_available (NMDevice *device,
NMConnection *connection, NMConnection *connection,
gboolean allow_device_override); gboolean for_user_activation_request);
gboolean nm_device_notify_component_added (NMDevice *device, GObject *component); gboolean nm_device_notify_component_added (NMDevice *device, GObject *component);