Skip to content

Commit 60c7e39

Browse files
committed
menu_displaylist: Hide History/Images/Music/Videos entries when history is disabled
When 'Settings -> Playlists -> History' (history_list_enable) is OFF, CMD_EVENT_HISTORY_INIT early-returns and leaves g_defaults.content_history, image_history, music_history, and video_history all NULL. The Playlists tab generator was still appending entries for these with paths obtained via playlist_get_conf_path(NULL), which returns NULL and renders as a blank title. The icons and localized sublabels remained, producing four "empty" rows in Main Menu -> Playlists. Gate the four append calls additionally on the corresponding g_defaults.*_history pointer being non-NULL. This also covers the secondary early-return path in CMD_EVENT_HISTORY_INIT when content_history_size is 0. Mirror the same guard for the History entry in the rgui/glui (no nav bar) branch. Favorites is unaffected: g_defaults.content_favorites is initialized independently of history_list_enable.
1 parent b9777c8 commit 60c7e39

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

menu/menu_displaylist.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4229,7 +4229,7 @@ static unsigned menu_displaylist_parse_playlists(
42294229
MENU_SETTING_ACTION, 0, 0, NULL))
42304230
count++;
42314231

4232-
if (settings->bools.menu_content_show_history)
4232+
if (settings->bools.menu_content_show_history && g_defaults.content_history)
42334233
if (menu_entries_append(info_list,
42344234
playlist_get_conf_path(g_defaults.content_history),
42354235
MENU_ENUM_LABEL_LOAD_CONTENT_HISTORY_STR,
@@ -4239,7 +4239,7 @@ static unsigned menu_displaylist_parse_playlists(
42394239
}
42404240
else
42414241
{
4242-
if (settings->bools.menu_content_show_history)
4242+
if (settings->bools.menu_content_show_history && g_defaults.content_history)
42434243
if (menu_entries_append(info_list,
42444244
playlist_get_conf_path(g_defaults.content_history),
42454245
MENU_ENUM_LABEL_LOAD_CONTENT_HISTORY_STR,
@@ -4258,7 +4258,7 @@ static unsigned menu_displaylist_parse_playlists(
42584258
}
42594259

42604260
#ifdef HAVE_IMAGEVIEWER
4261-
if (settings->bools.menu_content_show_images)
4261+
if (settings->bools.menu_content_show_images && g_defaults.image_history)
42624262
if (menu_entries_append(info_list,
42634263
playlist_get_conf_path(g_defaults.image_history),
42644264
MENU_ENUM_LABEL_GOTO_IMAGES_STR,
@@ -4267,7 +4267,7 @@ static unsigned menu_displaylist_parse_playlists(
42674267
count++;
42684268
#endif
42694269

4270-
if (settings->bools.menu_content_show_music)
4270+
if (settings->bools.menu_content_show_music && g_defaults.music_history)
42714271
if (menu_entries_append(info_list,
42724272
playlist_get_conf_path(g_defaults.music_history),
42734273
MENU_ENUM_LABEL_GOTO_MUSIC_STR,
@@ -4276,7 +4276,7 @@ static unsigned menu_displaylist_parse_playlists(
42764276
count++;
42774277

42784278
#if defined(HAVE_FFMPEG) || defined(HAVE_MPV)
4279-
if (settings->bools.menu_content_show_video)
4279+
if (settings->bools.menu_content_show_video && g_defaults.video_history)
42804280
if (menu_entries_append(info_list,
42814281
playlist_get_conf_path(g_defaults.video_history),
42824282
MENU_ENUM_LABEL_GOTO_VIDEO_STR,
@@ -15368,7 +15368,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
1536815368
MENU_SETTING_ACTION, 0, 0, NULL))
1536915369
count++;
1537015370

15371-
if (settings->bools.menu_content_show_history)
15371+
if (settings->bools.menu_content_show_history && g_defaults.content_history)
1537215372
if (menu_entries_append(info->list,
1537315373
playlist_get_conf_path(g_defaults.content_history),
1537415374
MENU_ENUM_LABEL_LOAD_CONTENT_HISTORY_STR,
@@ -15378,7 +15378,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
1537815378
}
1537915379
else
1538015380
{
15381-
if (settings->bools.menu_content_show_history)
15381+
if (settings->bools.menu_content_show_history && g_defaults.content_history)
1538215382
if (menu_entries_append(info->list,
1538315383
playlist_get_conf_path(g_defaults.content_history),
1538415384
MENU_ENUM_LABEL_LOAD_CONTENT_HISTORY_STR,

0 commit comments

Comments
 (0)