Changeset View
Changeset View
Standalone View
Standalone View
source/blender/imbuf/intern/thumbs.c
| Show First 20 Lines • Show All 93 Lines • ▼ Show 20 Lines | |||||
| #ifdef WIN32 | #ifdef WIN32 | ||||
| wchar_t dir_16[MAX_PATH]; | wchar_t dir_16[MAX_PATH]; | ||||
| /* yes, applications shouldn't store data there, but so does GIMP :)*/ | /* yes, applications shouldn't store data there, but so does GIMP :)*/ | ||||
| SHGetSpecialFolderPathW(0, dir_16, CSIDL_PROFILE, 0); | SHGetSpecialFolderPathW(0, dir_16, CSIDL_PROFILE, 0); | ||||
| conv_utf_16_to_8(dir_16, dir, FILE_MAX); | conv_utf_16_to_8(dir_16, dir, FILE_MAX); | ||||
| s += strlen(dir); | s += strlen(dir); | ||||
| #else | #else | ||||
| #if defined(USE_FREEDESKTOP) | #if defined(USE_FREEDESKTOP) | ||||
| const char *home_cache = getenv("XDG_CACHE_HOME"); | const char *home_cache = BLI_getenv("XDG_CACHE_HOME"); | ||||
| const char *home = home_cache ? home_cache : getenv("HOME"); | const char *home = home_cache ? home_cache : BLI_getenv("HOME"); | ||||
| #else | #else | ||||
| const char *home = getenv("HOME"); | const char *home = BLI_getenv("HOME"); | ||||
| #endif | #endif | ||||
| if (!home) return 0; | if (!home) return 0; | ||||
| s += BLI_strncpy_rlen(s, home, FILE_MAX); | s += BLI_strncpy_rlen(s, home, FILE_MAX); | ||||
| #ifdef USE_FREEDESKTOP | #ifdef USE_FREEDESKTOP | ||||
| if (!home_cache) { | if (!home_cache) { | ||||
| s += BLI_strncpy_rlen(s, "/.cache", FILE_MAX - (s - dir)); | s += BLI_strncpy_rlen(s, "/.cache", FILE_MAX - (s - dir)); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 602 Lines • Show Last 20 Lines | |||||