Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2018-08-20 14:52:50 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-08-20 17:23:22 +0300
commitc9abb0fe2699478d1027667e6f527c8d60df5786 (patch)
treece6c8e5c803db6a8fc36ec998ddd416b52fa162f /source/blender/blenkernel/intern/blendfile.c
parentf1ab36d15455e18d328923d7aedfa1472842cb98 (diff)
Workspaces: replace bundled workspace.blend with embedded startup.blend.
We want these to have the same workspaces in both, so there is no reason to have two files that are identical.
Diffstat (limited to 'source/blender/blenkernel/intern/blendfile.c')
-rw-r--r--source/blender/blenkernel/intern/blendfile.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/blendfile.c b/source/blender/blenkernel/intern/blendfile.c
index b16648fd73f..abefff5e72b 100644
--- a/source/blender/blenkernel/intern/blendfile.c
+++ b/source/blender/blenkernel/intern/blendfile.c
@@ -561,12 +561,18 @@ bool BKE_blendfile_userdef_write_app_template(const char *filepath, ReportList *
return ok;
}
-WorkspaceConfigFileData *BKE_blendfile_workspace_config_read(const char *filepath, ReportList *reports)
+WorkspaceConfigFileData *BKE_blendfile_workspace_config_read(const char *filepath, const void *filebuf, int filelength, ReportList *reports)
{
BlendFileData *bfd;
WorkspaceConfigFileData *workspace_config = NULL;
- bfd = BLO_read_from_file(filepath, reports, BLO_READ_SKIP_USERDEF);
+ if (filepath) {
+ bfd = BLO_read_from_file(filepath, reports, BLO_READ_SKIP_USERDEF);
+ }
+ else {
+ bfd = BLO_read_from_memory(filebuf, filelength, reports, BLO_READ_SKIP_USERDEF);
+ }
+
if (bfd) {
workspace_config = MEM_mallocN(sizeof(*workspace_config), __func__);
workspace_config->main = bfd->main;