Replace more hardcoded strings

This commit is contained in:
twinaphex 2020-08-22 13:04:52 +02:00
parent 07ebd50153
commit cce19ac97d
2 changed files with 17 additions and 15 deletions

View File

@ -4083,7 +4083,8 @@ static int generic_action_ok_network(const char *path,
fill_pathname_join(url_path,
network_buildbot_assets_url,
"cores/.index-dirs", sizeof(url_path));
"cores/" FILE_PATH_INDEX_DIRS_URL,
sizeof(url_path));
url_label = msg_hash_to_str(enum_idx);
type_id2 = ACTION_OK_DL_CORE_CONTENT_DIRS_LIST;
callback = cb_net_generic;
@ -4091,7 +4092,7 @@ static int generic_action_ok_network(const char *path,
break;
case MENU_ENUM_LABEL_CB_CORE_CONTENT_LIST:
fill_pathname_join(url_path, path,
".index", sizeof(url_path));
FILE_PATH_INDEX_URL, sizeof(url_path));
url_label = msg_hash_to_str(enum_idx);
type_id2 = ACTION_OK_DL_CORE_CONTENT_LIST;
callback = cb_net_generic;
@ -4099,8 +4100,8 @@ static int generic_action_ok_network(const char *path,
break;
case MENU_ENUM_LABEL_CB_THUMBNAILS_UPDATER_LIST:
fill_pathname_join(url_path,
"http://thumbnailpacks.libretro.com",
".index", sizeof(url_path));
FILE_PATH_CORE_THUMBNAILPACKS_URL,
FILE_PATH_INDEX_URL, sizeof(url_path));
url_label = msg_hash_to_str(enum_idx);
type_id2 = ACTION_OK_DL_THUMBNAILS_UPDATER_LIST;
callback = cb_net_generic;
@ -4112,7 +4113,7 @@ static int generic_action_ok_network(const char *path,
FILE_PATH_LAKKA_URL,
lakka_get_project(), sizeof(url_path));
fill_pathname_join(url_path, url_path,
".index",
FILE_PATH_INDEX_URL,
sizeof(url_path));
url_label = msg_hash_to_str(enum_idx);
type_id2 = ACTION_OK_DL_LAKKA_LIST;

View File

@ -33,6 +33,7 @@
#include "menu_networking.h"
#include "menu_entries.h"
#include "../file_path_special.h"
#include "../msg_hash.h"
#include "../tasks/task_file_transfer.h"
#include "../tasks/tasks_internal.h"
@ -153,9 +154,9 @@ void cb_net_generic_subdir(retro_task_t *task,
finish:
if (!err && !string_ends_with_size(subdir_path,
".index-dirs",
FILE_PATH_INDEX_DIRS_URL,
strlen(subdir_path),
STRLEN_CONST(".index-dirs")
STRLEN_CONST(FILE_PATH_INDEX_DIRS_URL)
))
{
char parent_dir[PATH_MAX_LENGTH];
@ -225,9 +226,9 @@ finish:
if (!err &&
!string_ends_with_size(state->path,
".index-dirs",
FILE_PATH_INDEX_DIRS_URL,
strlen(state->path),
STRLEN_CONST(".index-dirs")
STRLEN_CONST(FILE_PATH_INDEX_DIRS_URL)
))
{
char parent_dir[PATH_MAX_LENGTH];
@ -239,8 +240,8 @@ finish:
fill_pathname_parent_dir(parent_dir,
state->path, sizeof(parent_dir));
strlcat(parent_dir,
".index-dirs", sizeof(parent_dir));
strlcat(parent_dir, FILE_PATH_INDEX_DIRS_URL,
sizeof(parent_dir));
transf = (file_transfer_t*)malloc(sizeof(*transf));