Commit: e1a361d287992fc66ad152b8d300f5b248a316f2 Author: Julian Eisel Date: Sat Nov 7 01:21:47 2020 +0100 Branches: outliner-cpp-refactor https://developer.blender.org/rBe1a361d287992fc66ad152b8d300f5b248a316f2
Cleanup: Remove redundant parameter from new Outliner tree building code =================================================================== M source/blender/editors/space_outliner/outliner_tree.c M source/blender/editors/space_outliner/tree/tree_view.cc M source/blender/editors/space_outliner/tree/tree_view.hh M source/blender/editors/space_outliner/tree/tree_view_view_layer.cc =================================================================== diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c index 84b59da26c1..4654377e7e5 100644 --- a/source/blender/editors/space_outliner/outliner_tree.c +++ b/source/blender/editors/space_outliner/outliner_tree.c @@ -2320,11 +2320,11 @@ void outliner_build_tree(Main *mainvar, outliner_storage_cleanup(space_outliner); 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); - space_outliner->tree = outliner_tree_view_build_tree( - space_outliner->runtime->tree_view, &source_data, space_outliner); + TreeSourceData source_data = {.bmain = mainvar, .scene = scene, .view_layer = view_layer}; + space_outliner->tree = outliner_tree_view_build_tree(space_outliner->runtime->tree_view, + &source_data); if (!BLI_listbase_is_empty(&space_outliner->tree)) { /* Skip. */ diff --git a/source/blender/editors/space_outliner/tree/tree_view.cc b/source/blender/editors/space_outliner/tree/tree_view.cc index 8352a23080d..629e95b3b6b 100644 --- a/source/blender/editors/space_outliner/tree/tree_view.cc +++ b/source/blender/editors/space_outliner/tree/tree_view.cc @@ -53,9 +53,7 @@ void outliner_tree_view_destroy(TreeView **tree_view) *tree_view = nullptr; } -ListBase outliner_tree_view_build_tree(TreeView *tree_view, - TreeSourceData *source_data, - SpaceOutliner *space_outliner) +ListBase outliner_tree_view_build_tree(TreeView *tree_view, TreeSourceData *source_data) { - return reinterpret_cast<AbstractTreeView *>(tree_view)->buildTree(*source_data, *space_outliner); + return reinterpret_cast<AbstractTreeView *>(tree_view)->buildTree(*source_data); } diff --git a/source/blender/editors/space_outliner/tree/tree_view.hh b/source/blender/editors/space_outliner/tree/tree_view.hh index f64e4212e52..ab23c560b21 100644 --- a/source/blender/editors/space_outliner/tree/tree_view.hh +++ b/source/blender/editors/space_outliner/tree/tree_view.hh @@ -58,7 +58,7 @@ class AbstractTreeView { * Build a tree for this view with the Blender context data given in \a source_data and the view * settings in \a space_outliner. */ - virtual Tree buildTree(const TreeSourceData &source_data, SpaceOutliner &space_outliner) = 0; + virtual Tree buildTree(const TreeSourceData &source_data) = 0; protected: /** All derived classes will need a handle to this, so storing it in the base for convenience. */ @@ -75,7 +75,7 @@ class TreeViewViewLayer final : public AbstractTreeView { public: TreeViewViewLayer(SpaceOutliner &space_outliner); - Tree buildTree(const TreeSourceData &source_data, SpaceOutliner &space_outliner) override; + Tree buildTree(const TreeSourceData &source_data) override; private: void add_view_layer(ListBase &, TreeElement &); @@ -108,9 +108,7 @@ typedef struct TreeSourceData { TreeView *outliner_tree_view_create(eSpaceOutliner_Mode mode, SpaceOutliner *space_outliner); void outliner_tree_view_destroy(TreeView **tree_view); -ListBase outliner_tree_view_build_tree(TreeView *tree_view, - TreeSourceData *source_data, - struct SpaceOutliner *space_outliner); +ListBase outliner_tree_view_build_tree(TreeView *tree_view, TreeSourceData *source_data); /* The following functions are needed to build the tree. These are calls back into C; the way * elements are created should be refactored and ported to C++ with a new design/API too. */ diff --git a/source/blender/editors/space_outliner/tree/tree_view_view_layer.cc b/source/blender/editors/space_outliner/tree/tree_view_view_layer.cc index eb7a56a83c0..35c9ff8c882 100644 --- a/source/blender/editors/space_outliner/tree/tree_view_view_layer.cc +++ b/source/blender/editors/space_outliner/tree/tree_view_view_layer.cc @@ -68,20 +68,20 @@ TreeViewViewLayer::TreeViewViewLayer(SpaceOutliner &space_outliner) { } -Tree TreeViewViewLayer::buildTree(const TreeSourceData &source_data, SpaceOutliner &space_outliner) +Tree TreeViewViewLayer::buildTree(const TreeSourceData &source_data) { Tree tree = {nullptr}; _view_layer = source_data.view_layer; - _show_objects = !(space_outliner.filter & SO_FILTER_NO_OBJECT); + _show_objects = !(_space_outliner.filter & SO_FILTER_NO_OBJECT); - const bool show_children = (space_outliner.filter & SO_FILTER_NO_CHILDREN) == 0; + const bool show_children = (_space_outliner.filter & SO_FILTER_NO_CHILDREN) == 0; - if (space_outliner.filter & SO_FILTER_NO_COLLECTION) { + if (_space_outliner.filter & SO_FILTER_NO_COLLECTION) { /* Show objects in the view layer. */ for (Base *base : List<Base>(_view_layer->object_bases)) { TreeElement *te_object = outliner_add_element( - &space_outliner, &tree, base->object, nullptr, 0, 0); + &_space_outliner, &tree, base->object, nullptr, 0, 0); te_object->directdata = base; } @@ -92,7 +92,7 @@ Tree TreeViewViewLayer::buildTree(const TreeSourceData &source_data, SpaceOutlin else { /* Show collections in the view layer. */ TreeElement &ten = *outliner_add_element( - &space_outliner, &tree, source_data.scene, nullptr, TSE_VIEW_COLLECTION_BASE, 0); + &_space_outliner, &tree, source_data.scene, nullptr, TSE_VIEW_COLLECTION_BASE, 0); ten.name = IFACE_("Scene Collection"); TREESTORE(&ten)->flag &= ~TSE_CLOSED; _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs