From 3031556e7320605dae56fcab60ad773b23c10a52 Mon Sep 17 00:00:00 2001 From: jdgleaver Date: Fri, 6 Dec 2019 10:47:45 +0000 Subject: [PATCH] Enable playlist/add content functionality on platforms without database support --- config.def.h | 2 -- configuration.c | 2 -- menu/drivers/ozone/ozone.c | 16 +++++++--------- menu/drivers/stripes.c | 19 +++++++------------ menu/drivers/xmb.c | 16 +++++++--------- menu/menu_displaylist.c | 9 +-------- menu/menu_setting.c | 2 -- 7 files changed, 22 insertions(+), 44 deletions(-) diff --git a/config.def.h b/config.def.h index 42ce20c1d0..abd1cc25b8 100644 --- a/config.def.h +++ b/config.def.h @@ -518,9 +518,7 @@ static bool content_show_video = true; static bool content_show_netplay = true; #endif static bool content_show_history = true; -#ifdef HAVE_LIBRETRODB static bool content_show_add = true; -#endif static bool content_show_playlists = true; #ifdef HAVE_XMB diff --git a/configuration.c b/configuration.c index 67cffe4fb8..49c7e3bc37 100644 --- a/configuration.c +++ b/configuration.c @@ -1523,9 +1523,7 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings, SETTING_BOOL("content_show_netplay", &settings->bools.menu_content_show_netplay, true, content_show_netplay, false); #endif SETTING_BOOL("content_show_history", &settings->bools.menu_content_show_history, true, content_show_history, false); -#ifdef HAVE_LIBRETRODB SETTING_BOOL("content_show_add", &settings->bools.menu_content_show_add, true, content_show_add, false); -#endif SETTING_BOOL("content_show_playlists", &settings->bools.menu_content_show_playlists, true, content_show_playlists, false); SETTING_BOOL("menu_show_load_core", &settings->bools.menu_show_load_core, true, menu_show_load_core, false); SETTING_BOOL("menu_show_load_content", &settings->bools.menu_show_load_content, true, menu_show_load_content, false); diff --git a/menu/drivers/ozone/ozone.c b/menu/drivers/ozone/ozone.c index 01be16e064..7a4fb7ad6f 100644 --- a/menu/drivers/ozone/ozone.c +++ b/menu/drivers/ozone/ozone.c @@ -198,10 +198,9 @@ static void *ozone_init(void **userdata, bool video_is_threaded) if (settings->bools.menu_content_show_netplay) ozone->tabs[++ozone->system_tab_end] = OZONE_SYSTEM_TAB_NETPLAY; #endif -#ifdef HAVE_LIBRETRODB + if (settings->bools.menu_content_show_add && !settings->bools.kiosk_mode_enable) ozone->tabs[++ozone->system_tab_end] = OZONE_SYSTEM_TAB_ADD; -#endif menu_driver_ctl(RARCH_MENU_CTL_UNSET_PREVENT_POPULATE, NULL); @@ -748,13 +747,12 @@ static int ozone_list_push(void *data, void *userdata, MENU_SETTING_ACTION, 0, 0); } -#ifdef HAVE_LIBRETRODB - menu_entries_append_enum(info->list, - msg_hash_to_str(MENU_ENUM_LABEL_VALUE_PLAYLISTS_TAB), - msg_hash_to_str(MENU_ENUM_LABEL_PLAYLISTS_TAB), - MENU_ENUM_LABEL_PLAYLISTS_TAB, - MENU_SETTING_ACTION, 0, 0); -#endif + if (settings->bools.menu_content_show_playlists) + menu_entries_append_enum(info->list, + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_PLAYLISTS_TAB), + msg_hash_to_str(MENU_ENUM_LABEL_PLAYLISTS_TAB), + MENU_ENUM_LABEL_PLAYLISTS_TAB, + MENU_SETTING_ACTION, 0, 0); if (frontend_driver_parse_drive_list(info->list, true) != 0) menu_entries_append_enum(info->list, "/", diff --git a/menu/drivers/stripes.c b/menu/drivers/stripes.c index 3434aa0b46..f503dfe7c1 100644 --- a/menu/drivers/stripes.c +++ b/menu/drivers/stripes.c @@ -3328,10 +3328,9 @@ static void *stripes_init(void **userdata, bool video_is_threaded) if (settings->bools.menu_content_show_netplay) stripes->tabs[++stripes->system_tab_end] = STRIPES_SYSTEM_TAB_NETPLAY; #endif -#ifdef HAVE_LIBRETRODB + if (settings->bools.menu_content_show_add && !settings->bools.kiosk_mode_enable) stripes->tabs[++stripes->system_tab_end] = STRIPES_SYSTEM_TAB_ADD; -#endif menu_driver_ctl(RARCH_MENU_CTL_UNSET_PREVENT_POPULATE, NULL); @@ -4144,16 +4143,12 @@ static int stripes_list_push(void *data, void *userdata, MENU_SETTING_ACTION, 0, 0); } -#ifdef HAVE_LIBRETRODB -#if 0 - /* TODO/FIXME - figure out what to do here */ - menu_entries_append_enum(info->list, - msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CONTENT_COLLECTION_LIST), - msg_hash_to_str(MENU_ENUM_LABEL_CONTENT_COLLECTION_LIST), - MENU_ENUM_LABEL_CONTENT_COLLECTION_LIST, - MENU_SETTING_ACTION, 0, 0); -#endif -#endif + if (settings->bools.menu_content_show_playlists) + menu_entries_append_enum(info->list, + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_PLAYLISTS_TAB), + msg_hash_to_str(MENU_ENUM_LABEL_PLAYLISTS_TAB), + MENU_ENUM_LABEL_PLAYLISTS_TAB, + MENU_SETTING_ACTION, 0, 0); if (frontend_driver_parse_drive_list(info->list, true) != 0) menu_entries_append_enum(info->list, "/", diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index 772abbe3bc..a415292bc9 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -4782,10 +4782,9 @@ static void *xmb_init(void **userdata, bool video_is_threaded) if (settings->bools.menu_content_show_netplay) xmb->tabs[++xmb->system_tab_end] = XMB_SYSTEM_TAB_NETPLAY; #endif -#ifdef HAVE_LIBRETRODB + if (settings->bools.menu_content_show_add && !settings->bools.kiosk_mode_enable) xmb->tabs[++xmb->system_tab_end] = XMB_SYSTEM_TAB_ADD; -#endif menu_driver_ctl(RARCH_MENU_CTL_UNSET_PREVENT_POPULATE, NULL); @@ -5843,13 +5842,12 @@ static int xmb_list_push(void *data, void *userdata, MENU_SETTING_ACTION, 0, 0); } -#ifdef HAVE_LIBRETRODB - menu_entries_append_enum(info->list, - msg_hash_to_str(MENU_ENUM_LABEL_VALUE_PLAYLISTS_TAB), - msg_hash_to_str(MENU_ENUM_LABEL_PLAYLISTS_TAB), - MENU_ENUM_LABEL_PLAYLISTS_TAB, - MENU_SETTING_ACTION, 0, 0); -#endif + if (settings->bools.menu_content_show_playlists) + menu_entries_append_enum(info->list, + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_PLAYLISTS_TAB), + msg_hash_to_str(MENU_ENUM_LABEL_PLAYLISTS_TAB), + MENU_ENUM_LABEL_PLAYLISTS_TAB, + MENU_SETTING_ACTION, 0, 0); if (frontend_driver_parse_drive_list(info->list, true) != 0) menu_entries_append_enum(info->list, "/", diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index 4f7a0f62fe..f5eeed45cc 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -4606,20 +4606,16 @@ unsigned menu_displaylist_build_list(file_list_t *list, enum menu_displaylist_ct } } -#ifndef HAVE_LIBRETRODB { settings_t *settings = config_get_ptr(); - if (settings->bools.menu_show_advanced_settings) -#endif + if (settings->bools.menu_content_show_playlists) if (menu_entries_append_enum(list, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_PLAYLISTS_TAB), msg_hash_to_str(MENU_ENUM_LABEL_PLAYLISTS_TAB), MENU_ENUM_LABEL_PLAYLISTS_TAB, MENU_SETTING_ACTION, 0, 0)) count++; -#ifndef HAVE_LIBRETRODB } -#endif if (frontend_driver_parse_drive_list(list, true) != 0) if (menu_entries_append_enum(list, "/", @@ -8688,9 +8684,6 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, } if (string_is_equal(settings->arrays.menu_driver, "rgui") && -#ifndef HAVE_LIBRETRODB - settings->bools.menu_show_advanced_settings && -#endif settings->bools.menu_content_show_playlists) if (menu_entries_append_enum(info->list, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_PLAYLISTS_TAB), diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 18b8673b37..3c0c5aad43 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -13133,7 +13133,6 @@ static bool setting_append_list( SD_FLAG_NONE); #endif -#ifdef HAVE_LIBRETRODB CONFIG_BOOL( list, list_info, &settings->bools.menu_content_show_add, @@ -13149,7 +13148,6 @@ static bool setting_append_list( general_read_handler, SD_FLAG_NONE); SETTINGS_DATA_LIST_CURRENT_ADD_FLAGS(list, list_info, SD_FLAG_LAKKA_ADVANCED); -#endif CONFIG_BOOL( list, list_info,