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 <julian@blender.org>2020-11-07 00:28:15 +0300
committerJulian Eisel <julian@blender.org>2020-11-11 21:07:55 +0300
commitc9cc03b688230d0b898467135e75e2cbac8a3226 (patch)
tree2bbaf9e001681436086e2f50fce786abfe809229 /source/blender/editors/space_outliner/outliner_tree.c
parent249e4df110e0a5ca7ebb24a7503f922b28d10405 (diff)
UI Code Quality: General refactor of Outliner View Layer display mode creation
See https://developer.blender.org/D9499. * Turn functions into member functions (makes API for a type more obvious & local, allows implicitly sharing data through member variables, enables order independend definition of functions, allows more natural language for function names because of the obvious context). * Move important variables to classes rather than passing around all the time (shorter, more task-focused code, localizes important data names). * Add helper class for adding object children sub-trees (smaller, more focused units are easier to reason about, have higher coherence, better testability, can manage own resources easily with RAII). * Use C++ iterators over C-macros (arguably more readable, less macros is generally preferred) * Add doxygen groups (visually emphasizes the coherence of code sections, provide place for higher level comments on sections). * Prefer references over pointers for passing by reference (makes clear that NULL is not a valid value and that the current scope is not the owner).
Diffstat (limited to 'source/blender/editors/space_outliner/outliner_tree.c')
-rw-r--r--source/blender/editors/space_outliner/outliner_tree.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c
index 874d35112a5..84b59da26c1 100644
--- a/source/blender/editors/space_outliner/outliner_tree.c
+++ b/source/blender/editors/space_outliner/outliner_tree.c
@@ -2321,7 +2321,8 @@ void outliner_build_tree(Main *mainvar,
outliner_tree_view_destroy(&space_outliner->runtime->tree_view);
TreeSourceData source_data = {.bmain = mainvar, .scene = scene, .view_layer = view_layer};
- space_outliner->runtime->tree_view = outliner_tree_view_create(space_outliner->outlinevis);
+ space_outliner->runtime->tree_view = outliner_tree_view_create(space_outliner->outlinevis,
+ space_outliner);
space_outliner->tree = outliner_tree_view_build_tree(
space_outliner->runtime->tree_view, &source_data, space_outliner);