static void menu_list_flush_stack(menu_list_t *list, size_t idx, const char *needle, unsigned final_type) { bool refresh = false; const char *path = NULL; const char *label = NULL; unsigned type = 0; size_t entry_idx = 0; file_list_t *menu_list = menu_list_get(list, (unsigned)idx); if (!list) return; menu_entries_ctl(MENU_ENTRIES_CTL_SET_REFRESH, &refresh); file_list_get_last(menu_list, &path, &label, &type, &entry_idx); while (menu_list_flush_stack_type( needle, label, type, final_type) != 0) { size_t new_selection_ptr = menu_navigation_get_selection(); if (!menu_list_pop_stack(list, idx, &new_selection_ptr, 1)) break; menu_navigation_set_selection(new_selection_ptr); menu_list = menu_list_get(list, (unsigned)idx); file_list_get_last(menu_list, &path, &label, &type, &entry_idx); } }
void menu_list_flush_stack(menu_list_t *list, const char *needle, unsigned final_type) { const char *path = NULL; const char *label = NULL; unsigned type = 0; menu_handle_t *menu = menu_driver_get_ptr(); if (!menu || !list) return; menu_set_refresh(); file_list_get_last(list->menu_stack, &path, &label, &type); while (menu_list_flush_stack_type(needle, label, type, final_type) != 0) { menu_list_pop(list->menu_stack, &menu->navigation.selection_ptr); file_list_get_last(list->menu_stack, &path, &label, &type); } }
void menu_list_flush_stack(menu_list_t *list, const char *needle, unsigned final_type) { const char *path = NULL; const char *label = NULL; unsigned type = 0; size_t entry_idx = 0; menu_navigation_t *nav = menu_navigation_get_ptr(); if (!list) return; menu_entries_set_refresh(false); menu_list_get_last(list->menu_stack, &path, &label, &type, &entry_idx); while (menu_list_flush_stack_type( needle, label, type, final_type) != 0) { menu_list_pop(list->menu_stack, &nav->selection_ptr); menu_list_get_last(list->menu_stack, &path, &label, &type, &entry_idx); } }