diff options
author | Nathan Letwory <nathan@letworyinteractive.com> | 2010-07-10 15:09:26 +0400 |
---|---|---|
committer | Nathan Letwory <nathan@letworyinteractive.com> | 2010-07-10 15:09:26 +0400 |
commit | ce0ff001ac3eec1fd8d50eafcfd3494681b3fe61 (patch) | |
tree | ca6b25591a770aca1765f644a9af34ad5c29f2cf /source/blender/blenlib | |
parent | 3eebaceaa633c62b8ff8c17333541ab9ad92ba81 (diff) |
Ensure that local installations (also known as portable installations) are possible again.
For user config and data files, first check the 'local' location (where the executable is located), and only then the actual user locations (whatever the convention for the OSes; $HOME, %APPDATA%, etc).
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/intern/path_util.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c index 772782e5467..3b8599fe1c6 100644 --- a/source/blender/blenlib/intern/path_util.c +++ b/source/blender/blenlib/intern/path_util.c @@ -1064,13 +1064,14 @@ char *BLI_get_folder(int folder_id, char *subfolder) switch (folder_id) { case BLENDER_DATAFILES: /* general case */ BLI_join_dirfile(search_path, "datafiles", subfolder); - if (get_path_user(path, search_path, "BLENDER_USER_DATAFILES")) break; if (get_path_local(path, search_path)) break; + if (get_path_user(path, search_path, "BLENDER_USER_DATAFILES")) break; if (get_path_system(path, search_path, "BLENDER_SYSTEM_DATAFILES")) break; return NULL; - case BLENDER_USER_DATAFILES: + case BLENDER_USER_DATAFILES: BLI_join_dirfile(search_path, "datafiles", subfolder); + if (get_path_local(path, search_path)) break; if (get_path_user(path, search_path, "BLENDER_USER_DATAFILES")) break; return NULL; @@ -1081,13 +1082,14 @@ char *BLI_get_folder(int folder_id, char *subfolder) case BLENDER_CONFIG: /* general case */ BLI_join_dirfile(search_path, "config", subfolder); - if (get_path_user(path, search_path, "BLENDER_USER_CONFIG")) break; if (get_path_local(path, search_path)) break; + if (get_path_user(path, search_path, "BLENDER_USER_CONFIG")) break; if (get_path_system(path, search_path, "BLENDER_SYSTEM_CONFIG")) break; return NULL; case BLENDER_USER_CONFIG: BLI_join_dirfile(search_path, "config", subfolder); + if (get_path_local(path, search_path)) break; if (get_path_user(path, search_path, "BLENDER_USER_CONFIG")) break; return NULL; @@ -1098,13 +1100,14 @@ char *BLI_get_folder(int folder_id, char *subfolder) case BLENDER_SCRIPTS: /* general case */ BLI_join_dirfile(search_path, "scripts", subfolder); - if (get_path_user(path, search_path, "BLENDER_USER_SCRIPTS")) break; if (get_path_local(path, search_path)) break; + if (get_path_user(path, search_path, "BLENDER_USER_SCRIPTS")) break; if (get_path_system(path, search_path, "BLENDER_SYSTEM_SCRIPTS")) break; return NULL; case BLENDER_USER_SCRIPTS: BLI_join_dirfile(search_path, "scripts", subfolder); + if (get_path_local(path, search_path)) break; if (get_path_user(path, search_path, "BLENDER_USER_SCRIPTS")) break; return NULL; @@ -1121,7 +1124,6 @@ char *BLI_get_folder(int folder_id, char *subfolder) case BLENDER_SYSTEM_PYTHON: BLI_join_dirfile(search_path, "python", subfolder); - if (get_path_system(path, search_path, "BLENDER_SYSTEM_PYTHON")) break; return NULL; } |