diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-03-15 19:54:58 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-03-15 20:02:24 +0300 |
commit | c832354e330c575a5c450cf0febebb7cc058df87 (patch) | |
tree | ab8fa9d05934abf70b06db0839fbea425fd83264 /source/blender/blenkernel/intern/blendfile.c | |
parent | c44cdd5905d3112a46a984b8d49710fb1c1546a0 (diff) |
Load user-preferences before startup file
Internal change needed for template support.
Loading the user preferences first so it's possible
for preferences to control startup behavior.
In general it's useful to load preferences before data-files,
so we know security settings for eg.
Diffstat (limited to 'source/blender/blenkernel/intern/blendfile.c')
-rw-r--r-- | source/blender/blenkernel/intern/blendfile.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/blendfile.c b/source/blender/blenkernel/intern/blendfile.c index 54f709a1e5b..146c67576ef 100644 --- a/source/blender/blenkernel/intern/blendfile.c +++ b/source/blender/blenkernel/intern/blendfile.c @@ -349,7 +349,9 @@ static int handle_subversion_warning(Main *main, ReportList *reports) return 1; } -int BKE_blendfile_read(bContext *C, const char *filepath, ReportList *reports) +int BKE_blendfile_read( + bContext *C, const char *filepath, + ReportList *reports, int skip_flags) { BlendFileData *bfd; int retval = BKE_BLENDFILE_READ_OK; @@ -357,9 +359,11 @@ int BKE_blendfile_read(bContext *C, const char *filepath, ReportList *reports) if (strstr(filepath, BLENDER_STARTUP_FILE) == NULL) /* don't print user-pref loading */ printf("read blend: %s\n", filepath); - bfd = BLO_read_from_file(filepath, reports); + bfd = BLO_read_from_file(filepath, reports, skip_flags); if (bfd) { - if (bfd->user) retval = BKE_BLENDFILE_READ_OK_USERPREFS; + if (bfd->user) { + retval = BKE_BLENDFILE_READ_OK_USERPREFS; + } if (0 == handle_subversion_warning(bfd->main, reports)) { BKE_main_free(bfd->main); @@ -379,11 +383,11 @@ int BKE_blendfile_read(bContext *C, const char *filepath, ReportList *reports) bool BKE_blendfile_read_from_memory( bContext *C, const void *filebuf, int filelength, - ReportList *reports, bool update_defaults) + ReportList *reports, int skip_flags, bool update_defaults) { BlendFileData *bfd; - bfd = BLO_read_from_memory(filebuf, filelength, reports); + bfd = BLO_read_from_memory(filebuf, filelength, reports, skip_flags); if (bfd) { if (update_defaults) BLO_update_defaults_startup_blend(bfd->main); @@ -399,11 +403,11 @@ bool BKE_blendfile_read_from_memory( /* memfile is the undo buffer */ bool BKE_blendfile_read_from_memfile( bContext *C, struct MemFile *memfile, - ReportList *reports) + ReportList *reports, int skip_flags) { BlendFileData *bfd; - bfd = BLO_read_from_memfile(CTX_data_main(C), G.main->name, memfile, reports); + bfd = BLO_read_from_memfile(CTX_data_main(C), G.main->name, memfile, reports, skip_flags); if (bfd) { /* remove the unused screens and wm */ while (bfd->main->wm.first) @@ -426,7 +430,7 @@ int BKE_blendfile_read_userdef(const char *filepath, ReportList *reports) BlendFileData *bfd; int retval = BKE_BLENDFILE_READ_FAIL; - bfd = BLO_read_from_file(filepath, reports); + bfd = BLO_read_from_file(filepath, reports, 0); if (bfd) { if (bfd->user) { retval = BKE_BLENDFILE_READ_OK_USERPREFS; |