(menu_displaylist) Cleanups

This commit is contained in:
libretroadmin 2023-04-29 15:25:55 +02:00
parent 31f3588f00
commit 246af45939

View File

@ -246,7 +246,9 @@ static int filebrowser_parse(
else
subsystem = runloop_st->subsystem_data + content_get_subsystem();
if (subsystem && runloop_st->subsystem_current_count > 0 && content_get_subsystem_rom_id() < subsystem->num_roms)
if ( subsystem
&& (runloop_st->subsystem_current_count > 0)
&& (content_get_subsystem_rom_id() < subsystem->num_roms))
ret = dir_list_initialize(&str_list,
path,
filter_ext ? subsystem->roms[content_get_subsystem_rom_id()].valid_extensions : NULL,
@ -317,10 +319,10 @@ static int filebrowser_parse(
if (string_is_empty(file_path))
continue;
if ((str_list.elems[i].attr.i != RARCH_DIRECTORY) &&
((filebrowser_type == FILEBROWSER_SELECT_DIR) ||
(filebrowser_type == FILEBROWSER_SCAN_DIR) ||
(filebrowser_type == FILEBROWSER_MANUAL_SCAN_DIR)))
if ( (str_list.elems[i].attr.i != RARCH_DIRECTORY)
&& ((filebrowser_type == FILEBROWSER_SELECT_DIR)
|| (filebrowser_type == FILEBROWSER_SCAN_DIR)
|| (filebrowser_type == FILEBROWSER_MANUAL_SCAN_DIR)))
continue;
if (!path_is_compressed)
@ -334,15 +336,15 @@ static int filebrowser_parse(
* if required */
if (search_terms)
{
bool skip_entry = false;
size_t j;
bool skip_entry = false;
for (j = 0; j < search_terms->size; j++)
{
const char *search_term = search_terms->terms[j];
if (!string_is_empty(search_term) &&
!strcasestr(file_path, search_term))
if ( !string_is_empty(search_term)
&& !strcasestr(file_path, search_term))
{
skip_entry = true;
break;
@ -414,7 +416,7 @@ static int filebrowser_parse(
case RARCH_CONTENT_IMAGE:
#ifdef HAVE_IMAGEVIEWER
if ( builtin_imageviewer_enable
&& type != DISPLAYLIST_IMAGES)
&& (type != DISPLAYLIST_IMAGES))
file_type = FILE_TYPE_IMAGEVIEWER;
else
file_type = FILE_TYPE_IMAGE;
@ -776,15 +778,15 @@ static int menu_displaylist_parse_core_info(
}
end:
if (!kiosk_mode_enable)
{
#if defined(HAVE_DYNAMIC)
/* Exclude core from contentless cores menu */
if ((contentless_display_type ==
MENU_CONTENTLESS_CORES_DISPLAY_CUSTOM) &&
core_info &&
core_info->supports_no_game &&
!string_is_empty(core_path) &&
!kiosk_mode_enable)
MENU_CONTENTLESS_CORES_DISPLAY_CUSTOM)
&& core_info
&& core_info->supports_no_game
&& !string_is_empty(core_path))
{
/* Note: Have to set core_path as both the
* 'path' and 'label' parameters (otherwise
@ -803,7 +805,7 @@ end:
}
#endif
if (!string_is_empty(core_path) && !kiosk_mode_enable)
if (!string_is_empty(core_path))
{
/* Check whether core is currently locked */
bool core_locked = core_info_get_core_lock(core_path, true);
@ -872,6 +874,7 @@ end:
count++;
#endif
}
}
return count;
}
@ -914,8 +917,9 @@ static unsigned menu_displaylist_parse_core_backup_list(
const core_backup_list_entry_t *entry = NULL;
/* Ensure entry is valid */
if (core_backup_list_get_index(backup_list, i, &entry) &&
entry && !string_is_empty(entry->backup_path))
if ( core_backup_list_get_index(backup_list, i, &entry)
&& entry
&& !string_is_empty(entry->backup_path))
{
char timestamp[128];
char crc[16];
@ -1006,10 +1010,9 @@ static unsigned menu_displaylist_parse_core_manager_list(file_list_t *list,
for (j = 0; j < search_terms->size; j++)
{
const char *search_term = search_terms->terms[j];
if (!string_is_empty(search_term) &&
!string_is_empty(core_info->display_name) &&
!strcasestr(core_info->display_name, search_term))
if ( !string_is_empty(search_term)
&& !string_is_empty(core_info->display_name)
&& !strcasestr(core_info->display_name, search_term))
{
entry_valid = false;
break;
@ -1236,8 +1239,8 @@ static unsigned menu_displaylist_parse_core_option_override_list(file_list_t *li
unsigned count = 0;
runloop_state_t *runloop_st = runloop_state_get_ptr();
uint32_t flags = runloop_get_flags();
bool core_has_options = !retroarch_ctl(RARCH_CTL_IS_DUMMY_CORE, NULL) &&
(runloop_st->core_options);
bool core_has_options = !retroarch_ctl(RARCH_CTL_IS_DUMMY_CORE, NULL)
&& (runloop_st->core_options);
bool game_options_active = flags & RUNLOOP_FLAG_GAME_OPTIONS_ACTIVE;
bool folder_options_active = flags & RUNLOOP_FLAG_FOLDER_OPTIONS_ACTIVE;
bool show_core_options_flush = settings ?
@ -1269,14 +1272,6 @@ static unsigned menu_displaylist_parse_core_option_override_list(file_list_t *li
MENU_ENUM_LABEL_GAME_SPECIFIC_CORE_OPTIONS_CREATE,
MENU_SETTING_ACTION_GAME_SPECIFIC_CORE_OPTIONS_CREATE, 0, 0, NULL))
count++;
if (!folder_options_active)
if (menu_entries_append(list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_FOLDER_SPECIFIC_CORE_OPTIONS_CREATE),
msg_hash_to_str(MENU_ENUM_LABEL_FOLDER_SPECIFIC_CORE_OPTIONS_CREATE),
MENU_ENUM_LABEL_FOLDER_SPECIFIC_CORE_OPTIONS_CREATE,
MENU_SETTING_ACTION_FOLDER_SPECIFIC_CORE_OPTIONS_CREATE, 0, 0, NULL))
count++;
}
else
{
@ -1290,12 +1285,25 @@ static unsigned menu_displaylist_parse_core_option_override_list(file_list_t *li
}
if (folder_options_active)
{
if (menu_entries_append(list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_FOLDER_SPECIFIC_CORE_OPTIONS_REMOVE),
msg_hash_to_str(MENU_ENUM_LABEL_FOLDER_SPECIFIC_CORE_OPTIONS_REMOVE),
MENU_ENUM_LABEL_FOLDER_SPECIFIC_CORE_OPTIONS_REMOVE,
MENU_SETTING_ACTION_FOLDER_SPECIFIC_CORE_OPTIONS_REMOVE, 0, 0, NULL))
count++;
}
else
{
if (!game_options_active)
if (menu_entries_append(list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_FOLDER_SPECIFIC_CORE_OPTIONS_CREATE),
msg_hash_to_str(MENU_ENUM_LABEL_FOLDER_SPECIFIC_CORE_OPTIONS_CREATE),
MENU_ENUM_LABEL_FOLDER_SPECIFIC_CORE_OPTIONS_CREATE,
MENU_SETTING_ACTION_FOLDER_SPECIFIC_CORE_OPTIONS_CREATE, 0, 0, NULL))
count++;
}
end:
if (core_has_options)
{
@ -1364,17 +1372,18 @@ static unsigned menu_displaylist_parse_remap_file_manager_list(file_list_t *list
MENU_ENUM_LABEL_REMAP_FILE_SAVE_GAME,
MENU_SETTING_ACTION_REMAP_FILE_SAVE_GAME, 0, 0, NULL))
count++;
if (!content_dir_remap_active &&
}
if (!content_dir_remap_active)
{
if (has_content &&
menu_entries_append(list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_REMAP_FILE_SAVE_CONTENT_DIR),
msg_hash_to_str(MENU_ENUM_LABEL_REMAP_FILE_SAVE_CONTENT_DIR),
MENU_ENUM_LABEL_REMAP_FILE_SAVE_CONTENT_DIR,
MENU_SETTING_ACTION_REMAP_FILE_SAVE_CONTENT_DIR, 0, 0, NULL))
count++;
}
if (
!content_dir_remap_active &&
!core_remap_active &&
menu_entries_append(list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_REMAP_FILE_SAVE_CORE),
@ -1383,6 +1392,7 @@ static unsigned menu_displaylist_parse_remap_file_manager_list(file_list_t *list
MENU_SETTING_ACTION_REMAP_FILE_SAVE_CORE, 0, 0, NULL))
count++;
}
}
/* Remove remap files */
if (has_content)
@ -1421,10 +1431,10 @@ static unsigned menu_displaylist_parse_remap_file_manager_list(file_list_t *list
count++;
/* Flush input remaps to disk */
if (!remap_save_on_exit &&
(core_remap_active ||
content_dir_remap_active ||
game_remap_active) &&
if ( !remap_save_on_exit
&& (core_remap_active
|| content_dir_remap_active
|| game_remap_active) &&
menu_entries_append(list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_REMAP_FILE_FLUSH),
msg_hash_to_str(MENU_ENUM_LABEL_REMAP_FILE_FLUSH),
@ -1447,8 +1457,8 @@ static unsigned menu_displaylist_parse_supported_cores(menu_displaylist_info_t *
#if defined(HAVE_DYNAMIC)
bool enable_load_with_current = !string_is_empty(core_path_current);
#else
bool enable_load_with_current = !string_is_empty(core_path_current) &&
!settings->bools.always_reload_core_on_run_content;
bool enable_load_with_current = !string_is_empty(core_path_current)
&& !settings->bools.always_reload_core_on_run_content;
#endif
/* Get core list */
@ -2172,10 +2182,11 @@ static int menu_displaylist_parse_playlist(file_list_t *info_list,
return 0;
/* Check whether core name should be added to playlist entries */
if (!string_is_equal(menu_driver, "ozone") &&
!pl_show_sublabels &&
((pl_show_inline_core_name == PLAYLIST_INLINE_CORE_DISPLAY_ALWAYS) ||
(!is_collection && !(pl_show_inline_core_name == PLAYLIST_INLINE_CORE_DISPLAY_NEVER))))
if ( !string_is_equal(menu_driver, "ozone")
&& !pl_show_sublabels
&& ((pl_show_inline_core_name == PLAYLIST_INLINE_CORE_DISPLAY_ALWAYS)
|| (!is_collection
&& !(pl_show_inline_core_name == PLAYLIST_INLINE_CORE_DISPLAY_NEVER))))
{
show_inline_core_name = true;
@ -2200,9 +2211,9 @@ static int menu_displaylist_parse_playlist(file_list_t *info_list,
* 'download thumbnails' option, we must also extend
* this to music_history and video_history */
if (
string_is_equal(path_playlist, "history") ||
string_is_equal(path_playlist, "favorites") ||
string_ends_with_size(path_playlist, "_history",
string_is_equal(path_playlist, "history")
|| string_is_equal(path_playlist, "favorites")
|| string_ends_with_size(path_playlist, "_history",
strlen(path_playlist), STRLEN_CONST("_history")))
{
char system_name[15];
@ -2264,8 +2275,7 @@ static int menu_displaylist_parse_playlist(file_list_t *info_list,
if (string_is_empty(entry->label))
fill_pathname(menu_entry_label,
path_basename(entry->path),
"", sizeof(menu_entry_label));
path_basename(entry->path), "", sizeof(menu_entry_label));
else
strlcpy(menu_entry_label, entry->label, sizeof(menu_entry_label));
@ -2275,8 +2285,10 @@ static int menu_displaylist_parse_playlist(file_list_t *info_list,
if (show_inline_core_name)
{
/* Both core name and core path must be valid */
if (!string_is_empty(entry->core_name) && !string_is_equal(entry->core_name, "DETECT") &&
!string_is_empty(entry->core_path) && !string_is_equal(entry->core_path, "DETECT"))
if ( !string_is_empty(entry->core_name)
&& !string_is_equal(entry->core_name, "DETECT")
&& !string_is_empty(entry->core_path)
&& !string_is_equal(entry->core_path, "DETECT"))
{
strlcat(menu_entry_label, label_spacer, sizeof(menu_entry_label));
strlcat(menu_entry_label, entry->core_name, sizeof(menu_entry_label));
@ -2311,8 +2323,8 @@ static int menu_displaylist_parse_playlist(file_list_t *info_list,
{
const char *search_term = search_terms->terms[j];
if (!string_is_empty(search_term) &&
!strcasestr(menu_entry_label, search_term))
if ( !string_is_empty(search_term)
&& !strcasestr(menu_entry_label, search_term))
{
entry_valid = false;
break;
@ -2467,13 +2479,16 @@ static int menu_displaylist_parse_database_entry(menu_handle_t *menu,
playlist_config.old_format = settings->bools.playlist_use_old_format;
playlist_config.compress = settings->bools.playlist_compression;
playlist_config.fuzzy_archive_match = settings->bools.playlist_fuzzy_archive_match;
playlist_config_set_base_content_directory(&playlist_config, settings->bools.playlist_portable_paths ? settings->paths.directory_menu_content : NULL);
playlist_config_set_base_content_directory(&playlist_config,
settings->bools.playlist_portable_paths
? settings->paths.directory_menu_content
: NULL);
database_info_build_query_enum(query, sizeof(query),
DATABASE_QUERY_ENTRY, info->path_b);
if (!(db_info = database_info_list_new(info->path, query)))
goto error;
return -1;
fill_pathname(path_base, path_basename(info->path), "",
sizeof(path_base));
@ -3190,8 +3205,8 @@ int menu_displaylist_parse_settings_enum(
else
{
if (
(entry_type >= MENU_SETTINGS_INPUT_BEGIN) &&
(entry_type < MENU_SETTINGS_INPUT_END)
(entry_type >= MENU_SETTINGS_INPUT_BEGIN)
&& (entry_type < MENU_SETTINGS_INPUT_END)
)
entry_type = (unsigned)(MENU_SETTINGS_INPUT_BEGIN + count);
if (entry_type == 0)
@ -3277,8 +3292,8 @@ static void menu_displaylist_set_new_playlist(
strlen(playlist_file_name), STRLEN_CONST("_history.lpl")))
playlist_config.capacity = content_history_size;
else if (string_is_equal(playlist_file_name,
FILE_PATH_CONTENT_FAVORITES) &&
(content_favorites_size >= 0))
FILE_PATH_CONTENT_FAVORITES)
&& (content_favorites_size >= 0))
playlist_config.capacity = (unsigned)content_favorites_size;
}
@ -3288,9 +3303,9 @@ static void menu_displaylist_set_new_playlist(
enum playlist_sort_mode current_sort_mode = playlist_get_sort_mode(playlist);
/* Sort playlist, if required */
if (sort_enabled &&
((playlist_sort_alphabetical && (current_sort_mode == PLAYLIST_SORT_MODE_DEFAULT)) ||
(current_sort_mode == PLAYLIST_SORT_MODE_ALPHABETICAL)))
if ( sort_enabled
&& ((playlist_sort_alphabetical && (current_sort_mode == PLAYLIST_SORT_MODE_DEFAULT))
|| (current_sort_mode == PLAYLIST_SORT_MODE_ALPHABETICAL)))
playlist_qsort(playlist);
strlcpy(menu->db_playlist_file, path, sizeof(menu->db_playlist_file));
@ -3420,8 +3435,9 @@ static int menu_displaylist_parse_load_content_settings(
}
else
{
if (savestates_enabled &&
settings->bools.quick_menu_show_save_load_state)
if (savestates_enabled)
{
if (settings->bools.quick_menu_show_save_load_state)
{
if (MENU_DISPLAYLIST_PARSE_SETTINGS_ENUM(list,
MENU_ENUM_LABEL_STATE_SLOT, PARSE_ONLY_INT, true) == 0)
@ -3440,11 +3456,8 @@ static int menu_displaylist_parse_load_content_settings(
MENU_ENUM_LABEL_LOAD_STATE,
MENU_SETTING_ACTION_LOADSTATE, 0, 0, NULL))
count++;
}
if (savestates_enabled &&
settings->bools.quick_menu_show_save_load_state &&
settings->bools.quick_menu_show_undo_save_load_state)
if (settings->bools.quick_menu_show_undo_save_load_state)
{
#ifdef HAVE_CHEEVOS
if (!rcheevos_hardcore_active())
@ -3465,9 +3478,10 @@ static int menu_displaylist_parse_load_content_settings(
MENU_SETTING_ACTION_LOADSTATE, 0, 0, NULL))
count++;
}
}
#ifdef HAVE_BSV_MOVIE
if (savestates_enabled &&
settings->bools.quick_menu_show_replay)
if (settings->bools.quick_menu_show_replay)
{
if (MENU_DISPLAYLIST_PARSE_SETTINGS_ENUM(list,
MENU_ENUM_LABEL_REPLAY_SLOT, PARSE_ONLY_INT, true) == 0)
@ -3496,7 +3510,11 @@ static int menu_displaylist_parse_load_content_settings(
}
#endif
}
if (settings->bools.quick_menu_show_options && !settings->bools.kiosk_mode_enable)
}
if (!settings->bools.kiosk_mode_enable)
{
if (settings->bools.quick_menu_show_options)
{
/* Empty 'path' string signifies top level
* core options menu */
@ -3508,7 +3526,7 @@ static int menu_displaylist_parse_load_content_settings(
count++;
}
if (settings->bools.quick_menu_show_controls && !settings->bools.kiosk_mode_enable)
if (settings->bools.quick_menu_show_controls)
{
if (menu_entries_append(list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CORE_INPUT_REMAPPING_OPTIONS),
@ -3517,6 +3535,7 @@ static int menu_displaylist_parse_load_content_settings(
MENU_SETTING_ACTION, 0, 0, NULL))
count++;
}
}
if ((!retroarch_ctl(RARCH_CTL_IS_DUMMY_CORE, NULL))
&& disk_control_enabled(&system->disk_control))
@ -3544,7 +3563,9 @@ static int menu_displaylist_parse_load_content_settings(
recording_state_t *recording_st = recording_state_get_ptr();
if (!recording_st->enable)
{
if (settings->bools.quick_menu_show_start_recording && !settings->bools.kiosk_mode_enable)
if (!settings->bools.kiosk_mode_enable)
{
if (settings->bools.quick_menu_show_start_recording)
{
if (menu_entries_append(list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QUICK_MENU_START_RECORDING),
@ -3553,7 +3574,7 @@ static int menu_displaylist_parse_load_content_settings(
count++;
}
if (settings->bools.quick_menu_show_start_streaming && !settings->bools.kiosk_mode_enable)
if (settings->bools.quick_menu_show_start_streaming)
{
if (menu_entries_append(list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QUICK_MENU_START_STREAMING),
@ -3562,6 +3583,7 @@ static int menu_displaylist_parse_load_content_settings(
count++;
}
}
}
else
{
recording_state_t *recording_st = recording_state_get_ptr();
@ -3585,8 +3607,8 @@ static int menu_displaylist_parse_load_content_settings(
}
if (
settings->bools.quick_menu_show_add_to_favorites &&
settings->bools.menu_content_show_favorites
settings->bools.quick_menu_show_add_to_favorites
&& settings->bools.menu_content_show_favorites
)
{
bool add_to_favorites_enabled = true;
@ -3602,20 +3624,22 @@ static int menu_displaylist_parse_load_content_settings(
if (!string_is_empty(playlist_path))
playlist_file = path_basename_nocompression(playlist_path);
if (!string_is_empty(playlist_file) &&
string_is_equal(playlist_file, FILE_PATH_CONTENT_FAVORITES))
if ( !string_is_empty(playlist_file)
&& string_is_equal(playlist_file, FILE_PATH_CONTENT_FAVORITES))
add_to_favorites_enabled = false;
}
if (add_to_favorites_enabled &&
menu_entries_append(list,
if ( add_to_favorites_enabled
&& menu_entries_append(list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ADD_TO_FAVORITES),
msg_hash_to_str(MENU_ENUM_LABEL_ADD_TO_FAVORITES),
MENU_ENUM_LABEL_ADD_TO_FAVORITES, FILE_TYPE_PLAYLIST_ENTRY, 0, 0, NULL))
count++;
}
if (settings->bools.menu_show_overlays && !settings->bools.kiosk_mode_enable)
if (!settings->bools.kiosk_mode_enable)
{
if (settings->bools.menu_show_overlays)
{
if (menu_entries_append(list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ONSCREEN_OVERLAY_SETTINGS),
@ -3625,7 +3649,7 @@ static int menu_displaylist_parse_load_content_settings(
count++;
}
if (settings->bools.menu_show_latency && !settings->bools.kiosk_mode_enable)
if (settings->bools.menu_show_latency)
{
if (menu_entries_append(list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_LATENCY_SETTINGS),
@ -3636,9 +3660,8 @@ static int menu_displaylist_parse_load_content_settings(
}
#ifdef HAVE_REWIND
if (settings->bools.menu_show_rewind &&
!settings->bools.kiosk_mode_enable &&
core_info_current_supports_rewind())
if ( settings->bools.menu_show_rewind
&& core_info_current_supports_rewind())
{
if (menu_entries_append(list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_REWIND_SETTINGS),
@ -3649,9 +3672,8 @@ static int menu_displaylist_parse_load_content_settings(
}
#endif
if ((settings->bools.quick_menu_show_save_core_overrides ||
settings->bools.quick_menu_show_save_game_overrides) &&
!settings->bools.kiosk_mode_enable)
if ( (settings->bools.quick_menu_show_save_core_overrides
|| settings->bools.quick_menu_show_save_game_overrides))
{
if (menu_entries_append(list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QUICK_MENU_OVERRIDE_OPTIONS),
@ -3660,6 +3682,7 @@ static int menu_displaylist_parse_load_content_settings(
MENU_SETTING_ACTION, 0, 0, NULL))
count++;
}
}
#ifdef HAVE_CHEEVOS
if (settings->bools.cheevos_enable)
@ -3758,8 +3781,8 @@ static int menu_displaylist_parse_horizontal_content_actions(
if (entry && !string_is_empty(entry->path))
ext = path_get_extension(entry->path);
if (!string_is_empty(ext) &&
audio_driver_mixer_extension_supported(ext))
if ( !string_is_empty(ext)
&& audio_driver_mixer_extension_supported(ext))
{
menu_entries_append(list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ADD_TO_MIXER),
@ -3783,18 +3806,17 @@ static int menu_displaylist_parse_horizontal_content_actions(
msg_hash_to_str(MENU_ENUM_LABEL_RUN),
MENU_ENUM_LABEL_RUN, FILE_TYPE_PLAYLIST_ENTRY, 0, idx, NULL);
if (settings->bools.playlist_entry_rename &&
!settings->bools.kiosk_mode_enable)
if (!settings->bools.kiosk_mode_enable)
{
bool remove_entry_enabled = false;
if (settings->bools.playlist_entry_rename)
menu_entries_append(list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_RENAME_ENTRY),
msg_hash_to_str(MENU_ENUM_LABEL_RENAME_ENTRY),
MENU_ENUM_LABEL_RENAME_ENTRY,
FILE_TYPE_PLAYLIST_ENTRY, 0, idx, NULL);
if (!settings->bools.kiosk_mode_enable)
{
bool remove_entry_enabled = false;
switch (settings->uints.playlist_entry_remove_enable)
{
case PLAYLIST_ENTRY_REMOVE_ENABLE_ALL:
@ -3809,9 +3831,9 @@ static int menu_displaylist_parse_horizontal_content_actions(
if (!string_is_empty(system))
remove_entry_enabled =
string_is_equal(system, "history") ||
string_is_equal(system, "favorites") ||
string_ends_with_size(system, "_history",
string_is_equal(system, "history")
|| string_is_equal(system, "favorites")
|| string_ends_with_size(system, "_history",
strlen(system), STRLEN_CONST("_history"));
/* An annoyance: if the user navigates to the information menu,
@ -3819,9 +3841,9 @@ static int menu_displaylist_parse_horizontal_content_actions(
* This breaks the above 'remove_entry_enabled' check for the
* history and favorites playlists. We therefore have to check
* the playlist file name as well... */
if (!remove_entry_enabled &&
settings->bools.quick_menu_show_information &&
!string_is_empty(playlist_file))
if ( !remove_entry_enabled
&& settings->bools.quick_menu_show_information
&& !string_is_empty(playlist_file))
remove_entry_enabled = string_is_equal(playlist_file, FILE_PATH_CONTENT_HISTORY) ||
string_is_equal(playlist_file, FILE_PATH_CONTENT_FAVORITES);
}
@ -3839,10 +3861,10 @@ static int menu_displaylist_parse_horizontal_content_actions(
/* Skip 'Add to Favourites' if we are currently
* viewing an entry of the favourites playlist */
if (
settings->bools.quick_menu_show_add_to_favorites &&
settings->bools.menu_content_show_favorites &&
!(!string_is_empty(playlist_file) &&
string_is_equal(playlist_file, FILE_PATH_CONTENT_FAVORITES))
settings->bools.quick_menu_show_add_to_favorites
&& settings->bools.menu_content_show_favorites
&& !(!string_is_empty(playlist_file)
&& string_is_equal(playlist_file, FILE_PATH_CONTENT_FAVORITES))
)
{
menu_entries_append(list,
@ -3851,18 +3873,16 @@ static int menu_displaylist_parse_horizontal_content_actions(
MENU_ENUM_LABEL_ADD_TO_FAVORITES_PLAYLIST, FILE_TYPE_PLAYLIST_ENTRY, 0, 0, NULL);
}
if ( settings->bools.quick_menu_show_set_core_association &&
!settings->bools.kiosk_mode_enable)
if (!settings->bools.kiosk_mode_enable)
{
if (settings->bools.quick_menu_show_set_core_association)
{
menu_entries_append(list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SET_CORE_ASSOCIATION),
msg_hash_to_str(MENU_ENUM_LABEL_SET_CORE_ASSOCIATION),
MENU_ENUM_LABEL_SET_CORE_ASSOCIATION, FILE_TYPE_PLAYLIST_ENTRY, 0, 0, NULL);
}
if (
settings->bools.quick_menu_show_reset_core_association &&
!settings->bools.kiosk_mode_enable)
if (settings->bools.quick_menu_show_reset_core_association)
{
menu_entries_append(list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_RESET_CORE_ASSOCIATION),
@ -3871,34 +3891,17 @@ static int menu_displaylist_parse_horizontal_content_actions(
}
#ifdef HAVE_NETWORKING
if (
settings->bools.quick_menu_show_download_thumbnails &&
!settings->bools.kiosk_mode_enable)
if (settings->bools.quick_menu_show_download_thumbnails)
{
bool download_enabled = true;
/* Disabled because this won't be shown when content is loaded */
#if 0
/* If content is currently running, have to make sure
* we have a valid playlist to work with */
if (content_loaded)
{
const char *core_path = path_get(RARCH_PATH_CORE);
download_enabled = false;
if (!string_is_empty(fullpath) && !string_is_empty(core_path))
download_enabled = playlist_index_is_valid(
playlist, idx, fullpath, core_path);
}
#endif
if (download_enabled)
{
char system[PATH_MAX_LENGTH];
system[0] = '\0';
/* Only show 'download thumbnails' on supported playlists */
/* Only show 'Download Thumbnails' on supported playlists */
download_enabled = false;
menu_driver_get_thumbnail_system(system, sizeof(system));
@ -3917,6 +3920,7 @@ static int menu_displaylist_parse_horizontal_content_actions(
MENU_ENUM_LABEL_DOWNLOAD_PL_ENTRY_THUMBNAILS, FILE_TYPE_PLAYLIST_ENTRY, 0, 0, NULL);
}
#endif
}
if (settings->bools.quick_menu_show_information)
menu_entries_append(list,
@ -3941,7 +3945,8 @@ static unsigned menu_displaylist_parse_information_list(file_list_t *info_list)
&& !string_is_equal(system->library_name,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_CORE))
)
&& core_info && core_info->has_info
&& core_info
&& core_info->has_info
)
if (menu_entries_append(info_list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CORE_INFORMATION),
@ -4746,9 +4751,9 @@ static unsigned menu_displaylist_parse_content_information(
/* Only display core name if both core name and
* core path are valid */
if (!string_is_empty(entry->core_name) &&
!string_is_empty(core_path) &&
!string_is_equal(core_path, "DETECT"))
if ( !string_is_empty(entry->core_name)
&& !string_is_empty(core_path)
&& !string_is_equal(core_path, "DETECT"))
strlcpy(core_name, entry->core_name, sizeof(core_name));
}
}
@ -4775,7 +4780,8 @@ static unsigned menu_displaylist_parse_content_information(
#ifdef HAVE_LIBRETRODB
/* Database entry */
if (!string_is_empty(content_label) && !string_is_empty(db_name))
if ( !string_is_empty(content_label)
&& !string_is_empty(db_name))
{
char db_path[PATH_MAX_LENGTH];
@ -4826,7 +4832,8 @@ static unsigned menu_displaylist_parse_content_information(
/* If content path is empty and core supports
* contentless operation, skip label/path entries */
if (!(core_supports_no_game && string_is_empty(content_path)))
if ( !(core_supports_no_game
&& string_is_empty(content_path)))
{
size_t _len;
@ -4866,8 +4873,8 @@ static unsigned menu_displaylist_parse_content_information(
}
/* Core name */
if (!string_is_empty(core_name) &&
!string_is_equal(core_name, "DETECT"))
if ( !string_is_empty(core_name)
&& !string_is_equal(core_name, "DETECT"))
{
size_t _len = strlcpy(tmp,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CONTENT_INFO_CORE_NAME),
@ -4931,8 +4938,9 @@ static unsigned menu_displaylist_parse_content_information(
#ifdef HAVE_CHEEVOS
/* RetroAchievements Hash */
if (settings->bools.cheevos_enable && settings->arrays.cheevos_token[0] &&
!string_is_empty(loaded_content_path))
if ( settings->bools.cheevos_enable
&& settings->arrays.cheevos_token[0]
&& !string_is_empty(loaded_content_path))
{
const char *cheevos_hash_str =
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CONTENT_INFO_CHEEVOS_HASH);
@ -5672,7 +5680,8 @@ bool menu_displaylist_process(menu_displaylist_info_t *info)
file_list_sort_on_alt(info_list);
#ifdef HAVE_NETWORKING
if (settings->bools.menu_show_core_updater && !settings->bools.kiosk_mode_enable)
if ( settings->bools.menu_show_core_updater
&& !settings->bools.kiosk_mode_enable)
{
if (info_flags & MD_FLAG_DOWNLOAD_CORE)
{
@ -6170,9 +6179,9 @@ static unsigned menu_displaylist_netplay_refresh_rooms(file_list_t *list)
MENU_SETTING_ACTION, 0, 0, NULL))
count++;
if (netplay_driver_ctl(RARCH_NETPLAY_CTL_IS_ENABLED, NULL) &&
!netplay_driver_ctl(RARCH_NETPLAY_CTL_IS_SERVER, NULL) &&
netplay_driver_ctl(RARCH_NETPLAY_CTL_IS_CONNECTED, NULL))
if ( netplay_driver_ctl(RARCH_NETPLAY_CTL_IS_ENABLED, NULL)
&& !netplay_driver_ctl(RARCH_NETPLAY_CTL_IS_SERVER, NULL)
&& netplay_driver_ctl(RARCH_NETPLAY_CTL_IS_CONNECTED, NULL))
{
if (menu_entries_append(list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NETPLAY_DISCONNECT),
@ -6388,9 +6397,11 @@ unsigned menu_displaylist_build_list(
MENU_SETTING_ACTION, 0, 0, NULL))
count++;
if ( has_content
&& settings->bools.quick_menu_show_save_game_overrides
&& !settings->bools.kiosk_mode_enable)
if (!settings->bools.kiosk_mode_enable)
{
if (has_content)
{
if (settings->bools.quick_menu_show_save_game_overrides)
{
if (menu_entries_append(list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SAVE_CURRENT_CONFIG_OVERRIDE_GAME),
@ -6410,9 +6421,7 @@ unsigned menu_displaylist_build_list(
}
}
if ( has_content
&& settings->bools.quick_menu_show_save_content_dir_overrides
&& !settings->bools.kiosk_mode_enable)
if (settings->bools.quick_menu_show_save_content_dir_overrides)
{
if (menu_entries_append(list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SAVE_CURRENT_CONFIG_OVERRIDE_CONTENT_DIR),
@ -6431,9 +6440,9 @@ unsigned menu_displaylist_build_list(
count++;
}
}
}
if ( settings->bools.quick_menu_show_save_core_overrides
&& !settings->bools.kiosk_mode_enable)
if (settings->bools.quick_menu_show_save_core_overrides)
{
if (menu_entries_append(list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SAVE_CURRENT_CONFIG_OVERRIDE_CORE),
@ -6452,6 +6461,7 @@ unsigned menu_displaylist_build_list(
count++;
}
}
}
/* Unload overrides */
if (menu_entries_append(list,
@ -7748,9 +7758,9 @@ unsigned menu_displaylist_build_list(
/* If a search is active and no results are
* found, show a 'no entries available' item */
if (search_active &&
(num_cheats_shown < 1) &&
menu_entries_append(list,
if ( search_active
&& (num_cheats_shown < 1)
&& menu_entries_append(list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_ENTRIES_TO_DISPLAY),
msg_hash_to_str(MENU_ENUM_LABEL_NO_ENTRIES_TO_DISPLAY),
MENU_ENUM_LABEL_NO_ENTRIES_TO_DISPLAY,
@ -8790,8 +8800,8 @@ unsigned menu_displaylist_build_list(
build_list[i].checked = true;
break;
case MENU_ENUM_LABEL_MENU_SCREENSAVER_ANIMATION_SPEED:
if (menu_screensaver_supported &&
(menu_screensaver_animation != MENU_SCREENSAVER_BLANK))
if ( menu_screensaver_supported
&& (menu_screensaver_animation != MENU_SCREENSAVER_BLANK))
build_list[i].checked = true;
break;
#endif
@ -12047,8 +12057,8 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
{
if (str_list->size > 1)
{
if (!string_is_empty(str_list->elems[0].data) &&
!string_is_empty(str_list->elems[1].data))
if ( !string_is_empty(str_list->elems[0].data)
&& !string_is_empty(str_list->elems[1].data))
{
info->path_b = strdup(str_list->elems[1].data);
info->label = strdup(str_list->elems[0].data);
@ -12383,9 +12393,9 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
* > Note: We always show cores that are already
* installed, regardless of status (a user should
* always have the option to update existing cores) */
if (!show_experimental_cores &&
(entry->is_experimental &&
!path_is_valid(entry->local_core_path)))
if ( !show_experimental_cores
&& (entry->is_experimental
&& !path_is_valid(entry->local_core_path)))
continue;
/* If a search is active, skip non-matching
@ -12399,9 +12409,9 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
{
const char *search_term = search_terms->terms[j];
if (!string_is_empty(search_term) &&
!string_is_empty(entry->display_name) &&
!strcasestr(entry->display_name, search_term))
if ( !string_is_empty(search_term)
&& !string_is_empty(entry->display_name)
&& !strcasestr(entry->display_name, search_term))
{
entry_valid = false;
break;
@ -12897,8 +12907,8 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list);
if (savestates_enabled &&
settings->bools.quick_menu_show_save_load_state)
if ( savestates_enabled
&& settings->bools.quick_menu_show_save_load_state)
{
if (MENU_DISPLAYLIST_PARSE_SETTINGS_ENUM(info->list,
MENU_ENUM_LABEL_STATE_SLOT, PARSE_ONLY_INT, true) == 0)
@ -12919,9 +12929,9 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
count++;
}
if (savestates_enabled &&
settings->bools.quick_menu_show_save_load_state &&
settings->bools.quick_menu_show_undo_save_load_state)
if ( savestates_enabled
&& settings->bools.quick_menu_show_save_load_state
&& settings->bools.quick_menu_show_undo_save_load_state)
{
#ifdef HAVE_CHEEVOS
if (!rcheevos_hardcore_active())
@ -12943,8 +12953,8 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
count++;
}
#ifdef HAVE_BSV_MOVIE
if (savestates_enabled &&
settings->bools.quick_menu_show_replay)
if ( savestates_enabled
&& settings->bools.quick_menu_show_replay)
{
if (MENU_DISPLAYLIST_PARSE_SETTINGS_ENUM(info->list,
MENU_ENUM_LABEL_REPLAY_SLOT, PARSE_ONLY_INT, true) == 0)
@ -13068,8 +13078,8 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
* deep. If we supported arbitrary nesting, would
* have to use nested_list_item_get_address() here */
if (category_visible &&
!string_is_empty(category_id))
if ( category_visible
&& !string_is_empty(category_id))
{
if (menu_entries_append(info->list,
category_id,
@ -13887,9 +13897,9 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
#endif
#if defined(HAVE_RGUI) || defined(HAVE_MATERIALUI)
if ((string_is_equal(menu_ident, "rgui") ||
string_is_equal(menu_ident, "glui")) &&
settings->bools.menu_content_show_playlists)
if (( string_is_equal(menu_ident, "rgui")
|| string_is_equal(menu_ident, "glui"))
&& settings->bools.menu_content_show_playlists)
if (menu_entries_append(info->list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_PLAYLISTS_TAB),
msg_hash_to_str(MENU_ENUM_LABEL_PLAYLISTS_TAB),
@ -14788,8 +14798,8 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
MENU_SETTING_DROPDOWN_SETTING_STRING_OPTIONS_ITEM_SPECIAL, i, 0, NULL))
count++;
if (!checked_found &&
string_is_equal(tmp_str_list.elems[i].data,
if ( !checked_found
&& string_is_equal(tmp_str_list.elems[i].data,
setting->value.target.string))
{
checked = i;