diff options
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_blendfile.h | 6 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/blender_undo.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/blendfile.c | 10 |
3 files changed, 4 insertions, 14 deletions
diff --git a/source/blender/blenkernel/BKE_blendfile.h b/source/blender/blenkernel/BKE_blendfile.h index 76c05b0411a..7fc27321fc7 100644 --- a/source/blender/blenkernel/BKE_blendfile.h +++ b/source/blender/blenkernel/BKE_blendfile.h @@ -32,12 +32,6 @@ struct ReportList; struct UserDef; struct bContext; -enum { - BKE_BLENDFILE_READ_FAIL = 0, /* no load */ - BKE_BLENDFILE_READ_OK = 1, /* OK */ - BKE_BLENDFILE_READ_OK_USERPREFS = 2, /* OK, and with new user settings */ -}; - int BKE_blendfile_read(struct bContext *C, const char *filepath, const struct BlendFileReadParams *params, diff --git a/source/blender/blenkernel/intern/blender_undo.c b/source/blender/blenkernel/intern/blender_undo.c index 6c077ac75ba..7c12747283c 100644 --- a/source/blender/blenkernel/intern/blender_undo.c +++ b/source/blender/blenkernel/intern/blender_undo.c @@ -73,7 +73,7 @@ bool BKE_memfile_undo_decode(MemFileUndoData *mfu, bContext *C) G.fileflags |= G_FILE_NO_UI; if (UNDO_DISK) { - success = (BKE_blendfile_read(C, mfu->filename, NULL, 0) != BKE_BLENDFILE_READ_FAIL); + success = BKE_blendfile_read(C, mfu->filename, NULL, 0); } else { success = BKE_blendfile_read_from_memfile( diff --git a/source/blender/blenkernel/intern/blendfile.c b/source/blender/blenkernel/intern/blendfile.c index afbd2627a2a..6b71e7e8d43 100644 --- a/source/blender/blenkernel/intern/blendfile.c +++ b/source/blender/blenkernel/intern/blendfile.c @@ -405,7 +405,7 @@ int BKE_blendfile_read(bContext *C, ReportList *reports) { BlendFileData *bfd; - int retval = BKE_BLENDFILE_READ_OK; + bool success = false; /* don't print user-pref loading */ if (strstr(filepath, BLENDER_STARTUP_FILE) == NULL) { @@ -414,26 +414,22 @@ int BKE_blendfile_read(bContext *C, bfd = BLO_read_from_file(filepath, params->skip_flags, reports); if (bfd) { - if (bfd->user) { - retval = BKE_BLENDFILE_READ_OK_USERPREFS; - } - if (0 == handle_subversion_warning(bfd->main, reports)) { BKE_main_free(bfd->main); MEM_freeN(bfd); bfd = NULL; - retval = BKE_BLENDFILE_READ_FAIL; } else { setup_app_blend_file_data(C, bfd, filepath, params, reports); BLO_blendfiledata_free(bfd); + success = true; } } else { BKE_reports_prependf(reports, "Loading '%s' failed: ", filepath); } - return (bfd ? retval : BKE_BLENDFILE_READ_FAIL); + return success; } bool BKE_blendfile_read_from_memory(bContext *C, |