Create menu_entries_flush_stack

This commit is contained in:
twinaphex 2015-10-17 19:10:37 +02:00
parent fe213531b7
commit 44cb547ee4
4 changed files with 13 additions and 8 deletions

View File

@ -313,8 +313,7 @@ int generic_action_ok_displaylist_push(const char *path,
int action_ok_push_quick_menu(void)
{
bool msg_force = true;
menu_list_t *menu_list = menu_list_get_ptr();
menu_list_flush_stack(menu_list, NULL, MENU_SETTINGS);
menu_entries_flush_stack(NULL, MENU_SETTINGS);
menu_display_ctl(MENU_DISPLAY_CTL_SET_MSG_FORCE, &msg_force);
generic_action_ok_displaylist_push("",
@ -433,7 +432,6 @@ static int action_ok_playlist_entry(const char *path,
content_playlist_t *playlist = g_defaults.history;
bool is_history = true;
menu_handle_t *menu = menu_driver_get_ptr();
menu_list_t *menu_list = menu_list_get_ptr();
uint32_t hash_label = menu_hash_calculate(label);
if (!menu)
@ -496,7 +494,7 @@ static int action_ok_playlist_entry(const char *path,
menu_navigation_ctl(MENU_NAVIGATION_CTL_SET_SELECTION, &selection);
break;
default:
menu_list_flush_stack(menu_list, NULL, MENU_SETTINGS);
menu_entries_flush_stack(NULL, MENU_SETTINGS);
break;
}
@ -543,7 +541,6 @@ static int generic_action_ok(const char *path,
global_t *global = global_get_ptr();
menu_handle_t *menu = menu_driver_get_ptr();
settings_t *settings = config_get_ptr();
menu_list_t *menu_list = menu_list_get_ptr();
if (!menu)
goto error;
@ -659,7 +656,7 @@ static int generic_action_ok(const char *path,
break;
}
menu_list_flush_stack(menu_list, flush_char, flush_type);
menu_entries_flush_stack(flush_char, flush_type);
return ret;

View File

@ -308,6 +308,13 @@ void menu_entries_get_last_stack(const char **path, const char **label,
menu_list_get_last_stack(menu_list, path, label, file_type, entry_idx);
}
void menu_entries_flush_stack(const char *needle, unsigned final_type)
{
menu_list_t *menu_list = menu_list_get_ptr();
if (menu_list)
menu_list_flush_stack(menu_list, needle, final_type);
}
void menu_entries_pop_stack(size_t *ptr)
{
menu_list_t *menu_list = menu_list_get_ptr();

View File

@ -139,6 +139,8 @@ menu_file_list_cbs_t *menu_entries_get_last_stack_actiondata(void);
void menu_entries_pop_stack(size_t *ptr);
void menu_entries_flush_stack(const char *needle, unsigned final_type);
#ifdef __cplusplus
}
#endif

View File

@ -221,7 +221,6 @@ void menu_entry_pathdir_get_value(uint32_t i, char *s, size_t len)
int menu_entry_pathdir_set_value(uint32_t i, const char *s)
{
const char *menu_path = NULL;
menu_list_t *menu_list = menu_list_get_ptr();
menu_file_list_cbs_t *cbs = menu_entries_get_last_stack_actiondata();
menu_entries_get_last_stack(&menu_path, NULL, NULL, NULL);
@ -235,7 +234,7 @@ int menu_entry_pathdir_set_value(uint32_t i, const char *s)
menu_setting_set_with_string_representation(cbs->setting, menu_path);
menu_setting_generic(cbs->setting, false);
menu_list_flush_stack(menu_list, NULL, 49);
menu_entries_flush_stack(NULL, 49);
return 0;
}