From 1c5831144040709380e02fc41ddef2e10d998cda Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 8 Apr 2020 13:19:09 +1000 Subject: 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. --- source/blender/windowmanager/intern/wm_files.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source/blender/windowmanager') 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); -- cgit v1.2.3