Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/appdir.c
| Show First 20 Lines • Show All 223 Lines • ▼ Show 20 Lines | #else | ||||
| return test_path(targetpath, targetpath_len, bprogdir, blender_version_decimal(ver), relfolder); | return test_path(targetpath, targetpath_len, bprogdir, blender_version_decimal(ver), relfolder); | ||||
| #endif | #endif | ||||
| } | } | ||||
| /** | /** | ||||
| * Is this an install with user files kept together with the Blender executable and its | * Is this an install with user files kept together with the Blender executable and its | ||||
| * installation files. | * installation files. | ||||
| */ | */ | ||||
| static bool is_portable_install(void) | bool BKE_appdir_app_is_portable_install(void) | ||||
| { | { | ||||
| /* detect portable install by the existence of config folder */ | /* detect portable install by the existence of config folder */ | ||||
| const int ver = BLENDER_VERSION; | const int ver = BLENDER_VERSION; | ||||
| char path[FILE_MAX]; | char path[FILE_MAX]; | ||||
| return get_path_local(path, sizeof(path), "config", NULL, ver); | return get_path_local(path, sizeof(path), "config", NULL, ver); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | |||||
| static bool get_path_user( | static bool get_path_user( | ||||
| char *targetpath, size_t targetpath_len, const char *folder_name, const char *subfolder_name, | char *targetpath, size_t targetpath_len, const char *folder_name, const char *subfolder_name, | ||||
| const int ver) | const int ver) | ||||
| { | { | ||||
| char user_path[FILE_MAX]; | char user_path[FILE_MAX]; | ||||
| const char *user_base_path; | const char *user_base_path; | ||||
| /* for portable install, user path is always local */ | /* for portable install, user path is always local */ | ||||
| if (is_portable_install()) { | if (BKE_appdir_app_is_portable_install()) { | ||||
| return get_path_local(targetpath, targetpath_len, folder_name, subfolder_name, ver); | return get_path_local(targetpath, targetpath_len, folder_name, subfolder_name, ver); | ||||
| } | } | ||||
| user_path[0] = '\0'; | user_path[0] = '\0'; | ||||
| user_base_path = (const char *)GHOST_getUserDir(ver, blender_version_decimal(ver)); | user_base_path = (const char *)GHOST_getUserDir(ver, blender_version_decimal(ver)); | ||||
| if (user_base_path) | if (user_base_path) | ||||
| BLI_strncpy(user_path, user_base_path, FILE_MAX); | BLI_strncpy(user_path, user_base_path, FILE_MAX); | ||||
| ▲ Show 20 Lines • Show All 606 Lines • Show Last 20 Lines | |||||