[Bf-blender-cvs] [1c583114404] master: Fix status bar message showing saved when saving failed

Campbell Barton noreply at git.blender.org
Wed Apr 8 05:26:53 CEST 2020


Commit: 1c5831144040709380e02fc41ddef2e10d998cda
Author: Campbell Barton
Date:   Wed Apr 8 13:19:09 2020 +1000
Branches: master
https://developer.blender.org/rB1c5831144040709380e02fc41ddef2e10d998cda

Fix status bar message showing saved when saving failed

Resolves the following issues:

- For the first time you save a .blend file, there was no feedback.
- If the file fails to save (eg "No space left on device") the status
  bar message replaces the error with an invalid "Saved" message.

  While there is a popup, the user may cancel it with mouse motion
  and be left with the status bar message saying the file saved.

D7371 by @XDroid with edits.

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

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 fe4305830ab..8af83aac1be 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -1433,6 +1433,9 @@ static bool wm_file_write(bContext *C, const char *filepath, int fileflags, Repo
       ibuf_thumb = IMB_thumb_create(filepath, THB_LARGE, THB_SOURCE_BLEND, ibuf_thumb);
     }
 
+    /* Without this there is no feedback the file was saved. */
+    BKE_reportf(reports, RPT_INFO, "Saved \"%s\"", BLI_path_basename(filepath));
+
     /* Success. */
     ok = true;
   }
@@ -2715,8 +2718,6 @@ static int wm_save_mainfile_invoke(bContext *C, wmOperator *op, const wmEvent *U
 
     RNA_string_get(op->ptr, "filepath", path);
     ret = wm_save_as_mainfile_exec(C, op);
-    /* Without this there is no feedback the file was saved. */
-    BKE_reportf(op->reports, RPT_INFO, "Saved \"%s\"", BLI_path_basename(path));
   }
   else {
     WM_event_add_fileselect(C, op);



More information about the Bf-blender-cvs mailing list