diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-03-15 05:30:43 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-03-15 06:48:17 +0300 |
commit | 88b24bc6bbbf35bde00c55834330b56708f25897 (patch) | |
tree | e236a0d29251c5f83d92c67ee3e577c4dde1516c /source/blender/blenkernel/intern/blender_undo.c | |
parent | d3b4ff6eaa1cb155adf4b2aad4775746bc3ca6df (diff) |
Writefile: only include recovery info in auto-save & quit.blend
Previously all blend files included the path they were saved,
causing files distributed publicly to include users local paths.
This also included developers home directories for startup & userprefs
defaults & app-templates bundled with Blender.
Now recovery information is only written for auto-save & quit.blend
since this is the only time they're intended to be used.
Diffstat (limited to 'source/blender/blenkernel/intern/blender_undo.c')
-rw-r--r-- | source/blender/blenkernel/intern/blender_undo.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/blender_undo.c b/source/blender/blenkernel/intern/blender_undo.c index 9f8a30722c2..293b2c9c4c6 100644 --- a/source/blender/blenkernel/intern/blender_undo.c +++ b/source/blender/blenkernel/intern/blender_undo.c @@ -115,6 +115,9 @@ MemFileUndoData *BKE_memfile_undo_encode(Main *bmain, MemFileUndoData *mfu_prev) { MemFileUndoData *mfu = MEM_callocN(sizeof(MemFileUndoData), __func__); + /* Include recovery infomation since undo-data is written out as #BLENDER_QUIT_FILE. */ + const int fileflags = G.fileflags | G_FILE_RECOVER_WRITE; + /* disk save version */ if (UNDO_DISK) { static int counter = 0; @@ -129,7 +132,7 @@ MemFileUndoData *BKE_memfile_undo_encode(Main *bmain, MemFileUndoData *mfu_prev) BLI_join_dirfile(filename, sizeof(filename), BKE_tempdir_session(), numstr); /* success = */ /* UNUSED */ BLO_write_file( - bmain, filename, G.fileflags, &(const struct BlendFileWriteParams){0}, NULL); + bmain, filename, fileflags, &(const struct BlendFileWriteParams){0}, NULL); BLI_strncpy(mfu->filename, filename, sizeof(mfu->filename)); } @@ -138,7 +141,7 @@ MemFileUndoData *BKE_memfile_undo_encode(Main *bmain, MemFileUndoData *mfu_prev) if (prevfile) { BLO_memfile_clear_future(prevfile); } - /* success = */ /* UNUSED */ BLO_write_file_mem(bmain, prevfile, &mfu->memfile, G.fileflags); + /* success = */ /* UNUSED */ BLO_write_file_mem(bmain, prevfile, &mfu->memfile, fileflags); mfu->undo_size = mfu->memfile.size; } |