3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-23 06:02:37 +01:00

knownnetworks: Use AutoConnect setting

Since the property Autoconnect was renamed to AutoConnect, change the
Autoconnect setting to match.

For now we still allow the legacy name to be used here, but a warning is
printed to remind users to update.
This commit is contained in:
Denis Kenzior 2019-10-24 13:01:58 -05:00
parent 8dbbbaf631
commit 2dec3ff1b6

View File

@ -368,11 +368,18 @@ void known_network_update(struct network_info *network,
network->is_hidden = is_hidden; network->is_hidden = is_hidden;
if (!l_settings_get_bool(settings, "Settings", "Autoconnect", if (!l_settings_get_bool(settings, "Settings", "AutoConnect",
&is_autoconnectable)) &is_autoconnectable)) {
/* If no entry, default to Autoconnectable=True */ /* If no entry, default to AutoConnectable=True */
is_autoconnectable = true; is_autoconnectable = true;
/* Try legacy property name just in case */
if (l_settings_get_bool(settings, "Settings", "Autoconnect",
&is_autoconnectable))
l_warn("Autoconnect setting is deprecated, use"
" AutoConnect instead");
}
known_network_set_autoconnect(network, is_autoconnectable); known_network_set_autoconnect(network, is_autoconnectable);
} }
@ -576,7 +583,7 @@ static struct l_dbus_message *known_network_property_set_autoconnect(
if (!settings) if (!settings)
return dbus_error_failed(message); return dbus_error_failed(message);
l_settings_set_bool(settings, "Settings", "Autoconnect", autoconnect); l_settings_set_bool(settings, "Settings", "AutoConnect", autoconnect);
network->ops->sync(network, settings); network->ops->sync(network, settings);
l_settings_free(settings); l_settings_free(settings);
@ -679,10 +686,17 @@ static void known_network_new(const char *ssid, enum security security,
&is_hidden)) &is_hidden))
is_hidden = false; is_hidden = false;
if (!l_settings_get_bool(settings, "Settings", "Autoconnect", if (!l_settings_get_bool(settings, "Settings", "AutoConnect",
&is_autoconnectable)) &is_autoconnectable)) {
is_autoconnectable = true; is_autoconnectable = true;
/* Try legacy property name just in case */
if (l_settings_get_bool(settings, "Settings", "Autoconnect",
&is_autoconnectable))
l_warn("Autoconnect setting is deprecated, use"
" AutoConnect instead");
}
if (is_hidden) if (is_hidden)
num_known_hidden_networks++; num_known_hidden_networks++;