diff --git a/frontend/menu/backend/menu_common_backend.c b/frontend/menu/backend/menu_common_backend.c index df6021546d..463fda2e02 100644 --- a/frontend/menu/backend/menu_common_backend.c +++ b/frontend/menu/backend/menu_common_backend.c @@ -42,7 +42,7 @@ static int menu_message_toggle(unsigned action) driver.menu_ctx->render_messagebox(driver.menu->message_contents); if (action == MENU_ACTION_OK) - menu_entries_pop_list(driver.menu->menu_stack); + menu_list_pop_stack(driver.menu->menu_stack); return 0; } @@ -95,7 +95,7 @@ static int menu_info_screen_iterate(unsigned action) } if (action == MENU_ACTION_OK) - menu_entries_pop_list(driver.menu->menu_stack); + menu_list_pop_stack(driver.menu->menu_stack); return 0; } @@ -181,7 +181,7 @@ static int menu_start_screen_iterate(unsigned action) driver.menu_ctx->render_messagebox(msg); if (action == MENU_ACTION_OK) - menu_entries_pop_list(driver.menu->menu_stack); + menu_list_pop_stack(driver.menu->menu_stack); return 0; } @@ -221,7 +221,7 @@ static int menu_settings_iterate(unsigned action, case MENU_ACTION_CANCEL: apply_deferred_settings(); - menu_entries_pop_list(driver.menu->menu_stack); + menu_list_pop_stack(driver.menu->menu_stack); break; case MENU_ACTION_SELECT: menu_list_push_stack(driver.menu->menu_stack, "", "info_screen", @@ -350,7 +350,7 @@ static int menu_viewport_iterate(unsigned action) break; case MENU_ACTION_CANCEL: - menu_entries_pop_list(driver.menu->menu_stack); + menu_list_pop_stack(driver.menu->menu_stack); if (!strcmp(label, "custom_viewport_2")) { menu_list_push_stack(driver.menu->menu_stack, "", "", @@ -360,7 +360,7 @@ static int menu_viewport_iterate(unsigned action) break; case MENU_ACTION_OK: - menu_entries_pop_list(driver.menu->menu_stack); + menu_list_pop_stack(driver.menu->menu_stack); if (type == MENU_SETTINGS_CUSTOM_VIEWPORT && !g_settings.video.scale_integer) { @@ -484,7 +484,7 @@ static int menu_load_or_open_zip_iterate(unsigned action) { case MENU_ACTION_OK: case MENU_ACTION_CANCEL: - menu_entries_pop_list(driver.menu->menu_stack); + menu_list_pop_stack(driver.menu->menu_stack); file_list_get_last(driver.menu->menu_stack, &menu_path, &menu_label, NULL); @@ -564,13 +564,13 @@ static int menu_common_iterate(unsigned action) else if (type == MENU_SETTINGS_CUSTOM_BIND) { if (menu_input_bind_iterate(driver.menu)) - menu_entries_pop_list(driver.menu->menu_stack); + menu_list_pop_stack(driver.menu->menu_stack); return 0; } else if (type == MENU_SETTINGS_CUSTOM_BIND_KEYBOARD) { if (menu_input_bind_iterate_keyboard(driver.menu)) - menu_entries_pop_list(driver.menu->menu_stack); + menu_list_pop_stack(driver.menu->menu_stack); return 0; } @@ -625,7 +625,7 @@ static int menu_common_iterate(unsigned action) break; case MENU_ACTION_CANCEL: - menu_entries_pop_list(driver.menu->menu_stack); + menu_list_pop_stack(driver.menu->menu_stack); break; case MENU_ACTION_OK: diff --git a/frontend/menu/menu_entries.c b/frontend/menu/menu_entries.c index 4b342186e8..33197a7e1b 100644 --- a/frontend/menu/menu_entries.c +++ b/frontend/menu/menu_entries.c @@ -100,18 +100,6 @@ void menu_build_scroll_indices(file_list_t *list) list->size - 1; } -void menu_entries_pop_list(file_list_t *list) -{ - if (!list) - return; - - if (file_list_get_size(list) > 1) - { - menu_list_pop(list, &driver.menu->selection_ptr); - driver.menu->need_refresh = true; - } -} - int setting_set_flags(rarch_setting_t *setting) { if (!setting) diff --git a/frontend/menu/menu_entries.h b/frontend/menu/menu_entries.h index f406310f92..3a36efde9a 100644 --- a/frontend/menu/menu_entries.h +++ b/frontend/menu/menu_entries.h @@ -34,8 +34,6 @@ int menu_entries_parse_list(file_list_t *list, file_list_t *menu_list, const char *dir, const char *label, unsigned type, unsigned default_type_plain, const char *exts); -void menu_entries_pop_list(file_list_t *list); - int menu_entries_deferred_push(file_list_t *list, file_list_t *menu_list); void menu_entries_pop_stack(file_list_t *list, const char *needle); diff --git a/frontend/menu/menu_list.c b/frontend/menu/menu_list.c index ec7c97bd5a..335d723b3e 100644 --- a/frontend/menu/menu_list.c +++ b/frontend/menu/menu_list.c @@ -37,6 +37,18 @@ end: file_list_free(list); } +void menu_list_pop_stack(file_list_t *list) +{ + if (!list) + return; + + if (file_list_get_size(list) > 1) + { + menu_list_pop(list, &driver.menu->selection_ptr); + driver.menu->need_refresh = true; + } +} + void menu_list_pop(file_list_t *list, size_t *directory_ptr) { if (!driver.menu_ctx) diff --git a/frontend/menu/menu_list.h b/frontend/menu/menu_list.h index a60a2f1c93..568409c75a 100644 --- a/frontend/menu/menu_list.h +++ b/frontend/menu/menu_list.h @@ -27,6 +27,8 @@ void menu_list_free(file_list_t *list); void menu_list_pop(file_list_t *list, size_t *directory_ptr); +void menu_list_pop_stack(file_list_t *list); + void menu_list_clear(file_list_t *list); void menu_list_push(file_list_t *list,