Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2016-01-29 09:00:32 +0300
committerCampbell Barton <ideasman42@gmail.com>2016-01-29 09:00:32 +0300
commit7d285854b0e36a4cb7720f0b910fb4f9c2d8804b (patch)
treea8ee791cb603ee16ab0038ffabe46ac84a899077 /source/blender/windowmanager/intern
parentf2a93faa7c2e5adfe333eab84791cf71b900d8f1 (diff)
Skip save-as history running from another Operator
So scripts can call Save-As without adjusting 'Recent Files'. Uses same logic and file reading,
Diffstat (limited to 'source/blender/windowmanager/intern')
-rw-r--r--source/blender/windowmanager/intern/wm_files.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index 845e190c82d..e3172de626a 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -1068,6 +1068,8 @@ int wm_file_write(bContext *C, const char *filepath, int fileflags, ReportList *
G.main->recovered = 0;
if (BLO_write_file(CTX_data_main(C), filepath, fileflags, reports, thumb)) {
+ const bool do_history = (G.background == false) && (CTX_wm_manager(C)->op_undo_depth == 0);
+
if (!(fileflags & G_FILE_SAVE_COPY)) {
G.relbase_valid = 1;
BLI_strncpy(G.main->name, filepath, sizeof(G.main->name)); /* is guaranteed current file */
@@ -1079,7 +1081,7 @@ int wm_file_write(bContext *C, const char *filepath, int fileflags, ReportList *
BKE_BIT_TEST_SET(G.fileflags, fileflags & G_FILE_AUTOPLAY, G_FILE_AUTOPLAY);
/* prevent background mode scripts from clobbering history */
- if (!G.background) {
+ if (do_history) {
wm_history_file_update();
}