From cb9a9e9525f7ec0e68b94172e2214a9fc6975a71 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 17 Aug 2019 16:59:18 +0200 Subject: [PATCH] Cleanups --- menu/menu_driver.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/menu/menu_driver.c b/menu/menu_driver.c index e05c119e29..632fa0e715 100644 --- a/menu/menu_driver.c +++ b/menu/menu_driver.c @@ -782,11 +782,10 @@ int menu_entry_action(menu_entry_t *entry, { if (cbs && cbs->action_refresh) { - bool refresh = false; file_list_t *menu_stack = menu_entries_get_menu_stack_ptr(0); cbs->action_refresh(selection_buf, menu_stack); - menu_entries_ctl(MENU_ENTRIES_CTL_UNSET_REFRESH, &refresh); + menu_entries_need_refresh = false; } } @@ -905,7 +904,6 @@ static bool menu_list_pop_stack(menu_list_t *list, size_t idx, size_t *directory_ptr, bool animate) { menu_ctx_list_t list_info; - bool refresh = false; file_list_t *menu_list = menu_list_get(list, (unsigned)idx); if (menu_list_get_stack_size(list, idx) <= 1) @@ -931,7 +929,7 @@ static bool menu_list_pop_stack(menu_list_t *list, file_list_pop(menu_list, directory_ptr); menu_driver_list_set_selection(menu_list); if (animate) - menu_entries_ctl(MENU_ENTRIES_CTL_SET_REFRESH, &refresh); + menu_entries_need_refresh = false; return true; } @@ -939,14 +937,14 @@ static bool menu_list_pop_stack(menu_list_t *list, 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); + 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); + + menu_entries_need_refresh = true; - menu_entries_ctl(MENU_ENTRIES_CTL_SET_REFRESH, &refresh); file_list_get_last(menu_list, &path, &label, &type, &entry_idx);