Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2011-09-28 23:11:59 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2011-09-28 23:11:59 +0400
commite54bfda0f3caff9de44fb13416cf6e192e262425 (patch)
treeae7788403d9a293d745944bca59b7fde300ce6c6 /source/blender/windowmanager/intern
parenta52ac47305e641030695221e2ead8b239b1a531c (diff)
Fix autosave trying to write to / if no userpref temp directory was set,
like other code in blender it should write to the one actually verified to exist. Also fixes wrong temp directory when loading user preferences with no temp directory from a state where one was specified.
Diffstat (limited to 'source/blender/windowmanager/intern')
-rw-r--r--source/blender/windowmanager/intern/wm_files.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index c08b8c0d01f..76ebeaa9f21 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -289,7 +289,8 @@ static void wm_init_userdef(bContext *C)
if ((U.flag & USER_SCRIPT_AUTOEXEC_DISABLE) == 0) G.f |= G_SCRIPT_AUTOEXEC;
else G.f &= ~G_SCRIPT_AUTOEXEC;
}
- if(U.tempdir[0]) BLI_where_is_temp(btempdir, FILE_MAX, 1);
+ /* update tempdir from user preferences */
+ BLI_where_is_temp(btempdir, FILE_MAX, 1);
}
@@ -853,14 +854,14 @@ void wm_autosave_location(char *filepath)
* BLI_make_file_string will create string that has it most likely on C:\
* through get_default_root().
* If there is no C:\tmp autosave fails. */
- if (!BLI_exists(U.tempdir)) {
+ if (!BLI_exists(btempdir)) {
savedir = BLI_get_folder_create(BLENDER_USER_AUTOSAVE, NULL);
BLI_make_file_string("/", filepath, savedir, pidstr);
return;
}
#endif
-
- BLI_make_file_string("/", filepath, U.tempdir, pidstr);
+
+ BLI_make_file_string("/", filepath, btempdir, pidstr);
}
void WM_autosave_init(wmWindowManager *wm)
@@ -918,7 +919,7 @@ void wm_autosave_delete(void)
if(BLI_exists(filename)) {
char str[FILE_MAXDIR+FILE_MAXFILE];
- BLI_make_file_string("/", str, U.tempdir, "quit.blend");
+ BLI_make_file_string("/", str, btempdir, "quit.blend");
/* if global undo; remove tempsave, otherwise rename */
if(U.uiflag & USER_GLOBALUNDO) BLI_delete(filename, 0, 0);