From b9831cdc14d22949595ef05d3a3bdd1ef9c4c22a Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 18 Jul 2015 15:14:24 +0200 Subject: [PATCH] (OSX) Add default dirs for Pictures and Downloads --- frontend/drivers/platform_darwin.m | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/frontend/drivers/platform_darwin.m b/frontend/drivers/platform_darwin.m index 2b66e54282..9580ec8fa3 100644 --- a/frontend/drivers/platform_darwin.m +++ b/frontend/drivers/platform_darwin.m @@ -314,6 +314,7 @@ static void frontend_darwin_get_environment_settings(int *argc, char *argv[], char temp_dir[PATH_MAX_LENGTH] = {0}; char bundle_path_buf[PATH_MAX_LENGTH] = {0}; char home_dir_buf[PATH_MAX_LENGTH] = {0}; + char downloads_dir_buf[PATH_MAX_LENGTH] = {0}; CFBundleRef bundle = CFBundleGetMainBundle(); (void)temp_dir; @@ -326,10 +327,13 @@ static void frontend_darwin_get_environment_settings(int *argc, char *argv[], CFStringGetCString(bundle_path, bundle_path_buf, sizeof(bundle_path_buf), kCFStringEncodingUTF8); (void)home_dir_buf; + (void)downloads_dir; CFSearchPathForDirectoriesInDomains(CFDocumentDirectory, CFUserDomainMask, 1, home_dir_buf, sizeof(home_dir_buf)); #ifdef OSX + CFSearchPathForDirectoriesInDomains(CFDownloadsDirectory, CFUserDomainMask, 1, downloads_dir_buf, sizeof(downloads_dir_buf)); + CFSearchPathForDirectoriesInDomains(CFPicturesDirectory, CFUserDomainMask, 1, pictures_dir_buf, sizeof(pictures_dir_buf)); strlcat(home_dir_buf, "/RetroArch", sizeof(home_dir_buf)); #endif @@ -337,7 +341,12 @@ static void frontend_darwin_get_environment_settings(int *argc, char *argv[], fill_pathname_join(g_defaults.core_info_dir, home_dir_buf, "info", sizeof(g_defaults.core_info_dir)); fill_pathname_join(g_defaults.overlay_dir, home_dir_buf, "overlays", sizeof(g_defaults.overlay_dir)); fill_pathname_join(g_defaults.autoconfig_dir, home_dir_buf, "autoconfig/hid", sizeof(g_defaults.autoconfig_dir)); +#ifdef OSX + strlcpy(g_defaults.core_assets_dir, downloads_dir_buf, sizeof(g_defaults.core_assets_dir)); + strlcpy(g_defaults.screenshot_dir, pictures_dir_buf, sizeof(g_defaults_screenshot_dir)); +#else fill_pathname_join(g_defaults.core_assets_dir, home_dir_buf, "downloads", sizeof(g_defaults.core_assets_dir)); +#endif fill_pathname_join(g_defaults.assets_dir, home_dir_buf, "assets", sizeof(g_defaults.assets_dir)); fill_pathname_join(g_defaults.system_dir, home_dir_buf, "system", sizeof(g_defaults.system_dir)); fill_pathname_join(g_defaults.menu_config_dir, home_dir_buf, "configs", sizeof(g_defaults.menu_config_dir));