Create file_path_str

This commit is contained in:
twinaphex 2016-06-20 05:11:01 +02:00
parent c448beafa8
commit b3188195a8
4 changed files with 26 additions and 3 deletions

View File

@ -1559,14 +1559,14 @@ static bool config_load_file(const char *path, bool set_defaults)
fill_pathname_resolve_relative( fill_pathname_resolve_relative(
settings->path.content_history, settings->path.content_history,
global->path.config, global->path.config,
"content_history.lpl", file_path_str(FILE_PATH_CONTENT_HISTORY),
sizeof(settings->path.content_history)); sizeof(settings->path.content_history));
} }
else else
{ {
fill_pathname_join(settings->path.content_history, fill_pathname_join(settings->path.content_history,
settings->directory.content_history, settings->directory.content_history,
"content_history.lpl", file_path_str(FILE_PATH_CONTENT_HISTORY),
sizeof(settings->path.content_history)); sizeof(settings->path.content_history));
} }
} }

View File

@ -425,3 +425,17 @@ void fill_pathname_application_special(char *s, size_t len, enum application_spe
break; 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";
}

View File

@ -22,6 +22,12 @@
#include <boolean.h> #include <boolean.h>
enum file_path_enum
{
FILE_PATH_UNKNOWN = 0,
FILE_PATH_CONTENT_HISTORY
};
enum application_special_type enum application_special_type
{ {
APPLICATION_SPECIAL_NONE = 0, APPLICATION_SPECIAL_NONE = 0,
@ -39,6 +45,8 @@ enum application_special_type
APPLICATION_SPECIAL_DIRECTORY_ASSETS_ZARCH_ICONS 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); 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); void fill_pathname_application_special(char *s, size_t len, enum application_special_type type);

View File

@ -30,6 +30,7 @@
#include "../database_info.h" #include "../database_info.h"
#endif #endif
#include "../file_path_special.h"
#include "../defaults.h" #include "../defaults.h"
#include "../managers/cheat_manager.h" #include "../managers/cheat_manager.h"
#include "../managers/core_option_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 #endif
break; break;
case DISPLAYLIST_PLAYLIST_COLLECTION: 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)) if (menu_displaylist_ctl(DISPLAYLIST_HISTORY, info))
return menu_displaylist_push_list_process(info); return menu_displaylist_push_list_process(info);