mirror of
https://github.com/libretro/RetroArch
synced 2025-02-08 06:40:14 +00:00
Start using menu_entries_get_last_stack
This commit is contained in:
parent
b8720cf056
commit
c42e4c420f
@ -57,16 +57,11 @@ int generic_action_ok_displaylist_push(const char *path,
|
||||
const char *info_path = NULL;
|
||||
global_t *global = global_get_ptr();
|
||||
settings_t *settings = config_get_ptr();
|
||||
menu_list_t *menu_list = menu_list_get_ptr();
|
||||
file_list_t *selection_buf = menu_entries_get_selection_buf_ptr();
|
||||
file_list_t *menu_stack = menu_entries_get_menu_stack_ptr();
|
||||
menu_handle_t *menu = menu_driver_get_ptr();
|
||||
|
||||
if (!menu_list)
|
||||
return -1;
|
||||
|
||||
menu_list_get_last_stack(menu_list,
|
||||
&menu_path, &menu_label, NULL, NULL);
|
||||
menu_entries_get_last_stack(&menu_path, &menu_label, NULL, NULL);
|
||||
|
||||
if (path && menu_path)
|
||||
fill_pathname_join(action_path, menu_path, path, sizeof(action_path));
|
||||
@ -335,14 +330,12 @@ static int rarch_defer_core_wrapper(size_t idx, size_t entry_idx, const char *pa
|
||||
const char *menu_label = NULL;
|
||||
int ret = 0;
|
||||
menu_handle_t *menu = menu_driver_get_ptr();
|
||||
menu_list_t *menu_list = menu_list_get_ptr();
|
||||
global_t *global = global_get_ptr();
|
||||
|
||||
if (!menu)
|
||||
return -1;
|
||||
|
||||
menu_list_get_last_stack(menu_list,
|
||||
&menu_path, &menu_label, NULL, NULL);
|
||||
menu_entries_get_last_stack(&menu_path, &menu_label, NULL, NULL);
|
||||
|
||||
strlcpy(menu_path_new, menu_path, sizeof(menu_path_new));
|
||||
|
||||
@ -552,10 +545,10 @@ static int generic_action_ok(const char *path,
|
||||
settings_t *settings = config_get_ptr();
|
||||
menu_list_t *menu_list = menu_list_get_ptr();
|
||||
|
||||
if (!menu || !menu_list)
|
||||
if (!menu)
|
||||
goto error;
|
||||
|
||||
menu_list_get_last_stack(menu_list, &menu_path, NULL,
|
||||
menu_entries_get_last_stack(&menu_path, NULL,
|
||||
NULL, NULL);
|
||||
|
||||
fill_pathname_join(action_path, menu_path, path, sizeof(action_path));
|
||||
|
@ -36,15 +36,15 @@ int action_scan_file(const char *path,
|
||||
const char *menu_label = NULL;
|
||||
const char *menu_path = NULL;
|
||||
menu_handle_t *menu = menu_driver_get_ptr();
|
||||
menu_list_t *menu_list = menu_list_get_ptr();
|
||||
if (!menu || !menu_list)
|
||||
if (!menu)
|
||||
return -1;
|
||||
|
||||
menu_list_get_last_stack(menu_list, &menu_path, &menu_label, NULL, NULL);
|
||||
menu_entries_get_last_stack(&menu_path, &menu_label, NULL, NULL);
|
||||
|
||||
fill_pathname_join(fullpath, menu_path, path, sizeof(fullpath));
|
||||
|
||||
rarch_main_data_msg_queue_push(DATA_TYPE_DB, fullpath, "cb_db_scan_file", 0, 1, true);
|
||||
rarch_main_data_msg_queue_push(DATA_TYPE_DB, fullpath,
|
||||
"cb_db_scan_file", 0, 1, true);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -55,18 +55,18 @@ int action_scan_directory(const char *path,
|
||||
const char *menu_label = NULL;
|
||||
const char *menu_path = NULL;
|
||||
menu_handle_t *menu = menu_driver_get_ptr();
|
||||
menu_list_t *menu_list = menu_list_get_ptr();
|
||||
if (!menu || !menu_list)
|
||||
if (!menu)
|
||||
return -1;
|
||||
|
||||
menu_list_get_last_stack(menu_list, &menu_path, &menu_label, NULL, NULL);
|
||||
menu_entries_get_last_stack(&menu_path, &menu_label, NULL, NULL);
|
||||
|
||||
strlcpy(fullpath, menu_path, sizeof(fullpath));
|
||||
|
||||
if (path)
|
||||
fill_pathname_join(fullpath, fullpath, path, sizeof(fullpath));
|
||||
|
||||
rarch_main_data_msg_queue_push(DATA_TYPE_DB, fullpath, "cb_db_scan_folder", 0, 1, true);
|
||||
rarch_main_data_msg_queue_push(DATA_TYPE_DB, fullpath,
|
||||
"cb_db_scan_folder", 0, 1, true);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -216,7 +216,7 @@ int generic_menu_iterate(enum menu_action action)
|
||||
file_list_t *menu_stack = menu_entries_get_menu_stack_ptr();
|
||||
file_list_t *selection_buf = menu_entries_get_selection_buf_ptr();
|
||||
|
||||
menu_list_get_last_stack(menu_list, NULL, &label, NULL, NULL);
|
||||
menu_entries_get_last_stack(NULL, &label, NULL, NULL);
|
||||
|
||||
if (!menu || !menu_list)
|
||||
return 0;
|
||||
|
@ -294,3 +294,11 @@ void menu_entries_push(file_list_t *list, const char *path, const char *label,
|
||||
{
|
||||
menu_list_push(list, path, label, type, directory_ptr, entry_idx);
|
||||
}
|
||||
|
||||
void menu_entries_get_last_stack(const char **path, const char **label,
|
||||
unsigned *file_type, size_t *entry_idx)
|
||||
{
|
||||
menu_list_t *menu_list = menu_list_get_ptr();
|
||||
if (menu_list)
|
||||
menu_list_get_last_stack(menu_list, path, label, file_type, entry_idx);
|
||||
}
|
||||
|
@ -67,6 +67,9 @@ void menu_entries_free_list(menu_entries_t *entries);
|
||||
|
||||
void menu_entries_new_list(menu_entries_t *entries, unsigned flags);
|
||||
|
||||
void menu_entries_get_last_stack(const char **path, const char **label,
|
||||
unsigned *file_type, size_t *entry_idx);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -229,8 +229,7 @@ int menu_entry_pathdir_set_value(uint32_t i, const char *s)
|
||||
|
||||
(void)s;
|
||||
|
||||
menu_list_get_last_stack(menu_list,
|
||||
&menu_path, NULL, NULL, NULL);
|
||||
menu_entries_get_last_stack(&menu_path, NULL, NULL, NULL);
|
||||
cbs = (menu_file_list_cbs_t*)menu_list_get_last_stack_actiondata(menu_list);
|
||||
|
||||
if (!cbs || !cbs->setting)
|
||||
@ -323,8 +322,7 @@ void menu_entry_get(menu_entry_t *entry, size_t i,
|
||||
if (cbs && cbs->action_get_value && use_representation)
|
||||
{
|
||||
const char *label = NULL;
|
||||
menu_list_t *menu_list = menu_list_get_ptr();
|
||||
menu_list_get_last_stack(menu_list, NULL, &label, NULL, NULL);
|
||||
menu_entries_get_last_stack(NULL, &label, NULL, NULL);
|
||||
|
||||
cbs->action_get_value(list,
|
||||
&entry->spacing, entry->type, i, label,
|
||||
|
Loading…
x
Reference in New Issue
Block a user