(menu_displaylist.c) Horizontal list refactors #2

This commit is contained in:
twinaphex 2015-06-05 23:47:22 +02:00
parent 3e2663fd39
commit 61beed6ddb

View File

@ -1343,6 +1343,7 @@ static void menu_displaylist_push_horizontal_menu_list_content(
static int menu_displaylist_parse_horizontal_list(menu_displaylist_info_t *_info) static int menu_displaylist_parse_horizontal_list(menu_displaylist_info_t *_info)
{ {
size_t i;
const char *path = NULL; const char *path = NULL;
core_info_t *info = NULL; core_info_t *info = NULL;
global_t *global = global_get_ptr(); global_t *global = global_get_ptr();
@ -1364,37 +1365,32 @@ static int menu_displaylist_parse_horizontal_list(menu_displaylist_info_t *_info
path = settings->core_assets_directory; path = settings->core_assets_directory;
list = _info->list; list = _info->list;
if (!info->supports_no_game)
menu_displaylist_push_horizontal_menu_list_content(list, info, path);
else
menu_list_push(list, info->display_name, "content_actions",
MENU_FILE_CONTENTLIST_ENTRY, 0);
if (!info->databases_list)
return 0;
for (i = 0; i < info->databases_list->size; i++)
{ {
size_t i; char db_path[PATH_MAX_LENGTH];
settings_t *settings = config_get_ptr(); struct string_list *str_list = (struct string_list*)info->databases_list;
if (!info->supports_no_game) if (!str_list)
menu_displaylist_push_horizontal_menu_list_content(list, info, path); continue;
else
menu_list_push(list, info->display_name, "content_actions",
MENU_FILE_CONTENTLIST_ENTRY, 0);
if (!info->databases_list) fill_pathname_join(db_path, settings->content_database,
return 0; str_list->elems[i].data, sizeof(db_path));
strlcat(db_path, ".rdb", sizeof(db_path));
for (i = 0; i < info->databases_list->size; i++) if (!path_file_exists(db_path))
{ continue;
char db_path[PATH_MAX_LENGTH];
struct string_list *str_list = (struct string_list*)info->databases_list;
if (!str_list) menu_list_push(list, path_basename(db_path), "core_database",
continue; MENU_FILE_RDB, 0);
fill_pathname_join(db_path, settings->content_database,
str_list->elems[i].data, sizeof(db_path));
strlcat(db_path, ".rdb", sizeof(db_path));
if (!path_file_exists(db_path))
continue;
menu_list_push(list, path_basename(db_path), "core_database",
MENU_FILE_RDB, 0);
}
} }
return 0; return 0;