mirror of
https://github.com/libretro/RetroArch.git
synced 2025-04-02 10:51:52 -04:00
Replace more hardcoded strings
This commit is contained in:
parent
07ebd50153
commit
cce19ac97d
2 changed files with 17 additions and 15 deletions
|
@ -4083,7 +4083,8 @@ static int generic_action_ok_network(const char *path,
|
||||||
|
|
||||||
fill_pathname_join(url_path,
|
fill_pathname_join(url_path,
|
||||||
network_buildbot_assets_url,
|
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);
|
url_label = msg_hash_to_str(enum_idx);
|
||||||
type_id2 = ACTION_OK_DL_CORE_CONTENT_DIRS_LIST;
|
type_id2 = ACTION_OK_DL_CORE_CONTENT_DIRS_LIST;
|
||||||
callback = cb_net_generic;
|
callback = cb_net_generic;
|
||||||
|
@ -4091,7 +4092,7 @@ static int generic_action_ok_network(const char *path,
|
||||||
break;
|
break;
|
||||||
case MENU_ENUM_LABEL_CB_CORE_CONTENT_LIST:
|
case MENU_ENUM_LABEL_CB_CORE_CONTENT_LIST:
|
||||||
fill_pathname_join(url_path, path,
|
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);
|
url_label = msg_hash_to_str(enum_idx);
|
||||||
type_id2 = ACTION_OK_DL_CORE_CONTENT_LIST;
|
type_id2 = ACTION_OK_DL_CORE_CONTENT_LIST;
|
||||||
callback = cb_net_generic;
|
callback = cb_net_generic;
|
||||||
|
@ -4099,8 +4100,8 @@ static int generic_action_ok_network(const char *path,
|
||||||
break;
|
break;
|
||||||
case MENU_ENUM_LABEL_CB_THUMBNAILS_UPDATER_LIST:
|
case MENU_ENUM_LABEL_CB_THUMBNAILS_UPDATER_LIST:
|
||||||
fill_pathname_join(url_path,
|
fill_pathname_join(url_path,
|
||||||
"http://thumbnailpacks.libretro.com",
|
FILE_PATH_CORE_THUMBNAILPACKS_URL,
|
||||||
".index", sizeof(url_path));
|
FILE_PATH_INDEX_URL, sizeof(url_path));
|
||||||
url_label = msg_hash_to_str(enum_idx);
|
url_label = msg_hash_to_str(enum_idx);
|
||||||
type_id2 = ACTION_OK_DL_THUMBNAILS_UPDATER_LIST;
|
type_id2 = ACTION_OK_DL_THUMBNAILS_UPDATER_LIST;
|
||||||
callback = cb_net_generic;
|
callback = cb_net_generic;
|
||||||
|
@ -4112,7 +4113,7 @@ static int generic_action_ok_network(const char *path,
|
||||||
FILE_PATH_LAKKA_URL,
|
FILE_PATH_LAKKA_URL,
|
||||||
lakka_get_project(), sizeof(url_path));
|
lakka_get_project(), sizeof(url_path));
|
||||||
fill_pathname_join(url_path, url_path,
|
fill_pathname_join(url_path, url_path,
|
||||||
".index",
|
FILE_PATH_INDEX_URL,
|
||||||
sizeof(url_path));
|
sizeof(url_path));
|
||||||
url_label = msg_hash_to_str(enum_idx);
|
url_label = msg_hash_to_str(enum_idx);
|
||||||
type_id2 = ACTION_OK_DL_LAKKA_LIST;
|
type_id2 = ACTION_OK_DL_LAKKA_LIST;
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
#include "menu_networking.h"
|
#include "menu_networking.h"
|
||||||
#include "menu_entries.h"
|
#include "menu_entries.h"
|
||||||
|
|
||||||
|
#include "../file_path_special.h"
|
||||||
#include "../msg_hash.h"
|
#include "../msg_hash.h"
|
||||||
#include "../tasks/task_file_transfer.h"
|
#include "../tasks/task_file_transfer.h"
|
||||||
#include "../tasks/tasks_internal.h"
|
#include "../tasks/tasks_internal.h"
|
||||||
|
@ -139,10 +140,10 @@ void cb_net_generic_subdir(retro_task_t *task,
|
||||||
{
|
{
|
||||||
#ifdef HAVE_NETWORKING
|
#ifdef HAVE_NETWORKING
|
||||||
char subdir_path[PATH_MAX_LENGTH];
|
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;
|
file_transfer_t *state = (file_transfer_t*)user_data;
|
||||||
|
|
||||||
subdir_path[0] = '\0';
|
subdir_path[0] = '\0';
|
||||||
|
|
||||||
if (!data || err)
|
if (!data || err)
|
||||||
goto finish;
|
goto finish;
|
||||||
|
@ -153,9 +154,9 @@ void cb_net_generic_subdir(retro_task_t *task,
|
||||||
|
|
||||||
finish:
|
finish:
|
||||||
if (!err && !string_ends_with_size(subdir_path,
|
if (!err && !string_ends_with_size(subdir_path,
|
||||||
".index-dirs",
|
FILE_PATH_INDEX_DIRS_URL,
|
||||||
strlen(subdir_path),
|
strlen(subdir_path),
|
||||||
STRLEN_CONST(".index-dirs")
|
STRLEN_CONST(FILE_PATH_INDEX_DIRS_URL)
|
||||||
))
|
))
|
||||||
{
|
{
|
||||||
char parent_dir[PATH_MAX_LENGTH];
|
char parent_dir[PATH_MAX_LENGTH];
|
||||||
|
@ -225,22 +226,22 @@ finish:
|
||||||
|
|
||||||
if (!err &&
|
if (!err &&
|
||||||
!string_ends_with_size(state->path,
|
!string_ends_with_size(state->path,
|
||||||
".index-dirs",
|
FILE_PATH_INDEX_DIRS_URL,
|
||||||
strlen(state->path),
|
strlen(state->path),
|
||||||
STRLEN_CONST(".index-dirs")
|
STRLEN_CONST(FILE_PATH_INDEX_DIRS_URL)
|
||||||
))
|
))
|
||||||
{
|
{
|
||||||
char parent_dir[PATH_MAX_LENGTH];
|
char parent_dir[PATH_MAX_LENGTH];
|
||||||
char parent_dir_encoded[PATH_MAX_LENGTH];
|
char parent_dir_encoded[PATH_MAX_LENGTH];
|
||||||
file_transfer_t *transf = NULL;
|
file_transfer_t *transf = NULL;
|
||||||
|
|
||||||
parent_dir[0] = '\0';
|
parent_dir[0] = '\0';
|
||||||
parent_dir_encoded[0] = '\0';
|
parent_dir_encoded[0] = '\0';
|
||||||
|
|
||||||
fill_pathname_parent_dir(parent_dir,
|
fill_pathname_parent_dir(parent_dir,
|
||||||
state->path, sizeof(parent_dir));
|
state->path, sizeof(parent_dir));
|
||||||
strlcat(parent_dir,
|
strlcat(parent_dir, FILE_PATH_INDEX_DIRS_URL,
|
||||||
".index-dirs", sizeof(parent_dir));
|
sizeof(parent_dir));
|
||||||
|
|
||||||
transf = (file_transfer_t*)malloc(sizeof(*transf));
|
transf = (file_transfer_t*)malloc(sizeof(*transf));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue