diff --git a/configuration.c b/configuration.c index bcb8b65bcb..32bb59c773 100644 --- a/configuration.c +++ b/configuration.c @@ -1559,14 +1559,14 @@ static bool config_load_file(const char *path, bool set_defaults) fill_pathname_resolve_relative( settings->path.content_history, global->path.config, - "content_history.lpl", + file_path_str(FILE_PATH_CONTENT_HISTORY), sizeof(settings->path.content_history)); } else { fill_pathname_join(settings->path.content_history, settings->directory.content_history, - "content_history.lpl", + file_path_str(FILE_PATH_CONTENT_HISTORY), sizeof(settings->path.content_history)); } } diff --git a/file_path_special.c b/file_path_special.c index c6902bd622..3ed04e0cb5 100644 --- a/file_path_special.c +++ b/file_path_special.c @@ -425,3 +425,17 @@ void fill_pathname_application_special(char *s, size_t len, enum application_spe break; } } + +const char *file_path_str(enum file_path_enum enum_idx) +{ + switch (enum_idx) + { + case FILE_PATH_CONTENT_HISTORY: + return "content_history.lpl"; + case FILE_PATH_UNKNOWN: + default: + break; + } + + return "null"; +} diff --git a/file_path_special.h b/file_path_special.h index 3db5fe7feb..ec0cefbac1 100644 --- a/file_path_special.h +++ b/file_path_special.h @@ -22,6 +22,12 @@ #include +enum file_path_enum +{ + FILE_PATH_UNKNOWN = 0, + FILE_PATH_CONTENT_HISTORY +}; + enum application_special_type { APPLICATION_SPECIAL_NONE = 0, @@ -39,6 +45,8 @@ enum application_special_type APPLICATION_SPECIAL_DIRECTORY_ASSETS_ZARCH_ICONS }; +const char *file_path_str(enum file_path_enum enum_idx); + bool fill_pathname_application_data(char *s, size_t len); void fill_pathname_application_special(char *s, size_t len, enum application_special_type type); diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index 12c5e9145e..f18061d755 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -30,6 +30,7 @@ #include "../database_info.h" #endif +#include "../file_path_special.h" #include "../defaults.h" #include "../managers/cheat_manager.h" #include "../managers/core_option_manager.h" @@ -4458,7 +4459,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data) #endif break; case DISPLAYLIST_PLAYLIST_COLLECTION: - if (string_is_equal(info->path, "content_history.lpl")) + if (string_is_equal(info->path, file_path_str(FILE_PATH_CONTENT_HISTORY))) { if (menu_displaylist_ctl(DISPLAYLIST_HISTORY, info)) return menu_displaylist_push_list_process(info);