From c66570f519fb24e0c3fb724d7b6d38f4b6fd7ffc Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 22 Nov 2018 14:57:41 +1100 Subject: Fix T57989: File loaded as startup The file contents was used to check if the file was a startup file. Now pass in an argument from startup loading code instead. --- source/blender/windowmanager/intern/wm_files.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'source/blender/windowmanager') diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index ef951010ba5..acb954a4b05 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -569,7 +569,10 @@ bool WM_file_read(bContext *C, const char *filepath, ReportList *reports) /* confusing this global... */ G.relbase_valid = 1; - retval = BKE_blendfile_read(C, filepath, reports, 0); + retval = BKE_blendfile_read( + C, filepath, + &(const struct BlendFileReadParams){0}, + reports); /* BKE_file_read sets new Main into context. */ Main *bmain = CTX_data_main(C); @@ -804,7 +807,13 @@ int wm_homefile_read( if (!use_factory_settings || (filepath_startup[0] != '\0')) { if (BLI_access(filepath_startup, R_OK) == 0) { - success = (BKE_blendfile_read(C, filepath_startup, NULL, skip_flags) != BKE_BLENDFILE_READ_FAIL); + success = BKE_blendfile_read( + C, filepath_startup, + &(const struct BlendFileReadParams){ + .is_startup = true, + .skip_flags = skip_flags, + }, + NULL) != BKE_BLENDFILE_READ_FAIL; } if (BLI_listbase_is_empty(&U.themes)) { if (G.debug & G_DEBUG) @@ -820,8 +829,12 @@ int wm_homefile_read( if (success == false) { success = BKE_blendfile_read_from_memory( - C, datatoc_startup_blend, datatoc_startup_blend_size, - NULL, skip_flags, true); + C, datatoc_startup_blend, datatoc_startup_blend_size, true, + &(const struct BlendFileReadParams){ + .is_startup = true, + .skip_flags = skip_flags, + }, + NULL); if (success) { if (use_userdef) { if ((skip_flags & BLO_READ_SKIP_USERDEF) == 0) { -- cgit v1.2.3