Start wrapping more settings code

This commit is contained in:
twinaphex 2015-10-11 13:10:46 +02:00
parent 8223c3d2d3
commit 83dd151579
7 changed files with 19 additions and 5 deletions

View File

@ -738,7 +738,8 @@ int menu_cbs_init_bind_deferred_push(menu_file_list_cbs_t *cbs,
if (cbs->setting)
{
uint32_t parent_group_hash = menu_hash_calculate(cbs->setting->parent_group);
const char *parent_group = menu_setting_get_parent_group(cbs->setting);
uint32_t parent_group_hash = menu_hash_calculate(parent_group);
if ((parent_group_hash == MENU_VALUE_MAIN_MENU) && menu_setting_get_type(cbs->setting) == ST_GROUP)
{

View File

@ -331,7 +331,8 @@ static int menu_cbs_init_bind_left_compare_label(menu_file_list_cbs_t *cbs,
if (cbs->setting)
{
uint32_t parent_group_hash = menu_hash_calculate(cbs->setting->parent_group);
const char *parent_group = menu_setting_get_parent_group(cbs->setting);
uint32_t parent_group_hash = menu_hash_calculate(parent_group);
if ((parent_group_hash == MENU_VALUE_MAIN_MENU) && (menu_setting_get_type(cbs->setting) == ST_GROUP))
{

View File

@ -438,7 +438,8 @@ static int menu_cbs_init_bind_right_compare_label(menu_file_list_cbs_t *cbs,
if (cbs->setting)
{
uint32_t parent_group_hash = menu_hash_calculate(cbs->setting->parent_group);
const char *parent_group = menu_setting_get_parent_group(cbs->setting);
uint32_t parent_group_hash = menu_hash_calculate(parent_group);
if ((parent_group_hash == MENU_LABEL_SETTINGS) && (menu_setting_get_type(cbs->setting) == ST_GROUP))
{

View File

@ -459,7 +459,8 @@ static int menu_cbs_init_bind_title_compare_label(menu_file_list_cbs_t *cbs,
{
if (cbs->setting)
{
uint32_t parent_group_hash = menu_hash_calculate(cbs->setting->parent_group);
const char *parent_group = menu_setting_get_parent_group(cbs->setting);
uint32_t parent_group_hash = menu_hash_calculate(parent_group);
if ((parent_group_hash == MENU_VALUE_MAIN_MENU) && menu_setting_get_type(cbs->setting) == ST_GROUP)
{

View File

@ -256,7 +256,7 @@ int generic_menu_iterate(enum menu_action action)
if (setting)
{
char needle[PATH_MAX_LENGTH];
strlcpy(needle, setting->name, sizeof(needle));
strlcpy(needle, menu_setting_get_name(setting), sizeof(needle));
label_hash = menu_hash_calculate(needle);
}

View File

@ -267,6 +267,13 @@ const char *menu_setting_get_name(rarch_setting_t *setting)
return setting->name;
}
const char *menu_setting_get_parent_group(rarch_setting_t *setting)
{
if (!setting)
return NULL;
return setting->parent_group;
}
const char *menu_setting_get_short_description(rarch_setting_t *setting)
{
if (!setting)
@ -6365,6 +6372,7 @@ static bool setting_append_list_input_player_options(
return true;
}
void menu_setting_free(rarch_setting_t *list)
{
rarch_setting_t *setting = list;

View File

@ -292,6 +292,8 @@ const char *menu_setting_get_short_description(rarch_setting_t *setting);
uint64_t menu_setting_get_flags(rarch_setting_t *setting);
const char *menu_setting_get_parent_group(rarch_setting_t *setting);
double menu_setting_get_min(rarch_setting_t *setting);
double menu_setting_get_max(rarch_setting_t *setting);