From 4c6136d970917e3ea55fcf9868c85062b074151d Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 28 Jul 2020 12:15:05 +0200 Subject: [PATCH] Stub out menu_explore.c when HAVE_LIBRETRODB is not defined --- Makefile.common | 10 ++- griffin/griffin.c | 2 + menu/drivers/ozone/ozone.c | 2 + menu/drivers/ozone/ozone_sidebar.c | 14 +++++ menu/drivers/xmb.c | 2 + menu/menu_displaylist.c | 98 ++++++++++++++++-------------- 6 files changed, 79 insertions(+), 49 deletions(-) diff --git a/Makefile.common b/Makefile.common index 04ca1b58cf..a7c4263101 100644 --- a/Makefile.common +++ b/Makefile.common @@ -531,6 +531,10 @@ ifeq ($(HAVE_LIBRETRODB), 1) database_info.o \ tasks/task_database.o \ tasks/task_database_cue.o + + ifeq ($(HAVE_MENU), 1) + OBJ += menu/menu_explore.o + endif endif ifeq ($(HAVE_BUILTINMBEDTLS), 1) @@ -541,7 +545,8 @@ ifeq ($(HAVE_BUILTINMBEDTLS), 1) DEFINES += -DMBEDTLS_SSL_DEBUG_ALL endif - # MinGW requires this for some reason, even though the include paths are relative to the source + # MinGW requires this for some reason, + # even though the include paths are relative to the source INCLUDE_DIRS += -Ideps/mbedtls OBJS_TLS_CRYPTO = deps/mbedtls/aes.o \ @@ -913,8 +918,7 @@ ifeq ($(HAVE_MENU_COMMON), 1) menu/cbs/menu_cbs_up.o \ menu/cbs/menu_cbs_down.o \ menu/cbs/menu_cbs_contentlist_switch.o \ - menu/menu_displaylist.o \ - menu/menu_explore.o + menu/menu_displaylist.o endif ifeq ($(HAVE_GFX_WIDGETS), 1) diff --git a/griffin/griffin.c b/griffin/griffin.c index 9bd8529e5f..14ceac4d33 100644 --- a/griffin/griffin.c +++ b/griffin/griffin.c @@ -1349,8 +1349,10 @@ MENU #include "../menu/cbs/menu_cbs_down.c" #include "../menu/cbs/menu_cbs_contentlist_switch.c" #include "../menu/menu_displaylist.c" +#ifdef HAVE_LIBRETRODB #include "../menu/menu_explore.c" #endif +#endif #if defined(HAVE_LIBNX) #include "../gfx/drivers_display/gfx_display_switch.c" diff --git a/menu/drivers/ozone/ozone.c b/menu/drivers/ozone/ozone.c index f4fe44f5e1..07878673db 100644 --- a/menu/drivers/ozone/ozone.c +++ b/menu/drivers/ozone/ozone.c @@ -196,7 +196,9 @@ static void *ozone_init(void **userdata, bool video_is_threaded) if (settings->bools.menu_content_show_add && !settings->bools.kiosk_mode_enable) ozone->tabs[++ozone->system_tab_end] = OZONE_SYSTEM_TAB_ADD; +#ifdef HAVE_LIBRETRODB ozone->tabs[++ozone->system_tab_end] = OZONE_SYSTEM_TAB_EXPLORE; +#endif menu_driver_ctl(RARCH_MENU_CTL_UNSET_PREVENT_POPULATE, NULL); diff --git a/menu/drivers/ozone/ozone_sidebar.c b/menu/drivers/ozone/ozone_sidebar.c index e05141fb9b..0cef8496be 100644 --- a/menu/drivers/ozone/ozone_sidebar.c +++ b/menu/drivers/ozone/ozone_sidebar.c @@ -46,8 +46,12 @@ enum msg_hash_enums ozone_system_tabs_value[OZONE_SYSTEM_TAB_LAST] = { #ifdef HAVE_NETWORKING MENU_ENUM_LABEL_VALUE_NETPLAY_TAB, #endif +#ifdef HAVE_LIBRETRODB MENU_ENUM_LABEL_VALUE_ADD_TAB, MENU_ENUM_LABEL_VALUE_EXPLORE_TAB +#else + MENU_ENUM_LABEL_VALUE_ADD_TAB +#endif }; enum menu_settings_type ozone_system_tabs_type[OZONE_SYSTEM_TAB_LAST] = { @@ -65,8 +69,12 @@ enum menu_settings_type ozone_system_tabs_type[OZONE_SYSTEM_TAB_LAST] = { #ifdef HAVE_NETWORKING MENU_NETPLAY_TAB, #endif +#ifdef HAVE_LIBRETRODB MENU_ADD_TAB, MENU_EXPLORE_TAB +#else + MENU_ADD_TAB +#endif }; enum msg_hash_enums ozone_system_tabs_idx[OZONE_SYSTEM_TAB_LAST] = { @@ -84,8 +92,12 @@ enum msg_hash_enums ozone_system_tabs_idx[OZONE_SYSTEM_TAB_LAST] = { #ifdef HAVE_NETWORKING MENU_ENUM_LABEL_NETPLAY_TAB, #endif +#ifdef HAVE_LIBRETRODB MENU_ENUM_LABEL_ADD_TAB, MENU_ENUM_LABEL_EXPLORE_TAB +#else + MENU_ENUM_LABEL_ADD_TAB +#endif }; unsigned ozone_system_tabs_icons[OZONE_SYSTEM_TAB_LAST] = { @@ -1010,7 +1022,9 @@ bool ozone_is_playlist(ozone_handle_t *ozone, bool depth) #ifdef HAVE_NETWORKING case OZONE_SYSTEM_TAB_NETPLAY: #endif +#ifdef HAVE_LIBRETRODB case OZONE_SYSTEM_TAB_EXPLORE: +#endif is_playlist = false; break; case OZONE_SYSTEM_TAB_HISTORY: diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index 4c8882c9bc..f11f91d581 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -5450,7 +5450,9 @@ static void *xmb_init(void **userdata, bool video_is_threaded) && !settings->bools.kiosk_mode_enable) xmb->tabs[++xmb->system_tab_end] = XMB_SYSTEM_TAB_ADD; +#ifdef HAVE_LIBRETRODB xmb->tabs[++xmb->system_tab_end] = XMB_SYSTEM_TAB_EXPLORE; +#endif menu_driver_ctl(RARCH_MENU_CTL_UNSET_PREVENT_POPULATE, NULL); diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index ea5e3a0729..39ba8eda9f 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -3053,68 +3053,70 @@ static unsigned menu_displaylist_parse_playlists( * from the main menu 'Scan Content' entry. Placing * them here as well is unnecessary/ugly duplication */ if (settings->bools.menu_content_show_add && - !(string_is_equal(menu_ident, "glui") && - !settings->bools.menu_materialui_show_nav_bar)) + !(string_is_equal(menu_ident, "glui") && + !settings->bools.menu_materialui_show_nav_bar)) { #ifdef HAVE_LIBRETRODB if (menu_entries_append_enum(info->list, - msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SCAN_DIRECTORY), - msg_hash_to_str(MENU_ENUM_LABEL_SCAN_DIRECTORY), - MENU_ENUM_LABEL_SCAN_DIRECTORY, - MENU_SETTING_ACTION, 0, 0)) + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SCAN_DIRECTORY), + msg_hash_to_str(MENU_ENUM_LABEL_SCAN_DIRECTORY), + MENU_ENUM_LABEL_SCAN_DIRECTORY, + MENU_SETTING_ACTION, 0, 0)) count++; if (menu_entries_append_enum(info->list, - msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SCAN_FILE), - msg_hash_to_str(MENU_ENUM_LABEL_SCAN_FILE), - MENU_ENUM_LABEL_SCAN_FILE, - MENU_SETTING_ACTION, 0, 0)) + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SCAN_FILE), + msg_hash_to_str(MENU_ENUM_LABEL_SCAN_FILE), + MENU_ENUM_LABEL_SCAN_FILE, + MENU_SETTING_ACTION, 0, 0)) count++; #endif if (menu_entries_append_enum(info->list, - msg_hash_to_str(MENU_ENUM_LABEL_VALUE_MANUAL_CONTENT_SCAN_LIST), - msg_hash_to_str(MENU_ENUM_LABEL_MANUAL_CONTENT_SCAN_LIST), - MENU_ENUM_LABEL_MANUAL_CONTENT_SCAN_LIST, - MENU_SETTING_ACTION, 0, 0)) + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_MANUAL_CONTENT_SCAN_LIST), + msg_hash_to_str(MENU_ENUM_LABEL_MANUAL_CONTENT_SCAN_LIST), + MENU_ENUM_LABEL_MANUAL_CONTENT_SCAN_LIST, + MENU_SETTING_ACTION, 0, 0)) count++; } - if (menu_entries_append_enum(info->list, - msg_hash_to_str(MENU_ENUM_LABEL_VALUE_EXPLORE_TAB), - msg_hash_to_str(MENU_ENUM_LABEL_EXPLORE_TAB), - MENU_ENUM_LABEL_EXPLORE_TAB, - MENU_EXPLORE_TAB, 0, 0)) - count++; - if (settings->bools.menu_content_show_favorites) +#ifdef HAVE_LIBRETRODB if (menu_entries_append_enum(info->list, - msg_hash_to_str(MENU_ENUM_LABEL_VALUE_GOTO_FAVORITES), - msg_hash_to_str(MENU_ENUM_LABEL_GOTO_FAVORITES), - MENU_ENUM_LABEL_GOTO_FAVORITES, - MENU_SETTING_ACTION, 0, 0)) - count++; - if (settings->bools.menu_content_show_images) - if (menu_entries_append_enum(info->list, - msg_hash_to_str(MENU_ENUM_LABEL_VALUE_GOTO_IMAGES), - msg_hash_to_str(MENU_ENUM_LABEL_GOTO_IMAGES), - MENU_ENUM_LABEL_GOTO_IMAGES, - MENU_SETTING_ACTION, 0, 0)) + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_EXPLORE_TAB), + msg_hash_to_str(MENU_ENUM_LABEL_EXPLORE_TAB), + MENU_ENUM_LABEL_EXPLORE_TAB, + MENU_EXPLORE_TAB, 0, 0)) count++; +#endif + if (settings->bools.menu_content_show_favorites) + if (menu_entries_append_enum(info->list, + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_GOTO_FAVORITES), + msg_hash_to_str(MENU_ENUM_LABEL_GOTO_FAVORITES), + MENU_ENUM_LABEL_GOTO_FAVORITES, + MENU_SETTING_ACTION, 0, 0)) + count++; + if (settings->bools.menu_content_show_images) + if (menu_entries_append_enum(info->list, + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_GOTO_IMAGES), + msg_hash_to_str(MENU_ENUM_LABEL_GOTO_IMAGES), + MENU_ENUM_LABEL_GOTO_IMAGES, + MENU_SETTING_ACTION, 0, 0)) + count++; - if (settings->bools.menu_content_show_music) - if (menu_entries_append_enum(info->list, - msg_hash_to_str(MENU_ENUM_LABEL_VALUE_GOTO_MUSIC), - msg_hash_to_str(MENU_ENUM_LABEL_GOTO_MUSIC), - MENU_ENUM_LABEL_GOTO_MUSIC, - MENU_SETTING_ACTION, 0, 0)) - count++; + if (settings->bools.menu_content_show_music) + if (menu_entries_append_enum(info->list, + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_GOTO_MUSIC), + msg_hash_to_str(MENU_ENUM_LABEL_GOTO_MUSIC), + MENU_ENUM_LABEL_GOTO_MUSIC, + MENU_SETTING_ACTION, 0, 0)) + count++; #if defined(HAVE_FFMPEG) || defined(HAVE_MPV) - if (settings->bools.menu_content_show_video) - if (menu_entries_append_enum(info->list, - msg_hash_to_str(MENU_ENUM_LABEL_VALUE_GOTO_VIDEO), - msg_hash_to_str(MENU_ENUM_LABEL_GOTO_VIDEO), - MENU_ENUM_LABEL_GOTO_VIDEO, - MENU_SETTING_ACTION, 0, 0)) - count++; + if (settings->bools.menu_content_show_video) + if (menu_entries_append_enum(info->list, + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_GOTO_VIDEO), + msg_hash_to_str(MENU_ENUM_LABEL_GOTO_VIDEO), + MENU_ENUM_LABEL_GOTO_VIDEO, + MENU_SETTING_ACTION, 0, 0)) + count++; #endif } @@ -4363,11 +4365,13 @@ static bool menu_displaylist_push_internal( if (menu_displaylist_ctl(DISPLAYLIST_SCAN_DIRECTORY_LIST, info)) return true; } +#ifdef HAVE_LIBRETRODB else if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_EXPLORE_TAB))) { if (menu_displaylist_ctl(DISPLAYLIST_EXPLORE, info)) return true; } +#endif else if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_NETPLAY_TAB))) { if (menu_displaylist_ctl(DISPLAYLIST_NETPLAY_ROOM_LIST, info)) @@ -5446,10 +5450,12 @@ unsigned menu_displaylist_build_list( count = menu_displaylist_parse_system_info(list); break; case DISPLAYLIST_EXPLORE: +#ifdef HAVE_LIBRETRODB { unsigned menu_displaylist_explore(file_list_t *list); count = menu_displaylist_explore(list); } +#endif break; case DISPLAYLIST_SCAN_DIRECTORY_LIST: #ifdef HAVE_LIBRETRODB