diff options
author | Harley Acheson <harley.acheson@gmail.com> | 2021-04-23 06:08:17 +0300 |
---|---|---|
committer | Harley Acheson <harley.acheson@gmail.com> | 2021-04-23 06:08:17 +0300 |
commit | cfa20ff03bdeb87b1625196d58a1dbe0e22cc2f9 (patch) | |
tree | 3a22a7dcf38b34530edab7736c37c3c164eba8b2 /source/blender | |
parent | 8b049e4c2a53e51db295ab300bf8377d63086708 (diff) |
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
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/windowmanager/intern/wm_files.c | 5 |
1 files changed, 4 insertions, 1 deletions
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); |