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.
This commit is contained in:
2018-11-22 14:57:41 +11:00
parent 968bf0df14
commit c66570f519
10 changed files with 74 additions and 34 deletions

View File

@@ -319,7 +319,8 @@ void BLO_blendhandle_close(BlendHandle *bh)
*/
BlendFileData *BLO_read_from_file(
const char *filepath,
ReportList *reports, eBLOReadSkip skip_flags)
eBLOReadSkip skip_flags,
ReportList *reports)
{
BlendFileData *bfd = NULL;
FileData *fd;
@@ -346,7 +347,8 @@ BlendFileData *BLO_read_from_file(
*/
BlendFileData *BLO_read_from_memory(
const void *mem, int memsize,
ReportList *reports, eBLOReadSkip skip_flags)
eBLOReadSkip skip_flags,
ReportList *reports)
{
BlendFileData *bfd = NULL;
FileData *fd;
@@ -370,7 +372,8 @@ BlendFileData *BLO_read_from_memory(
*/
BlendFileData *BLO_read_from_memfile(
Main *oldmain, const char *filename, MemFile *memfile,
ReportList *reports, eBLOReadSkip skip_flags)
eBLOReadSkip skip_flags,
ReportList *reports)
{
BlendFileData *bfd = NULL;
FileData *fd;

View File

@@ -130,7 +130,7 @@ void memfile_chunk_add(
struct Main *BLO_memfile_main_get(struct MemFile *memfile, struct Main *oldmain, struct Scene **r_scene)
{
struct Main *bmain_undo = NULL;
BlendFileData *bfd = BLO_read_from_memfile(oldmain, BKE_main_blendfile_path(oldmain), memfile, NULL, BLO_READ_SKIP_NONE);
BlendFileData *bfd = BLO_read_from_memfile(oldmain, BKE_main_blendfile_path(oldmain), memfile, BLO_READ_SKIP_NONE, NULL);
if (bfd) {
bmain_undo = bfd->main;