[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [53011] trunk/blender/source/blender/ windowmanager/intern: Bug fix, irc submitted:

Ton Roosendaal ton at blender.org
Fri Dec 14 19:54:23 CET 2012


Revision: 53011
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=53011
Author:   ton
Date:     2012-12-14 18:54:22 +0000 (Fri, 14 Dec 2012)
Log Message:
-----------
Bug fix, irc submitted:

On saving a first .blend after startup, the file would load back as if it was not
saved (showing no name in header). 

The whole FILEFLAGS and G.relabase_valid and G.file_saved etc is messy.
This commit fixes issues, but only adds more mess :)

Will discuss a nicer implementation of all of this.

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

Modified: trunk/blender/source/blender/windowmanager/intern/wm_files.c
===================================================================
--- trunk/blender/source/blender/windowmanager/intern/wm_files.c	2012-12-14 18:40:20 UTC (rev 53010)
+++ trunk/blender/source/blender/windowmanager/intern/wm_files.c	2012-12-14 18:54:22 UTC (rev 53011)
@@ -841,6 +841,14 @@
 	
 	fileflags |= G_FILE_HISTORY; /* write file history */
 
+	/* first time saving */
+	/* XXX temp solution to solve bug, real fix coming (ton) */
+	if (G.main->name[0] == 0)
+		BLI_strncpy(G.main->name, filepath, sizeof(G.main->name));
+	
+	/* XXX temp solution to solve bug, real fix coming (ton) */
+	G.main->recovered = 0;
+	
 	if (BLO_write_file(CTX_data_main(C), filepath, fileflags, reports, thumb)) {
 		if (!(fileflags & G_FILE_SAVE_COPY)) {
 			G.relbase_valid = 1;

Modified: trunk/blender/source/blender/windowmanager/intern/wm_operators.c
===================================================================
--- trunk/blender/source/blender/windowmanager/intern/wm_operators.c	2012-12-14 18:40:20 UTC (rev 53010)
+++ trunk/blender/source/blender/windowmanager/intern/wm_operators.c	2012-12-14 18:54:22 UTC (rev 53011)
@@ -2037,6 +2037,8 @@
 		/* XXX bad global... fixme */
 		if (G.main->name[0])
 			G.file_loaded = 1;	/* prevents splash to show */
+		else
+			G.relbase_valid = 0;
 	}
 }
 




More information about the Bf-blender-cvs mailing list