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:
authorBastien Montagne <bastien@blender.org>2021-09-16 15:26:49 +0300
committerBastien Montagne <bastien@blender.org>2021-09-16 15:30:56 +0300
commite97653ccf3356c57100606f0a0a175dbf4676df7 (patch)
treef8a8dd65db3c1dddcaa1c8684b6a07c5b5c30ff2 /source/blender/windowmanager/intern/wm_files_link.c
parent3deb56424f2927ffe8a7ca8ef3de3fa5bc56e304 (diff)
Fix: properly implement the 'only append' execption case for WorkSpaces.
Add needed extra flag and utils to IDType to mark and check an ID type as only appendable. Note that this is only a loose user-level enforcement currently, in any case you need to be able to link an ID to append it currently, so for low-level code this does not really matter. Currently only WorkSpace and Screen ID types are marked with the new `IDTYPE_FLAGS_ONLY_APPEND` flag.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_files_link.c')
-rw-r--r--source/blender/windowmanager/intern/wm_files_link.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/source/blender/windowmanager/intern/wm_files_link.c b/source/blender/windowmanager/intern/wm_files_link.c
index 128319b8afe..adb1596c4e1 100644
--- a/source/blender/windowmanager/intern/wm_files_link.c
+++ b/source/blender/windowmanager/intern/wm_files_link.c
@@ -944,9 +944,8 @@ static bool wm_link_append_item_poll(ReportList *reports,
idcode = BKE_idtype_idcode_from_name(group);
- /* XXX For now, we do a nasty exception for workspace, forbid linking them.
- * Not nice, ultimately should be solved! */
- if (!BKE_idtype_idcode_is_linkable(idcode) && (do_append || idcode != ID_WS)) {
+ if (!BKE_idtype_idcode_is_linkable(idcode) ||
+ (!do_append && BKE_idtype_idcode_is_only_appendable(idcode))) {
if (reports) {
if (do_append) {
BKE_reportf(reports,