[Bf-blender-cvs] [cfa20ff03bd] master: Fix T86566: Do Not Close if File Cannot Be Saved

Harley Acheson noreply at git.blender.org
Fri Apr 23 05:09:19 CEST 2021


Commit: cfa20ff03bdeb87b1625196d58a1dbe0e22cc2f9
Author: Harley Acheson
Date:   Thu Apr 22 20:08:17 2021 -0700
Branches: master
https://developer.blender.org/rBcfa20ff03bdeb87b1625196d58a1dbe0e22cc2f9

Fix T86566: Do Not Close if File Cannot Be Saved

If saving a file using CloseSave dialog, do not close if there is an error doing so, like if read-only.

Differential Revision: https://developer.blender.org/D10722

Reviewed by Julian Eisel

===================================================================

M	source/blender/windowmanager/intern/wm_files.c

===================================================================

diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index 614824ef7e2..d0ee7075516 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -3265,7 +3265,10 @@ static void wm_block_file_close_save(bContext *C, void *arg_block, void *arg_dat
   bool file_has_been_saved_before = BKE_main_blendfile_path(bmain)[0] != '\0';
 
   if (file_has_been_saved_before) {
-    WM_operator_name_call(C, "WM_OT_save_mainfile", WM_OP_EXEC_DEFAULT, NULL);
+    if (WM_operator_name_call(C, "WM_OT_save_mainfile", WM_OP_EXEC_DEFAULT, NULL) &
+        OPERATOR_CANCELLED) {
+      execute_callback = false;
+    }
   }
   else {
     WM_operator_name_call(C, "WM_OT_save_mainfile", WM_OP_INVOKE_DEFAULT, NULL);



More information about the Bf-blender-cvs mailing list