use global config as default for game config again (#2845)

this was missing as a result to the previous fix of the game configs
This commit is contained in:
Megamouse 2017-06-07 21:12:19 +02:00 committed by Ani
parent affda37d04
commit 0f433ea882

View File

@ -105,14 +105,22 @@ static QStringList getOptions(cfg_location location)
emu_settings::emu_settings(const std::string& path) : QObject()
{
currentSettings = YAML::Load(g_cfg_defaults);
// Create config path if necessary
fs::create_path(fs::get_config_dir() + path);
// Incrementally load config.yml
config = fs::file(fs::get_config_dir() + path + "/config.yml", fs::read + fs::write + fs::create);
// Load default config
currentSettings = YAML::Load(g_cfg_defaults);
// Add global config
config = fs::file(fs::get_config_dir() + "/config.yml", fs::read + fs::write + fs::create);
currentSettings += YAML::Load(config.to_string());
// Add game config
if (!path.empty())
{
config = fs::file(fs::get_config_dir() + path + "/config.yml", fs::read + fs::write + fs::create);
currentSettings += YAML::Load(config.to_string());
}
}
emu_settings::~emu_settings()