diff --git a/menu/menu.c b/menu/menu.c index 8fd7b3984e..dddc6a1f81 100644 --- a/menu/menu.c +++ b/menu/menu.c @@ -50,7 +50,7 @@ static void menu_environment_get(int *argc, char *argv[], wrap_args->touched = true; } -static void push_to_history_playlist(void) +static void menu_push_to_history_playlist(void) { settings_t *settings = config_get_ptr(); global_t *global = global_get_ptr(); @@ -118,7 +118,7 @@ bool menu_load_content(void) event_command(EVENT_CMD_HISTORY_INIT); if (*global->fullpath || (menu && menu->load_no_content)) - push_to_history_playlist(); + menu_push_to_history_playlist(); event_command(EVENT_CMD_VIDEO_SET_ASPECT_RATIO); event_command(EVENT_CMD_RESUME); @@ -126,6 +126,18 @@ bool menu_load_content(void) return true; } +void menu_common_load_content(bool persist) +{ + menu_handle_t *menu = menu_driver_get_ptr(); + if (!menu) + return; + + event_command(persist ? EVENT_CMD_LOAD_CONTENT_PERSIST : EVENT_CMD_LOAD_CONTENT); + + menu_list_flush_stack(menu->menu_list, NULL, MENU_SETTINGS); + menu->msg_force = true; +} + /** * menu_init: * @data : Menu context handle. diff --git a/menu/menu.h b/menu/menu.h index 22823db7d7..2d227252f5 100644 --- a/menu/menu.h +++ b/menu/menu.h @@ -188,6 +188,8 @@ void menu_free(menu_handle_t *menu); **/ bool menu_load_content(void); +void menu_common_load_content(bool persist); + void menu_update_system_info(menu_handle_t *menu, bool *load_no_content); int menu_do_refresh(unsigned action); diff --git a/menu/menu_entries_cbs.c b/menu/menu_entries_cbs.c index ebf98434ab..3b0f959dcc 100644 --- a/menu/menu_entries_cbs.c +++ b/menu/menu_entries_cbs.c @@ -30,18 +30,6 @@ #include -void menu_entries_common_load_content(bool persist) -{ - menu_handle_t *menu = menu_driver_get_ptr(); - if (!menu) - return; - - event_command(persist ? EVENT_CMD_LOAD_CONTENT_PERSIST : EVENT_CMD_LOAD_CONTENT); - - menu_list_flush_stack(menu->menu_list, NULL, MENU_SETTINGS); - menu->msg_force = true; -} - #if 0 #define DEBUG_LOG #endif diff --git a/menu/menu_entries_cbs.h b/menu/menu_entries_cbs.h index 67ba544098..06be45bc79 100644 --- a/menu/menu_entries_cbs.h +++ b/menu/menu_entries_cbs.h @@ -43,8 +43,6 @@ int action_right_cheat(unsigned type, const char *label, bool wraparound); /* End of function callbacks */ -void menu_entries_common_load_content(bool persist); - int menu_entries_cbs_init_bind_left(menu_file_list_cbs_t *cbs, const char *path, const char *label, unsigned type, size_t idx, const char *elem0, const char *elem1, const char *menu_label, diff --git a/menu/menu_entries_cbs_iterate.c b/menu/menu_entries_cbs_iterate.c index 6d7fac8d65..41409576d9 100644 --- a/menu/menu_entries_cbs_iterate.c +++ b/menu/menu_entries_cbs_iterate.c @@ -100,7 +100,7 @@ static int archive_load(void) { case -1: event_command(EVENT_CMD_LOAD_CORE); - menu_entries_common_load_content(false); + menu_common_load_content(false); break; case 0: info.list = menu->menu_list->menu_stack; diff --git a/menu/menu_entries_cbs_ok.c b/menu/menu_entries_cbs_ok.c index c64c249f0c..4ec2af4eb1 100644 --- a/menu/menu_entries_cbs_ok.c +++ b/menu/menu_entries_cbs_ok.c @@ -87,7 +87,7 @@ static int action_ok_file_load_with_detect_core(const char *path, return menu_displaylist_push_list(&info, DISPLAYLIST_GENERIC); default: event_command(EVENT_CMD_LOAD_CORE); - menu_entries_common_load_content(false); + menu_common_load_content(false); return -1; } } @@ -129,7 +129,7 @@ static int action_ok_file_load_detect_core(const char *path, strlcpy(global->fullpath, detect_content_path, sizeof(global->fullpath)); strlcpy(settings->libretro, path, sizeof(settings->libretro)); event_command(EVENT_CMD_LOAD_CORE); - menu_entries_common_load_content(false); + menu_common_load_content(false); return -1; } @@ -874,7 +874,7 @@ static int action_ok_core_load_deferred(const char *path, strlcpy(global->fullpath, menu->deferred_path, sizeof(global->fullpath)); - menu_entries_common_load_content(false); + menu_common_load_content(false); return -1; } @@ -939,7 +939,7 @@ static int action_ok_core_load(const char *path, { *global->fullpath = '\0'; - menu_entries_common_load_content(false); + menu_common_load_content(false); return -1; } @@ -1131,7 +1131,7 @@ static int action_ok_file_load(const char *path, fill_pathname_join(global->fullpath, menu_path, path, sizeof(global->fullpath)); - menu_entries_common_load_content(true); + menu_common_load_content(true); return -1; }