Qt: Add migration of old controller binds to new

This commit is contained in:
Connor McLaughlin
2022-11-18 17:14:39 +10:00
parent 4b1e54d74f
commit ae4366498e
3 changed files with 170 additions and 0 deletions

View File

@ -166,6 +166,7 @@ bool QtHost::InitializeConfig(std::string settings_filename)
}
s_base_settings_interface->SetUIntValue("Main", "SettingsVersion", SETTINGS_VERSION);
s_base_settings_interface->SetBoolValue("ControllerPorts", "ControllerSettingsMigrated", true);
SetDefaultSettings(*s_base_settings_interface, true, true);
s_base_settings_interface->Save();
}
@ -180,6 +181,14 @@ bool QtHost::InitializeConfig(std::string settings_filename)
Log::SetConsoleOutputParams(true, nullptr, LOGLEVEL_NONE);
}
// TEMPORARY: Migrate controller settings to new interface.
if (!s_base_settings_interface->GetBoolValue("ControllerPorts", "ControllerSettingsMigrated", false))
{
s_base_settings_interface->SetBoolValue("ControllerPorts", "ControllerSettingsMigrated", true);
if (InputManager::MigrateBindings(*s_base_settings_interface.get()))
s_base_settings_interface->Save();
}
InstallTranslator();
return true;
}