mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 21:32:45 +00:00
Replace more hardcoded strings
This commit is contained in:
parent
07ebd50153
commit
cce19ac97d
@ -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;
|
||||
|
@ -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"
|
||||
@ -139,10 +140,10 @@ void cb_net_generic_subdir(retro_task_t *task,
|
||||
{
|
||||
#ifdef HAVE_NETWORKING
|
||||
char subdir_path[PATH_MAX_LENGTH];
|
||||
http_transfer_data_t *data = (http_transfer_data_t*)task_data;
|
||||
http_transfer_data_t *data = (http_transfer_data_t*)task_data;
|
||||
file_transfer_t *state = (file_transfer_t*)user_data;
|
||||
|
||||
subdir_path[0] = '\0';
|
||||
subdir_path[0] = '\0';
|
||||
|
||||
if (!data || err)
|
||||
goto finish;
|
||||
@ -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,22 +226,22 @@ 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];
|
||||
char parent_dir_encoded[PATH_MAX_LENGTH];
|
||||
file_transfer_t *transf = NULL;
|
||||
|
||||
parent_dir[0] = '\0';
|
||||
parent_dir_encoded[0] = '\0';
|
||||
parent_dir[0] = '\0';
|
||||
parent_dir_encoded[0] = '\0';
|
||||
|
||||
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));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user