mirror of
https://github.com/vicliu624/trail-mate.git
synced 2026-10-23 21:43:28 +00:00
Migrate legacy Wi-Fi profile password keys
This commit is contained in:
1 parent
dc33a5de93
commit
ff4a710eec
2 files changed
+12
No files matched your search
@@ -405,6 +405,12 @@ bool read_profile_from_store(std::size_t index, Config& profile)
|
||||
if (::platform::ui::settings_store::get_string(kSettingsNs, legacy_password_key, value))
|
||||
{
|
||||
copy_bounded(profile.password, sizeof(profile.password), value.c_str());
|
||||
(void)::platform::ui::settings_store::put_string(
|
||||
kSettingsNs,
|
||||
password_key,
|
||||
profile.password);
|
||||
const char* legacy_keys[] = {legacy_password_key};
|
||||
::platform::ui::settings_store::remove_keys(kSettingsNs, legacy_keys, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -244,6 +244,12 @@ bool read_profile_from_store(std::size_t index, Config& profile)
|
||||
if (::platform::ui::settings_store::get_string(kSettingsNs, legacy_password_key, value))
|
||||
{
|
||||
copy_text(profile.password, sizeof(profile.password), value.c_str());
|
||||
(void)::platform::ui::settings_store::put_string(
|
||||
kSettingsNs,
|
||||
password_key,
|
||||
profile.password);
|
||||
const char* legacy_keys[] = {legacy_password_key};
|
||||
::platform::ui::settings_store::remove_keys(kSettingsNs, legacy_keys, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user