core: rename nm_device_emit_recheck_auto_activate() to nm_device_recheck_auto_activate_schedule()

It's the better name. Especially since there is no more signal involved,
the term "emit" doesn't match.

Note also how the previous approach using a signal tried to abstract
what is happening. So we were no longer rechecking-autoconnect, instead,
we were emitting-a-signal-to-recheck-autoconnect. Just be plain about
what it is doing and don't go through a layer of signal.
This commit is contained in:
Thomas Haller 2023-04-05 11:14:39 +02:00
parent 3c59c6b393
commit 751b927cf2
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728
7 changed files with 18 additions and 18 deletions

View file

@ -6605,7 +6605,7 @@ carrier_changed(NMDevice *self, gboolean carrier)
* when the carrier appears, auto connections are rechecked for
* the device.
*/
nm_device_emit_recheck_auto_activate(self);
nm_device_recheck_auto_activate_schedule(self);
}
} else {
if (priv->state == NM_DEVICE_STATE_UNAVAILABLE) {
@ -6929,7 +6929,7 @@ device_link_changed(gpointer user_data)
/* Let any connections that use the new interface name have a chance
* to auto-activate on the device.
*/
nm_device_emit_recheck_auto_activate(self);
nm_device_recheck_auto_activate_schedule(self);
}
if (priv->ipac6_data.ndisc && pllink->inet6_token.id) {
@ -7861,7 +7861,7 @@ nm_device_unrealize(NMDevice *self, gboolean remove_resources, GError **error)
/* In case the unrealized device is not going away, it may need to
* autoactivate. Schedule also a check for that. */
nm_device_emit_recheck_auto_activate(self);
nm_device_recheck_auto_activate_schedule(self);
return TRUE;
}
@ -7883,7 +7883,7 @@ nm_device_notify_availability_maybe_changed(NMDevice *self)
* available. */
nm_device_recheck_available_connections(self);
if (g_hash_table_size(priv->available_connections) > 0)
nm_device_emit_recheck_auto_activate(self);
nm_device_recheck_auto_activate_schedule(self);
}
/**
@ -9248,7 +9248,7 @@ nm_device_queue_recheck_available(NMDevice *self,
}
void
nm_device_emit_recheck_auto_activate(NMDevice *self)
nm_device_recheck_auto_activate_schedule(NMDevice *self)
{
nm_manager_device_recheck_auto_activate_schedule(nm_device_get_manager(self), self);
}
@ -12790,7 +12790,7 @@ delete_on_deactivate_link_delete(gpointer user_data)
if (nm_dbus_object_is_exported(NM_DBUS_OBJECT(self))) {
/* The device is still alive. We may need to autoactivate virtual
* devices again. */
nm_device_emit_recheck_auto_activate(self);
nm_device_recheck_auto_activate_schedule(self);
}
g_free(data);

View file

@ -294,7 +294,7 @@ typedef struct _NMDeviceClass {
GPtrArray *(*get_extra_rules)(NMDevice *self);
/* allow derived classes to override the result of nm_device_autoconnect_allowed().
* If the value changes, the class should call nm_device_emit_recheck_auto_activate(),
* If the value changes, the class should call nm_device_recheck_auto_activate_schedule(),
* which emits NM_DEVICE_RECHECK_AUTO_ACTIVATE signal. */
gboolean (*get_autoconnect_allowed)(NMDevice *self);
@ -716,7 +716,7 @@ nm_device_autoconnect_blocked_unset(NMDevice *device, NMDeviceAutoconnectBlocked
nm_device_autoconnect_blocked_set_full(device, mask, NM_DEVICE_AUTOCONNECT_BLOCKED_NONE);
}
void nm_device_emit_recheck_auto_activate(NMDevice *device);
void nm_device_recheck_auto_activate_schedule(NMDevice *device);
NMDeviceSysIfaceState nm_device_sys_iface_state_get(NMDevice *device);

View file

@ -486,7 +486,7 @@ ovsdb_ready(NMOvsdb *ovsdb, NMDeviceOvsInterface *self)
NM_DEVICE_STATE_REASON_NONE,
NM_DEVICE_STATE_REASON_NONE);
nm_device_recheck_available_connections(device);
nm_device_emit_recheck_auto_activate(device);
nm_device_recheck_auto_activate_schedule(device);
}
static void

