diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-06-19 08:41:07 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-06-19 09:47:12 +0300 |
commit | fade37ff07ab3b62844068a1a5d60dd74ea787f6 (patch) | |
tree | a3d8903572491de4e00bbee91c9dbe0877fc10e3 /source/blender/windowmanager/intern/wm_init_exit.c | |
parent | 5a77f643f45bdd52a70aecf7b09d8836d540b5a1 (diff) |
Writefile: move file flags to BlendFileWriteParams
This removes G_FILE_HISTORY, G_FILE_SAVE_COPY & G_FILE_USERPREFS.
Using file-flags made logic harder to follow since it's not so clear
which flags are expected to be in G.fileflags & which are meant to be
set and passed as arguments, these are shared between read & write
functions too.
Add BlendFileWriteParams so options which don't need to be stored
aren't mixed up with flags that are stored for reuse.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_init_exit.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_init_exit.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c index 27aa9c532e5..e0d2127ba51 100644 --- a/source/blender/windowmanager/intern/wm_init_exit.c +++ b/source/blender/windowmanager/intern/wm_init_exit.c @@ -494,13 +494,15 @@ void WM_exit_ex(bContext *C, const bool do_python) Main *bmain = CTX_data_main(C); char filename[FILE_MAX]; bool has_edited; - int fileflags = G.fileflags & ~(G_FILE_COMPRESS | G_FILE_HISTORY); + const int fileflags = G.fileflags & ~G_FILE_COMPRESS; BLI_join_dirfile(filename, sizeof(filename), BKE_tempdir_base(), BLENDER_QUIT_FILE); has_edited = ED_editors_flush_edits(bmain); - if ((has_edited && BLO_write_file(bmain, filename, fileflags, NULL)) || + if ((has_edited && + BLO_write_file( + bmain, filename, fileflags, &(const struct BlendFileWriteParams){0}, NULL)) || (undo_memfile && BLO_memfile_write_file(undo_memfile, filename))) { printf("Saved session recovery to '%s'\n", filename); } |