Remove "Keep Session" preference

As far as we know this wasn't widely used, and relied no storing data
in the temp dir which may be cleared on reboot.

More generally, alternative behavior for a core area like file IO
is not something to keep if it has unresolved issues.

See D4310 for details.
This commit is contained in:
Campbell Barton 2019-02-08 08:36:52 +11:00
parent 0abf754748
commit 7fdda18ca1
5 changed files with 3 additions and 21 deletions

View File

@ -1282,7 +1282,6 @@ class USERPREF_PT_saveload_blend_autosave(PreferencePanel):
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
flow.prop(paths, "use_keep_session")
flow.prop(paths, "use_auto_save_temporary_files")
sub = flow.column()
sub.active = paths.use_auto_save_temporary_files

View File

@ -901,7 +901,7 @@ typedef enum eUserpref_UI_Flag {
/** #UserDef.uiflag2 */
typedef enum eUserpref_UI_Flag2 {
USER_KEEP_SESSION = (1 << 0),
// USER_FLAG2_DEPRECATED = (1 << 0), /* TODO: clear */
USER_REGION_OVERLAP = (1 << 1),
USER_TRACKPAD_NATURAL = (1 << 2),
} eUserpref_UI_Flag2;

View File

@ -4983,11 +4983,6 @@ static void rna_def_userdef_filepaths(BlenderRNA *brna)
"The time (in minutes) to wait between automatic temporary saves");
RNA_def_property_update(prop, 0, "rna_userdef_autosave_update");
prop = RNA_def_property(srna, "use_keep_session", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag2", USER_KEEP_SESSION);
RNA_def_property_ui_text(prop, "Keep Session",
"Always load session recovery and save it after quitting Blender");
prop = RNA_def_property(srna, "recent_files", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 0, 30);
RNA_def_property_ui_text(prop, "Recent Files", "Maximum number of recently opened files to remember");

View File

@ -312,12 +312,7 @@ void WM_init(bContext *C, int argc, const char **argv)
}
#endif
/* load last session, uses regular file reading so it has to be in end (after init py etc) */
if (U.uiflag2 & USER_KEEP_SESSION) {
/* calling WM_recover_last_session(C, NULL) has been moved to creator.c */
/* that prevents loading both the kept session, and the file on the command line */
}
else {
{
Main *bmain = CTX_data_main(C);
/* note, logic here is from wm_file_read_post,
* call functions that depend on Python being initialized. */
@ -430,7 +425,7 @@ void WM_exit_ext(bContext *C, const bool do_python)
if (!G.background) {
struct MemFile *undo_memfile = wm->undo_stack ? ED_undosys_stack_memfile_get_active(wm->undo_stack) : NULL;
if ((U.uiflag2 & USER_KEEP_SESSION) || (undo_memfile != NULL)) {
if (undo_memfile != NULL) {
/* save the undo state as quit.blend */
Main *bmain = CTX_data_main(C);
char filename[FILE_MAX];

View File

@ -467,13 +467,6 @@ int main(
/* OK we are ready for it */
#ifndef WITH_PYTHON_MODULE
main_args_setup_post(C, ba);
if (G.background == 0) {
if (!G.file_loaded)
if (U.uiflag2 & USER_KEEP_SESSION)
WM_recover_last_session(C, NULL);
}
#endif
/* Explicitly free data allocated for argument parsing: