Only save per-core configs when core specific option is enabled.

Also, need to enforce that g_settings.core_specific_config is true
after loading core specific config. It's possible that core specific
option is set to false before loading a different core (using global
config only).
This commit is contained in:
Themaister 2014-01-02 18:01:01 +01:00
parent 13a006d147
commit be81549d92
2 changed files with 7 additions and 3 deletions

View File

@ -290,7 +290,7 @@ void main_exit(args_type() args)
config_save_file(g_extern.config_path);
// Flush out the core specific config.
if (*g_extern.core_specific_config_path)
if (*g_extern.core_specific_config_path && g_settings.core_specific_config)
config_save_file(g_extern.core_specific_config_path);
}
#endif

View File

@ -467,15 +467,19 @@ static void config_load_core_specific(void)
if (!config_load_file(g_extern.core_specific_config_path, true))
RARCH_WARN("Core-specific config not found, reusing last config.\n");
// don't have the core config file overwrite the libretro path
// Force some parameters which are implied when using core specific configs.
// Don't have the core config file overwrite the libretro path.
strlcpy(g_settings.libretro, tmp, sizeof(g_settings.libretro));
// This must be true for core specific configs.
g_settings.core_specific_config = true;
}
}
void config_load(void)
{
// Flush out per-core configs before loading a new config.
if (*g_extern.core_specific_config_path && g_extern.config_save_on_exit)
if (*g_extern.core_specific_config_path && g_extern.config_save_on_exit && g_settings.core_specific_config)
config_save_file(g_extern.core_specific_config_path);
if (!g_extern.block_config_read)