[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [55933] trunk/blender/source/blender/ windowmanager/intern: alternate solution for r55921 which was calling invoke() from exec(), which shouldnt be done.

Campbell Barton ideasman42 at gmail.com
Wed Apr 10 11:49:44 CEST 2013


Revision: 55933
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=55933
Author:   campbellbarton
Date:     2013-04-10 09:49:44 +0000 (Wed, 10 Apr 2013)
Log Message:
-----------
alternate solution for r55921 which was calling invoke() from exec(), which shouldnt be done.

Revision Links:
--------------
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=55921

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	2013-04-10 02:58:22 UTC (rev 55932)
+++ trunk/blender/source/blender/windowmanager/intern/wm_files.c	2013-04-10 09:49:44 UTC (rev 55933)
@@ -395,7 +395,14 @@
 		/* confusing this global... */
 		G.relbase_valid = 1;
 		retval = BKE_read_file(C, filepath, reports);
-		G.save_over = 1;
+		/* when loading startup.blend's, we can be left with a blank path */
+		if (G.main->name[0]) {
+			G.save_over = 1;
+		}
+		else {
+			G.save_over = 0;
+			G.relbase_valid = 0;
+		}
 
 		/* this flag is initialized by the operator but overwritten on read.
 		 * need to re-enable it here else drivers + registered scripts wont work. */

Modified: trunk/blender/source/blender/windowmanager/intern/wm_operators.c
===================================================================
--- trunk/blender/source/blender/windowmanager/intern/wm_operators.c	2013-04-10 02:58:22 UTC (rev 55932)
+++ trunk/blender/source/blender/windowmanager/intern/wm_operators.c	2013-04-10 09:49:44 UTC (rev 55933)
@@ -2376,7 +2376,6 @@
 }
 
 /* function used for WM_OT_save_mainfile too */
-static int wm_save_mainfile_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event));
 static int wm_save_as_mainfile_exec(bContext *C, wmOperator *op)
 {
 	char path[FILE_MAX];
@@ -2387,13 +2386,7 @@
 	if (RNA_struct_property_is_set(op->ptr, "filepath"))
 		RNA_string_get(op->ptr, "filepath", path);
 	else {
-		/* if file has no name, then treat like startup file */
-		if (G.main->name[0] == 0) {
-			G.save_over = false;
-			return wm_save_mainfile_invoke(C, op, (wmEvent *)NULL);
-		}
-		else
-			BLI_strncpy(path, G.main->name, FILE_MAX);
+		BLI_strncpy(path, G.main->name, FILE_MAX);
 		untitled(path);
 	}
 	




More information about the Bf-blender-cvs mailing list