[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [40674] trunk/blender/source/blender/ windowmanager/intern/wm_files.c: Fix autosave trying to write to / if no userpref temp directory was set,

Brecht Van Lommel brechtvanlommel at pandora.be
Wed Sep 28 21:11:59 CEST 2011


Revision: 40674
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=40674
Author:   blendix
Date:     2011-09-28 19:11:59 +0000 (Wed, 28 Sep 2011)
Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/blender/source/blender/windowmanager/intern/wm_files.c

Modified: trunk/blender/source/blender/windowmanager/intern/wm_files.c
===================================================================
--- trunk/blender/source/blender/windowmanager/intern/wm_files.c	2011-09-28 19:05:47 UTC (rev 40673)
+++ trunk/blender/source/blender/windowmanager/intern/wm_files.c	2011-09-28 19:11:59 UTC (rev 40674)
@@ -289,7 +289,8 @@
 		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 @@
 	 * 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 @@
 
 	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);




More information about the Bf-blender-cvs mailing list