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>2012-05-21 12:24:03 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-05-21 12:24:03 +0400
commit252f3556e4ed7a34ca151ac7fbc074fb6f266846 (patch)
treec9141486bf989f36f2e787572e9801e77f39621f /source/blender/windowmanager
parent09b4d262b93a6e73e67f4249f28da581b30f5214 (diff)
fix for minor annoyance when an operator is called by another - dont add blend file to recent history.
this way demo-mode addon doesnt clobber the recent history with demo files its operator loads.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/intern/wm_files.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index 56052b895ab..5c3027d72b1 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -373,6 +373,9 @@ void WM_read_file(bContext *C, const char *filepath, ReportList *reports)
int G_f = G.f;
ListBase wmbase;
+ /* assume automated tasks with background, don't write recent file list */
+ const int do_history = (G.background == FALSE) && (CTX_wm_manager(C)->op_undo_depth == 0);
+
/* put aside screens to match with persistent windows later */
/* also exit screens and editors */
wm_window_match_init(C, &wmbase);
@@ -400,8 +403,9 @@ void WM_read_file(bContext *C, const char *filepath, ReportList *reports)
if (retval != BKE_READ_FILE_FAIL) {
G.relbase_valid = 1;
- if (!G.background) /* assume automated tasks with background, don't write recent file list */
+ if (do_history) {
write_history();
+ }
}