diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-10-02 18:17:31 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-10-03 00:25:36 +0300 |
commit | 28a2c84948cc2296dd86c5ddfc208035328a7b67 (patch) | |
tree | 8b6e383ebe68cf17f536fab138c51195e9978e17 /source/blender/blenkernel | |
parent | 8cd8b3e9bda443ec8f560117d93a4f06fe91cb11 (diff) |
Cleanup: remove unused code in blend file loading
v2.4x could cancel loading files that warned of being a newer,
unsupported version.
Remove this logic since it's no longer in use.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/blendfile.c | 41 |
1 files changed, 12 insertions, 29 deletions
diff --git a/source/blender/blenkernel/intern/blendfile.c b/source/blender/blenkernel/intern/blendfile.c index fc1911d0394..9dabbb021b6 100644 --- a/source/blender/blenkernel/intern/blendfile.c +++ b/source/blender/blenkernel/intern/blendfile.c @@ -413,7 +413,7 @@ static void setup_app_blend_file_data(bContext *C, } } -static bool handle_subversion_warning(Main *main, ReportList *reports) +static void handle_subversion_warning(Main *main, ReportList *reports) { if (main->minversionfile > BLENDER_FILE_VERSION || (main->minversionfile == BLENDER_FILE_VERSION && @@ -424,8 +424,6 @@ static bool handle_subversion_warning(Main *main, ReportList *reports) main->minversionfile, main->minsubversionfile); } - - return true; } bool BKE_blendfile_read_ex(bContext *C, @@ -436,37 +434,27 @@ bool BKE_blendfile_read_ex(bContext *C, const bool startup_update_defaults, const char *startup_app_template) { - BlendFileData *bfd; - bool success = false; /* Don't print startup file loading. */ if (params->is_startup == false) { printf("Read blend: %s\n", filepath); } - bfd = BLO_read_from_file(filepath, params->skip_flags, reports); + BlendFileData *bfd = BLO_read_from_file(filepath, params->skip_flags, reports); if (bfd) { - if (!handle_subversion_warning(bfd->main, reports)) { - BKE_main_free(bfd->main); - MEM_freeN(bfd); - bfd = NULL; - } - else { - if (startup_update_defaults) { - if ((params->skip_flags & BLO_READ_SKIP_DATA) == 0) { - BLO_update_defaults_startup_blend(bfd->main, startup_app_template); - } + handle_subversion_warning(bfd->main, reports); + if (startup_update_defaults) { + if ((params->skip_flags & BLO_READ_SKIP_DATA) == 0) { + BLO_update_defaults_startup_blend(bfd->main, startup_app_template); } - setup_app_blend_file_data(C, bfd, filepath, params, reports); - BLO_blendfiledata_free(bfd); - success = true; } + setup_app_blend_file_data(C, bfd, filepath, params, reports); + BLO_blendfiledata_free(bfd); } else { BKE_reports_prependf(reports, "Loading '%s' failed: ", filepath); } - - return success; + return (bfd != NULL); } bool BKE_blendfile_read(bContext *C, @@ -486,9 +474,7 @@ bool BKE_blendfile_read_from_memory_ex(bContext *C, const bool startup_update_defaults, const char *startup_app_template) { - BlendFileData *bfd; - - bfd = BLO_read_from_memory(filebuf, filelength, params->skip_flags, reports); + BlendFileData *bfd = BLO_read_from_memory(filebuf, filelength, params->skip_flags, reports); if (bfd) { if (startup_update_defaults) { if ((params->skip_flags & BLO_READ_SKIP_DATA) == 0) { @@ -501,7 +487,6 @@ bool BKE_blendfile_read_from_memory_ex(bContext *C, else { BKE_reports_prepend(reports, "Loading failed: "); } - return (bfd != NULL); } @@ -521,9 +506,8 @@ bool BKE_blendfile_read_from_memfile(bContext *C, ReportList *reports) { Main *bmain = CTX_data_main(C); - BlendFileData *bfd; - - bfd = BLO_read_from_memfile(bmain, BKE_main_blendfile_path(bmain), memfile, params, reports); + BlendFileData *bfd = BLO_read_from_memfile( + bmain, BKE_main_blendfile_path(bmain), memfile, params, reports); if (bfd) { /* Removing the unused workspaces, screens and wm is useless here, setup_app_data will switch * those lists with the ones from old bmain, which freeing is much more efficient than @@ -539,7 +523,6 @@ bool BKE_blendfile_read_from_memfile(bContext *C, else { BKE_reports_prepend(reports, "Loading failed: "); } - return (bfd != NULL); } |