Merge pull request #5853 from leoetlino/onionconfig-fix

Config: Fix the loader Load() being called twice
This commit is contained in:
Leo Lam 2017-07-31 22:43:32 +08:00 committed by GitHub
commit 131c97e87c
4 changed files with 4 additions and 17 deletions

View File

@ -38,17 +38,6 @@ void AddLayer(std::unique_ptr<ConfigLayerLoader> loader)
AddLayer(std::make_unique<Layer>(std::move(loader)));
}
void AddLoadLayer(std::unique_ptr<Layer> layer)
{
layer->Load();
AddLayer(std::move(layer));
}
void AddLoadLayer(std::unique_ptr<ConfigLayerLoader> loader)
{
AddLoadLayer(std::make_unique<Layer>(std::move(loader)));
}
Layer* GetLayer(LayerType layer)
{
if (!LayerExists(layer))

View File

@ -43,8 +43,6 @@ Section* GetOrCreateSection(System system, const std::string& section_name);
Layers* GetLayers();
void AddLayer(std::unique_ptr<Layer> layer);
void AddLayer(std::unique_ptr<ConfigLayerLoader> loader);
void AddLoadLayer(std::unique_ptr<Layer> layer);
void AddLoadLayer(std::unique_ptr<ConfigLayerLoader> loader);
Layer* GetLayer(LayerType layer);
void RemoveLayer(LayerType layer);
bool LayerExists(LayerType layer);

View File

@ -244,8 +244,8 @@ bool BootCore(std::unique_ptr<BootParameters> boot)
std::string game_id = SConfig::GetInstance().GetGameID();
u16 revision = SConfig::GetInstance().GetRevision();
Config::AddLoadLayer(ConfigLoaders::GenerateGlobalGameConfigLoader(game_id, revision));
Config::AddLoadLayer(ConfigLoaders::GenerateLocalGameConfigLoader(game_id, revision));
Config::AddLayer(ConfigLoaders::GenerateGlobalGameConfigLoader(game_id, revision));
Config::AddLayer(ConfigLoaders::GenerateLocalGameConfigLoader(game_id, revision));
IniFile game_ini = StartUp.LoadGameIni();
@ -357,7 +357,7 @@ bool BootCore(std::unique_ptr<BootParameters> boot)
if (NetPlay::IsNetPlayRunning())
{
Config::AddLoadLayer(ConfigLoaders::GenerateNetPlayConfigLoader(g_NetPlaySettings));
Config::AddLayer(ConfigLoaders::GenerateNetPlayConfigLoader(g_NetPlaySettings));
StartUp.bCPUThread = g_NetPlaySettings.m_CPUthread;
StartUp.bEnableCheats = g_NetPlaySettings.m_EnableCheats;
StartUp.bDSPHLE = g_NetPlaySettings.m_DSPHLE;

View File

@ -33,7 +33,7 @@ namespace UICommon
void Init()
{
Config::Init();
Config::AddLoadLayer(ConfigLoaders::GenerateBaseConfigLoader());
Config::AddLayer(ConfigLoaders::GenerateBaseConfigLoader());
SConfig::Init();
LogManager::Init();
VideoBackendBase::PopulateList();