diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-11-22 06:57:41 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-11-22 07:06:14 +0300 |
commit | c66570f519fb24e0c3fb724d7b6d38f4b6fd7ffc (patch) | |
tree | 78d0c03da4ada3bfb64e39b8f686a419f2c84395 /source/blender/windowmanager | |
parent | 968bf0df148c6fac7567860a64433daa97d042c9 (diff) |
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.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/intern/wm_files.c | 21 |
1 files changed, 17 insertions, 4 deletions
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) { |