Refactor menu_entries_get_last_setting out of existence

This commit is contained in:
twinaphex 2014-10-11 15:49:38 +02:00
parent 7c3080b312
commit 925d873d91
4 changed files with 8 additions and 25 deletions

View File

@ -76,16 +76,13 @@ static int menu_info_screen_iterate(unsigned action)
if (driver.video_data && driver.menu_ctx && driver.menu_ctx->render)
driver.menu_ctx->render();
current_setting = (rarch_setting_t*)menu_entries_get_last_setting(
list->list[driver.menu->selection_ptr].label,
driver.menu->selection_ptr, driver.menu->list_settings);
current_setting = (rarch_setting_t*)setting_data_find_setting(
driver.menu->list_settings, list->list[driver.menu->selection_ptr].label);
if (current_setting)
strlcpy(needle, current_setting->name, sizeof(needle));
else if ((current_setting = (rarch_setting_t*)menu_entries_get_last_setting(
list->list[driver.menu->selection_ptr].label,
driver.menu->selection_ptr,
driver.menu->list_mainmenu)))
else if ((current_setting = (rarch_setting_t*)setting_data_find_setting(
driver.menu->list_mainmenu, list->list[driver.menu->selection_ptr].label)))
{
if (current_setting)
strlcpy(needle, current_setting->name, sizeof(needle));

View File

@ -390,18 +390,16 @@ int menu_action_setting_set(unsigned id, const char *label,
/* Check if setting belongs to settings menu. */
rarch_setting_t *setting = (rarch_setting_t*)menu_entries_get_last_setting(
list->list[driver.menu->selection_ptr].label,
driver.menu->selection_ptr, driver.menu->list_settings);
rarch_setting_t *setting = (rarch_setting_t*)setting_data_find_setting(
driver.menu->list_settings, list->list[driver.menu->selection_ptr].label);
if (setting)
return menu_action_handle_setting(setting, id, label, action);
/* Check if setting belongs to main menu. */
setting = (rarch_setting_t*)menu_entries_get_last_setting(
list->list[driver.menu->selection_ptr].label,
driver.menu->selection_ptr, driver.menu->list_mainmenu);
setting = (rarch_setting_t*)setting_data_find_setting(
driver.menu->list_mainmenu, list->list[driver.menu->selection_ptr].label);
if (setting)
{

View File

@ -917,12 +917,3 @@ int menu_entries_set_current_path_selection(
return menu_action_setting_apply(setting);
}
void *menu_entries_get_last_setting(const char *label, int index,
rarch_setting_t *settings)
{
if (settings)
return (rarch_setting_t*)setting_data_find_setting(settings,
label);
return NULL;
}

View File

@ -46,7 +46,4 @@ int menu_entries_set_current_path_selection(
const char *label, unsigned type,
unsigned action);
void *menu_entries_get_last_setting(const char *label, int index,
rarch_setting_t *settings);
#endif