diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2014-10-10 13:48:48 +0400 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2014-10-10 14:04:44 +0400 |
commit | 585d2f31a9c438bddb63842b2f160236323e355b (patch) | |
tree | 5be3850a4c2bff63988d9cada710a84c1ab7554e /source/blender/windowmanager | |
parent | c2d6de8e200742d480c41643efb377d2a76e0bc8 (diff) |
Fix T32209 quitting not saving latest data if you are in edit or sculpt mode on
quit.blend.
This will use a slower file write if an object is in edit or sculpt
mode.
Autosaving will explicitly not be supported to keep it fast.
Added a tooltip warning.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/intern/wm_init_exit.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c index 20f5f8d3e3e..00e25d395b3 100644 --- a/source/blender/windowmanager/intern/wm_init_exit.c +++ b/source/blender/windowmanager/intern/wm_init_exit.c @@ -54,6 +54,8 @@ #include "BLI_threads.h" #include "BLI_utildefines.h" +#include "BLO_writefile.h" + #include "BKE_blender.h" #include "BKE_context.h" #include "BKE_screen.h" @@ -409,11 +411,18 @@ void WM_exit_ext(bContext *C, const bool do_python) if ((U.uiflag2 & USER_KEEP_SESSION) || BKE_undo_valid(NULL)) { /* save the undo state as quit.blend */ char filename[FILE_MAX]; - + bool has_edited; + int fileflags = G.fileflags & ~(G_FILE_COMPRESS | G_FILE_AUTOPLAY | G_FILE_LOCK | G_FILE_SIGN | G_FILE_HISTORY); + BLI_make_file_string("/", filename, BLI_temp_dir_base(), BLENDER_QUIT_FILE); - if (BKE_undo_save_file(filename)) - printf("Saved session recovery to '%s'\n", filename); + has_edited = ED_editors_flush_edits(C, false); + + if ((has_edited && BLO_write_file(CTX_data_main(C), filename, fileflags, NULL, NULL)) || + BKE_undo_save_file(filename)) + { + printf("Saved session recovery to '%s'\n", filename); + } } } |