Fix #115697: Allow compression on auto-save files

After 0e8e219d71 / efb511a76d, memfile undo step is not used for writing
the autosave file, instead regular file saving function is used (`BLO_write_file`).
With that it is possible to compress the file when `G_FILE_COMPRESS`
flag is set.
As discussed in !132685, always compress auto-save .blend file
irrespective of `USER_FILECOMPRESS`

Pull Request: https://projects.blender.org/blender/blender/pulls/132685
This commit is contained in:
Pratik Borhade
2025-01-25 09:29:39 +01:00
committed by Pratik Borhade
parent d2930e6285
commit 2a85a27609

View File

@@ -2317,8 +2317,9 @@ void WM_autosave_write(wmWindowManager *wm, Main *bmain)
char filepath[FILE_MAX];
wm_autosave_location(filepath);
/* Save as regular blend file with recovery information. */
const int fileflags = (G.fileflags & ~G_FILE_COMPRESS) | G_FILE_RECOVER_WRITE;
/* Save as regular blend file with recovery information and always compress them, see: !132685.
*/
const int fileflags = G.fileflags | G_FILE_RECOVER_WRITE | G_FILE_COMPRESS;
/* Error reporting into console. */
BlendFileWriteParams params{};