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:
authorJulian Eisel <eiseljulian@gmail.com>2019-09-20 16:35:28 +0300
committerJulian Eisel <eiseljulian@gmail.com>2019-09-20 16:35:28 +0300
commitb20182e334180d751acff4565d2cf061dcb90add (patch)
treede1e3124d21cc98fce6b46773aff8d2e5c8249b9 /source/blender/blenloader
parentd1cc340e56691cb82e444289415ede24ba4d2bc0 (diff)
Refactor: Ensure there's always a valid file editor tool region
So far the file browser code had some lazy creation for the tool region, even though it should always be there. The only reason I can see for this is compatiblity. So I simply added versioning code to add the region in case it's not there. Now we should be able to savely assume the tool region to be there, whithout any unusual lazy-creation.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/versioning_280.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index 477a93f9858..257f43f4b9f 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -3877,6 +3877,17 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
}
}
}
+ else if (sl->spacetype == SPACE_FILE) {
+ ListBase *regionbase = (sl == sa->spacedata.first) ? &sa->regionbase : &sl->regionbase;
+
+ if (!do_versions_find_region_or_null(regionbase, RGN_TYPE_TOOLS)) {
+ ARegion *ar_ui = do_versions_find_region(regionbase, RGN_TYPE_UI);
+ ARegion *ar_tools = do_versions_add_region(RGN_TYPE_TOOLS,
+ "versioning file tools region");
+ BLI_insertlinkafter(regionbase, ar_ui, ar_tools);
+ ar_tools->alignment = RGN_ALIGN_LEFT;
+ }
+ }
}
}
}