Bug fix, irc submitted:

On saving a first .blend after startup, the file would load back as if it was not
saved (showing no name in header). 

The whole FILEFLAGS and G.relabase_valid and G.file_saved etc is messy.
This commit fixes issues, but only adds more mess :)

Will discuss a nicer implementation of all of this.
This commit is contained in:
Ton Roosendaal 2012-12-14 18:54:22 +00:00
parent da7ce6a3cc
commit 073669dd85
2 changed files with 10 additions and 0 deletions

@ -841,6 +841,14 @@ int wm_file_write(bContext *C, const char *target, int fileflags, ReportList *re
fileflags |= G_FILE_HISTORY; /* write file history */ fileflags |= G_FILE_HISTORY; /* write file history */
/* first time saving */
/* XXX temp solution to solve bug, real fix coming (ton) */
if (G.main->name[0] == 0)
BLI_strncpy(G.main->name, filepath, sizeof(G.main->name));
/* XXX temp solution to solve bug, real fix coming (ton) */
G.main->recovered = 0;
if (BLO_write_file(CTX_data_main(C), filepath, fileflags, reports, thumb)) { if (BLO_write_file(CTX_data_main(C), filepath, fileflags, reports, thumb)) {
if (!(fileflags & G_FILE_SAVE_COPY)) { if (!(fileflags & G_FILE_SAVE_COPY)) {
G.relbase_valid = 1; G.relbase_valid = 1;

@ -2037,6 +2037,8 @@ void wm_recover_last_session(bContext *C, ReportList *reports)
/* XXX bad global... fixme */ /* XXX bad global... fixme */
if (G.main->name[0]) if (G.main->name[0])
G.file_loaded = 1; /* prevents splash to show */ G.file_loaded = 1; /* prevents splash to show */
else
G.relbase_valid = 0;
} }
} }