View file

@ -159,7 +159,7 @@ ap_add_remove(NMDeviceIwd *self,
}
if (priv->enabled && !priv->iwd_autoconnect)
nm_device_emit_recheck_auto_activate(NM_DEVICE(self));
nm_device_recheck_auto_activate_schedule(NM_DEVICE(self));
if (recheck_available_connections)
nm_device_recheck_available_connections(NM_DEVICE(self));
@ -208,7 +208,7 @@ remove_all_aps(NMDeviceIwd *self)
ap_add_remove(self, FALSE, ap, FALSE);
if (!priv->iwd_autoconnect)
nm_device_emit_recheck_auto_activate(NM_DEVICE(self));
nm_device_recheck_auto_activate_schedule(NM_DEVICE(self));
nm_device_recheck_available_connections(NM_DEVICE(self));
}
@ -401,7 +401,7 @@ get_ordered_networks_cb(GObject *source, GAsyncResult *res, gpointer user_data)
if (changed) {
if (!priv->iwd_autoconnect)
nm_device_emit_recheck_auto_activate(NM_DEVICE(self));
nm_device_recheck_auto_activate_schedule(NM_DEVICE(self));
nm_device_recheck_available_connections(NM_DEVICE(self));
}
@ -1685,7 +1685,7 @@ failed:
if (!priv->nm_autoconnect) {
priv->nm_autoconnect = true;
nm_device_emit_recheck_auto_activate(device);
nm_device_recheck_auto_activate_schedule(device);
}
}
g_variant_unref(value);
@ -2912,7 +2912,7 @@ state_changed(NMDeviceIwd *self, const char *new_state)
if (!priv->iwd_autoconnect && NM_IN_STRSET(new_state, "disconnected")) {
priv->nm_autoconnect = TRUE;
if (!can_connect)
nm_device_emit_recheck_auto_activate(device);
nm_device_recheck_auto_activate_schedule(device);
}
}

View file

@ -270,7 +270,7 @@ companion_state_changed_cb(NMDeviceWifi *companion,
NMDeviceState self_state = nm_device_get_state(NM_DEVICE(self));
if (old_state > NM_DEVICE_STATE_DISCONNECTED && state <= NM_DEVICE_STATE_DISCONNECTED) {
nm_device_emit_recheck_auto_activate(NM_DEVICE(self));
nm_device_recheck_auto_activate_schedule(NM_DEVICE(self));
}
if (self_state < NM_DEVICE_STATE_PREPARE || self_state > NM_DEVICE_STATE_ACTIVATED

View file

@ -483,7 +483,7 @@ _scan_notify_is_scanning(NMDeviceWifi *self)
if (!_scan_is_scanning_eval(priv)) {
if (state <= NM_DEVICE_STATE_DISCONNECTED || state > NM_DEVICE_STATE_ACTIVATED)
nm_device_emit_recheck_auto_activate(NM_DEVICE(self));
nm_device_recheck_auto_activate_schedule(NM_DEVICE(self));
nm_device_remove_pending_action(NM_DEVICE(self), NM_PENDING_ACTION_WIFI_SCAN, FALSE);
}
@ -843,7 +843,7 @@ ap_add_remove(NMDeviceWifi *self,
nm_dbus_object_clear_and_unexport(&ap);
}
nm_device_emit_recheck_auto_activate(NM_DEVICE(self));
nm_device_recheck_auto_activate_schedule(NM_DEVICE(self));
if (recheck_available_connections)
nm_device_recheck_available_connections(NM_DEVICE(self));
}

View file

@ -3900,7 +3900,7 @@ _device_realize_finish(NMManager *self, NMDevice *device, const NMPlatformLink *
nm_device_state_changed(device,
NM_DEVICE_STATE_UNAVAILABLE,
NM_DEVICE_STATE_REASON_NOW_MANAGED);
nm_device_emit_recheck_auto_activate(device);
nm_device_recheck_auto_activate_schedule(device);
}
/**