mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-01-10 13:02:27 +00:00
Cleanups pt. 2
This commit is contained in:
parent
bfc969faac
commit
9d137e2b1f
@ -25,29 +25,6 @@
|
||||
#include "menu_list.h"
|
||||
#include "menu_navigation.h"
|
||||
|
||||
static void menu_driver_list_insert(file_list_t *list, const char *path,
|
||||
const char *label, unsigned type, size_t idx)
|
||||
{
|
||||
menu_file_list_cbs_t *cbs = NULL;
|
||||
const menu_ctx_driver_t *driver = menu_ctx_driver_get_ptr();
|
||||
|
||||
if (!list)
|
||||
return;
|
||||
|
||||
if (driver->list_insert)
|
||||
driver->list_insert(list, path, label, idx);
|
||||
|
||||
file_list_free_actiondata(list, idx);
|
||||
cbs = (menu_file_list_cbs_t*)
|
||||
calloc(1, sizeof(menu_file_list_cbs_t));
|
||||
|
||||
if (!cbs)
|
||||
return;
|
||||
|
||||
file_list_set_actiondata(list, idx, cbs);
|
||||
menu_cbs_init(list, path, label, type, idx);
|
||||
}
|
||||
|
||||
size_t menu_list_get_size(menu_list_t *list)
|
||||
{
|
||||
if (!list)
|
||||
@ -257,11 +234,28 @@ void menu_list_push(file_list_t *list,
|
||||
unsigned type, size_t directory_ptr,
|
||||
size_t entry_idx)
|
||||
{
|
||||
size_t idx;
|
||||
const menu_ctx_driver_t *driver = menu_ctx_driver_get_ptr();
|
||||
menu_file_list_cbs_t *cbs = NULL;
|
||||
if (!list || !label)
|
||||
return;
|
||||
|
||||
file_list_push(list, path, label, type, directory_ptr, entry_idx);
|
||||
menu_driver_list_insert(list, path, label, type, list->size - 1);
|
||||
|
||||
idx = list->size - 1;
|
||||
|
||||
if (driver->list_insert)
|
||||
driver->list_insert(list, path, label, idx);
|
||||
|
||||
file_list_free_actiondata(list, idx);
|
||||
cbs = (menu_file_list_cbs_t*)
|
||||
calloc(1, sizeof(menu_file_list_cbs_t));
|
||||
|
||||
if (!cbs)
|
||||
return;
|
||||
|
||||
file_list_set_actiondata(list, idx, cbs);
|
||||
menu_cbs_init(list, path, label, type, idx);
|
||||
}
|
||||
|
||||
void menu_list_set_alt_at_offset(file_list_t *list, size_t idx,
|
||||
|
Loading…
Reference in New Issue
Block a user