Fix T66940, T67005, T60651: append workspace from old startup file fails

Don't try to use old screens as workspaces, just leave them out of the menu.

Differential Revision: https://developer.blender.org/D5270
This commit is contained in:
Brecht Van Lommel 2019-07-16 16:06:50 +02:00
parent 91f539b384
commit 1f1d302950
Notes: blender-bot 2023-02-14 07:39:46 +01:00
Referenced by issue #67005, Unable to add previously closed workspace from the menu bar
Referenced by issue #66940, Can't add Workspace from general section - Blender RC1
Referenced by issue #60651, Adding new workspaces from old startup files fails
1 changed files with 7 additions and 2 deletions

View File

@ -670,9 +670,14 @@ WorkspaceConfigFileData *BKE_blendfile_workspace_config_read(const char *filepat
}
if (bfd) {
workspace_config = MEM_mallocN(sizeof(*workspace_config), __func__);
workspace_config = MEM_callocN(sizeof(*workspace_config), __func__);
workspace_config->main = bfd->main;
workspace_config->workspaces = bfd->main->workspaces;
/* Only 2.80+ files have actual workspaces, don't try to use screens
* from older versions. */
if (bfd->main->versionfile >= 280) {
workspace_config->workspaces = bfd->main->workspaces;
}
MEM_freeN(bfd);
}