Changeset View
Changeset View
Standalone View
Standalone View
source/blender/windowmanager/intern/wm_files.c
| Show First 20 Lines • Show All 1,354 Lines • ▼ Show 20 Lines | void wm_autosave_location(char *filepath) | ||||
| char path[1024]; | char path[1024]; | ||||
| #ifdef WIN32 | #ifdef WIN32 | ||||
| const char *savedir; | const char *savedir; | ||||
| #endif | #endif | ||||
| if (G_MAIN && G.relbase_valid) { | if (G_MAIN && G.relbase_valid) { | ||||
| const char *basename = BLI_path_basename(BKE_main_blendfile_path_from_global()); | const char *basename = BLI_path_basename(BKE_main_blendfile_path_from_global()); | ||||
| int len = strlen(basename) - 6; | int len = strlen(basename) - 6; | ||||
| BLI_snprintf(path, sizeof(path), "%.*s.blend", len, basename); | BLI_snprintf(path, sizeof(path), "%.*s (autosave).blend", len, basename); | ||||
| } | } | ||||
| else { | else { | ||||
| BLI_snprintf(path, sizeof(path), "%d.blend", pid); | BLI_snprintf(path, sizeof(path), "%d (autosave).blend", pid); | ||||
| } | } | ||||
| #ifdef WIN32 | #ifdef WIN32 | ||||
| /* XXX Need to investigate how to handle default location of '/tmp/' | /* XXX Need to investigate how to handle default location of '/tmp/' | ||||
| * This is a relative directory on Windows, and it may be | * This is a relative directory on Windows, and it may be | ||||
| * found. Example: | * found. Example: | ||||
| * Blender installed on D:\ drive, D:\ drive has D:\tmp\ | * Blender installed on D:\ drive, D:\ drive has D:\tmp\ | ||||
| * Now, BLI_exists() will find '/tmp/' exists, but | * Now, BLI_exists() will find '/tmp/' exists, but | ||||
| ▲ Show 20 Lines • Show All 1,111 Lines • Show Last 20 Lines | |||||