Move config_save_on_exit to g_settings

This commit is contained in:
twinaphex 2014-08-12 03:36:26 +02:00
parent 30db4df19e
commit 2cb8d06c7a
6 changed files with 12 additions and 11 deletions

View File

@ -209,7 +209,7 @@ void main_exit(args_type() args)
{
g_extern.system.shutdown = false;
if (g_extern.config_save_on_exit && *g_extern.config_path)
if (g_settings.config_save_on_exit && *g_extern.config_path)
{
// save last core-specific config to the default config location, needed on
// consoles for core switching and reusing last good config for new cores.

View File

@ -4400,7 +4400,7 @@ static void menu_common_setting_set_label(char *type_str, size_t type_str_size,
strlcpy(type_str, g_extern.perfcnt_enable ? "ON" : "OFF", type_str_size);
break;
case MENU_SETTINGS_CONFIG_SAVE_ON_EXIT:
strlcpy(type_str, g_extern.config_save_on_exit ? "ON" : "OFF", type_str_size);
strlcpy(type_str, g_settings.config_save_on_exit ? "ON" : "OFF", type_str_size);
break;
case MENU_SETTINGS_SAVESTATE_AUTO_SAVE:
strlcpy(type_str, g_settings.savestate_auto_save ? "ON" : "OFF", type_str_size);

View File

@ -503,7 +503,7 @@ bool menu_replace_config(const char *path)
if (strcmp(path, g_extern.config_path) == 0)
return false;
if (g_extern.config_save_on_exit && *g_extern.config_path)
if (g_settings.config_save_on_exit && *g_extern.config_path)
config_save_file(g_extern.config_path);
strlcpy(g_extern.config_path, path, sizeof(g_extern.config_path));

View File

@ -374,6 +374,8 @@ struct settings
char username[32];
unsigned int user_language;
bool config_save_on_exit;
};
typedef struct rarch_resolution
@ -722,7 +724,6 @@ struct global
bool main_is_init;
bool error_in_init;
bool config_save_on_exit;
char error_string[1024];
jmp_buf error_sjlj_context;

View File

@ -516,7 +516,7 @@ void config_set_defaults(void)
if (*g_defaults.config_path)
fill_pathname_expand_special(g_extern.config_path, g_defaults.config_path, sizeof(g_extern.config_path));
g_extern.config_save_on_exit = config_save_on_exit;
g_settings.config_save_on_exit = config_save_on_exit;
/* Avoid reloading config on every content load */
g_extern.block_config_read = default_block_config_read;
@ -571,7 +571,7 @@ static void config_load_core_specific(void)
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 && g_settings.core_specific_config)
if (*g_extern.core_specific_config_path && g_settings.config_save_on_exit && g_settings.core_specific_config)
config_save_file(g_extern.core_specific_config_path);
if (!g_extern.block_config_read)
@ -1115,7 +1115,7 @@ bool config_load_file(const char *path, bool set_defaults)
CONFIG_GET_INT_EXTERN(netplay_port, "netplay_ip_port");
#endif
CONFIG_GET_BOOL_EXTERN(config_save_on_exit, "config_save_on_exit");
CONFIG_GET_BOOL(config_save_on_exit, "config_save_on_exit");
if (!g_extern.has_set_save_path && config_get_path(conf, "savefile_directory", tmp_str, sizeof(tmp_str)))
{
@ -1473,7 +1473,7 @@ bool config_save_file(const char *path)
config_set_float(conf, "slowmotion_ratio", g_settings.slowmotion_ratio);
// g_extern
config_set_bool(conf, "config_save_on_exit", g_extern.config_save_on_exit);
config_set_bool(conf, "config_save_on_exit", g_settings.config_save_on_exit);
config_set_int(conf, "sound_mode", g_extern.console.sound.mode);
config_set_int(conf, "state_slot", g_settings.state_slot);

View File

@ -788,7 +788,7 @@ static void general_read_handler(const void *data)
else if (!strcmp(setting->name, "pause_nonactive"))
*setting->value.boolean = g_settings.pause_nonactive;
else if (!strcmp(setting->name, "config_save_on_exit"))
*setting->value.boolean = g_extern.config_save_on_exit;
*setting->value.boolean = g_settings.config_save_on_exit;
else if (!strcmp(setting->name, "rewind_enable"))
*setting->value.boolean = g_settings.rewind_enable;
else if (!strcmp(setting->name, "rewind_granularity"))
@ -1054,7 +1054,7 @@ static void general_write_handler(const void *data)
else if (!strcmp(setting->name, "pause_nonactive"))
g_settings.pause_nonactive = *setting->value.boolean;
else if (!strcmp(setting->name, "config_save_on_exit"))
g_extern.config_save_on_exit = *setting->value.boolean;
g_settings.config_save_on_exit = *setting->value.boolean;
else if (!strcmp(setting->name, "rewind_enable"))
{
g_settings.rewind_enable = *setting->value.boolean;
@ -1505,7 +1505,7 @@ rarch_setting_t* setting_data_get_list(void)
CONFIG_BOOL(g_extern.verbosity, "log_verbosity", "Logging Verbosity", false, GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler)
CONFIG_UINT(g_settings.libretro_log_level, "libretro_log_level", "Libretro Logging Level", libretro_log_level, GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler) WITH_RANGE(0, 3, 1.0, true, true)
CONFIG_BOOL(g_extern.perfcnt_enable, "perfcnt_enable", "Performance Counters", false, GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler)
CONFIG_BOOL(g_extern.config_save_on_exit, "config_save_on_exit", "Configuration Save On Exit", config_save_on_exit, GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler)
CONFIG_BOOL(g_settings.config_save_on_exit, "config_save_on_exit", "Configuration Save On Exit", config_save_on_exit, GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler)
CONFIG_BOOL(g_settings.core_specific_config, "core_specific_config", "Configuration Per-Core", default_core_specific_config, GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler)
CONFIG_BOOL(g_settings.load_dummy_on_core_shutdown, "dummy_on_core_shutdown", "Dummy On Core Shutdown", load_dummy_on_core_shutdown, GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler)
CONFIG_BOOL(g_settings.fps_show, "fps_show", "Show Framerate", fps_show, GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler)