mirror of
https://github.com/libretro/RetroArch
synced 2025-04-10 06:44:27 +00:00
Cut down on code duplication
This commit is contained in:
parent
1dab4a7f83
commit
ec92edb998
@ -3293,33 +3293,18 @@ static int action_ok_netplay_lan_scan(const char *path,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int action_ok_content_collection_list(const char *path,
|
#define default_action_ok_dl_push(funcname, _fbid, _id, _path) \
|
||||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
static int (funcname)(const char *path, const char *label, unsigned type, size_t idx, size_t entry_idx) \
|
||||||
{
|
{ \
|
||||||
filebrowser_set_type(FILEBROWSER_SELECT_COLLECTION);
|
settings_t *settings = config_get_ptr(); \
|
||||||
return generic_action_ok_displaylist_push(path, NULL, label, type, idx,
|
(void)settings; \
|
||||||
entry_idx, ACTION_OK_DL_CONTENT_COLLECTION_LIST);
|
filebrowser_set_type(_fbid); \
|
||||||
|
return generic_action_ok_displaylist_push(path, _path, label, type, idx, entry_idx, _id); \
|
||||||
}
|
}
|
||||||
|
|
||||||
static int action_ok_push_content_list(const char *path,
|
default_action_ok_dl_push(action_ok_content_collection_list, FILEBROWSER_SELECT_COLLECTION, ACTION_OK_DL_CONTENT_COLLECTION_LIST, NULL)
|
||||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
default_action_ok_dl_push(action_ok_push_content_list, FILEBROWSER_SELECT_FILE, ACTION_OK_DL_CONTENT_LIST, settings->paths.directory_menu_content)
|
||||||
{
|
default_action_ok_dl_push(action_ok_push_scan_file, FILEBROWSER_SCAN_FILE, ACTION_OK_DL_CONTENT_LIST, settings->paths.directory_menu_content)
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
filebrowser_set_type(FILEBROWSER_SELECT_FILE);
|
|
||||||
return generic_action_ok_displaylist_push(path,
|
|
||||||
settings->paths.directory_menu_content, label, type, idx,
|
|
||||||
entry_idx, ACTION_OK_DL_CONTENT_LIST);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int action_ok_push_scan_file(const char *path,
|
|
||||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
||||||
{
|
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
filebrowser_set_type(FILEBROWSER_SCAN_FILE);
|
|
||||||
return generic_action_ok_displaylist_push(path,
|
|
||||||
settings->paths.directory_menu_content, label, type, idx,
|
|
||||||
entry_idx, ACTION_OK_DL_CONTENT_LIST);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef HAVE_NETWORKING
|
#ifdef HAVE_NETWORKING
|
||||||
struct netplay_host_list *lan_hosts;
|
struct netplay_host_list *lan_hosts;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user