forked from bartvdbraak/blender
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:
parent
da7ce6a3cc
commit
073669dd85
@ -841,6 +841,14 @@ int wm_file_write(bContext *C, const char *target, int fileflags, ReportList *re
|
||||
|
||||
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 (!(fileflags & G_FILE_SAVE_COPY)) {
|
||||
G.relbase_valid = 1;
|
||||
|
@ -2037,6 +2037,8 @@ void wm_recover_last_session(bContext *C, ReportList *reports)
|
||||
/* XXX bad global... fixme */
|
||||
if (G.main->name[0])
|
||||
G.file_loaded = 1; /* prevents splash to show */
|
||||
else
|
||||
G.relbase_valid = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user