From 95db09d8c519e2e2987a3ee7ee2ab46c76841e9a Mon Sep 17 00:00:00 2001 From: libretroadmin Date: Tue, 5 Jul 2022 19:15:29 +0200 Subject: [PATCH] Move bundle_assets_{src/dst} to settings->paths --- configuration.c | 13 +++++++------ configuration.h | 6 +++--- frontend/drivers/platform_darwin.m | 4 ++-- menu/menu_driver.c | 10 +++++----- 4 files changed, 17 insertions(+), 16 deletions(-) diff --git a/configuration.c b/configuration.c index 319f3e6b03..f219d5b211 100644 --- a/configuration.c +++ b/configuration.c @@ -1414,9 +1414,6 @@ static struct config_array_setting *populate_settings_array(settings_t *settings SETTING_ARRAY("input_driver", settings->arrays.input_driver, false, NULL, true); SETTING_ARRAY("input_joypad_driver", settings->arrays.input_joypad_driver, false, NULL, true); SETTING_ARRAY("input_keyboard_layout", settings->arrays.input_keyboard_layout, false, NULL, true); - SETTING_ARRAY("bundle_assets_src_path", settings->arrays.bundle_assets_src, false, NULL, true); - SETTING_ARRAY("bundle_assets_dst_path", settings->arrays.bundle_assets_dst, false, NULL, true); - SETTING_ARRAY("bundle_assets_dst_path_subdir", settings->arrays.bundle_assets_dst_subdir, false, NULL, true); SETTING_ARRAY("led_driver", settings->arrays.led_driver, false, NULL, true); SETTING_ARRAY("netplay_mitm_server", settings->arrays.netplay_mitm_server, false, NULL, true); SETTING_ARRAY("midi_driver", settings->arrays.midi_driver, false, NULL, true); @@ -1578,6 +1575,10 @@ static struct config_path_setting *populate_settings_path( SETTING_PATH("recording_config_directory", recording_st->config_dir, false, NULL, true); + SETTING_PATH("bundle_assets_src_path", settings->paths.bundle_assets_src, false, NULL, true); + SETTING_PATH("bundle_assets_dst_path", settings->paths.bundle_assets_dst, false, NULL, true); + SETTING_PATH("bundle_assets_dst_path_subdir", settings->paths.bundle_assets_dst_subdir, false, NULL, true); + SETTING_ARRAY("log_dir", settings->paths.log_dir, true, NULL, true); *size = count; @@ -2745,9 +2746,9 @@ void config_set_defaults(void *data) *settings->paths.path_content_video_history = '\0'; *settings->paths.path_cheat_settings = '\0'; #if !defined(__APPLE__) - *settings->arrays.bundle_assets_src = '\0'; - *settings->arrays.bundle_assets_dst = '\0'; - *settings->arrays.bundle_assets_dst_subdir = '\0'; + *settings->paths.bundle_assets_src = '\0'; + *settings->paths.bundle_assets_dst = '\0'; + *settings->paths.bundle_assets_dst_subdir = '\0'; #endif *settings->paths.path_cheat_database = '\0'; *settings->paths.path_menu_wallpaper = '\0'; diff --git a/configuration.h b/configuration.h index fccb382ac9..13f19cf8e7 100644 --- a/configuration.h +++ b/configuration.h @@ -416,9 +416,6 @@ typedef struct settings char translation_service_url[2048]; - char bundle_assets_src[PATH_MAX_LENGTH]; - char bundle_assets_dst[PATH_MAX_LENGTH]; - char bundle_assets_dst_subdir[PATH_MAX_LENGTH]; char youtube_stream_key[PATH_MAX_LENGTH]; char twitch_stream_key[PATH_MAX_LENGTH]; char facebook_stream_key[PATH_MAX_LENGTH]; @@ -451,6 +448,9 @@ typedef struct settings char path_stream_url[8192]; + char bundle_assets_src[PATH_MAX_LENGTH]; + char bundle_assets_dst[PATH_MAX_LENGTH]; + char bundle_assets_dst_subdir[PATH_MAX_LENGTH]; char path_menu_xmb_font[PATH_MAX_LENGTH]; char menu_content_show_settings_password[PATH_MAX_LENGTH]; char kiosk_mode_password[PATH_MAX_LENGTH]; diff --git a/frontend/drivers/platform_darwin.m b/frontend/drivers/platform_darwin.m index 6c5fdca400..a779c2cb79 100644 --- a/frontend/drivers/platform_darwin.m +++ b/frontend/drivers/platform_darwin.m @@ -474,10 +474,10 @@ static void frontend_darwin_get_env(int *argc, char *argv[], { settings_t *settings = config_get_ptr(); configuration_set_string(settings, - settings->arrays.bundle_assets_src, + settings->paths.bundle_assets_src, assets_zip_path); configuration_set_string(settings, - settings->arrays.bundle_assets_dst, + settings->paths.bundle_assets_dst, #if TARGET_OS_IOS || TARGET_OS_TV home_dir_buf #else diff --git a/menu/menu_driver.c b/menu/menu_driver.c index 720c4a28e3..de102baaeb 100644 --- a/menu/menu_driver.c +++ b/menu/menu_driver.c @@ -3464,18 +3464,18 @@ bool rarch_menu_init( #ifdef HAVE_COMPRESSION if ( settings->bools.bundle_assets_extract_enable - && !string_is_empty(settings->arrays.bundle_assets_src) - && !string_is_empty(settings->arrays.bundle_assets_dst) + && !string_is_empty(settings->paths.bundle_assets_src) + && !string_is_empty(settings->paths.bundle_assets_dst) && (settings->uints.bundle_assets_extract_version_current != settings->uints.bundle_assets_extract_last_version) ) { p_dialog->current_type = MENU_DIALOG_HELP_EXTRACT; task_push_decompress( - settings->arrays.bundle_assets_src, - settings->arrays.bundle_assets_dst, + settings->paths.bundle_assets_src, + settings->paths.bundle_assets_dst, NULL, - settings->arrays.bundle_assets_dst_subdir, + settings->paths.bundle_assets_dst_subdir, NULL, bundle_decompressed, NULL,