From fe1351cc0da0e33658a9f3b6b5fe5135576bb125 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 18 Aug 2015 03:03:34 +0200 Subject: [PATCH] Cleanups --- menu/menu_entries.c | 11 ++--------- menu/menu_entries.h | 2 -- menu/menu_entry.c | 3 +++ menu/menu_list.c | 1 + runloop_data.c | 2 -- 5 files changed, 6 insertions(+), 13 deletions(-) diff --git a/menu/menu_entries.c b/menu/menu_entries.c index 69a7277d3b..e28bcb580b 100644 --- a/menu/menu_entries.c +++ b/menu/menu_entries.c @@ -172,18 +172,11 @@ static bool menu_entries_get_nonblocking_refresh(void) return entries->nonblocking_refresh; } -int menu_entries_refresh(void) -{ - if (menu_entries_get_nonblocking_refresh()) - return -1; - if (!menu_entries_needs_refresh()) - return -1; - return menu_entry_iterate(MENU_ACTION_REFRESH); -} - bool menu_entries_needs_refresh(void) { menu_entries_t *entries = menu_entries_get_ptr(); + if (menu_entries_get_nonblocking_refresh()) + return false; if (!entries) return false; return entries->need_refresh; diff --git a/menu/menu_entries.h b/menu/menu_entries.h index f8238b4043..6e272045aa 100644 --- a/menu/menu_entries.h +++ b/menu/menu_entries.h @@ -56,8 +56,6 @@ int menu_entries_get_core_title(char *title_msg, size_t title_msg_len); menu_entries_t *menu_entries_get_ptr(void); -int menu_entries_refresh(void); - bool menu_entries_needs_refresh(void); void menu_entries_set_refresh(void); diff --git a/menu/menu_entry.c b/menu/menu_entry.c index 5b32e9a2ce..16ec1da15e 100644 --- a/menu/menu_entry.c +++ b/menu/menu_entry.c @@ -378,6 +378,9 @@ int menu_entry_action(menu_entry_t *entry, unsigned i, enum menu_action action) menu_list_t *menu_list = menu_list_get_ptr(); menu_file_list_cbs_t *cbs = menu_list_get_actiondata_at_offset(menu_list->selection_buf, i); + if (menu_entries_needs_refresh()) + action = MENU_ACTION_REFRESH; + switch (action) { case MENU_ACTION_UP: diff --git a/menu/menu_list.c b/menu/menu_list.c index 1e7293043a..04895cf84a 100644 --- a/menu/menu_list.c +++ b/menu/menu_list.c @@ -20,6 +20,7 @@ #include "../driver.h" #include "menu.h" +#include "menu_cbs.h" #include "menu_hash.h" #include "menu_list.h" #include "menu_navigation.h" diff --git a/runloop_data.c b/runloop_data.c index 2d6e2012d0..f8e597c713 100644 --- a/runloop_data.c +++ b/runloop_data.c @@ -214,8 +214,6 @@ static void rarch_main_data_menu_iterate(void) if (rarch_main_data_db_pending_scan_finished()) menu_environment_cb(MENU_ENVIRON_RESET_HORIZONTAL_LIST, NULL); #endif - - menu_entries_refresh(); } #endif