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>2022-01-14 21:19:22 +0300
committerJulian Eisel <julian@blender.org>2022-01-14 21:26:04 +0300
commit67517c7d5c08a32d7a2f01bd2804d165aa6963c8 (patch)
tree4e85b115e70591eb33e8408f32b93fabf5f7a2af
parent41495707d207db94db238e0bce5bd2dd90cbdbef (diff)
Cleanup: Outliner function names, simplify struct initialization
-rw-r--r--source/blender/editors/space_outliner/outliner_draw.cc2
-rw-r--r--source/blender/editors/space_outliner/outliner_tree.cc7
-rw-r--r--source/blender/editors/space_outliner/tree/tree_display.hh5
-rw-r--r--source/blender/editors/space_outliner/tree/tree_element.cc2
-rw-r--r--source/blender/editors/space_outliner/tree/tree_element.hh2
5 files changed, 10 insertions, 8 deletions
diff --git a/source/blender/editors/space_outliner/outliner_draw.cc b/source/blender/editors/space_outliner/outliner_draw.cc
index bc4b4e4f3b8..6de8d9539a9 100644
--- a/source/blender/editors/space_outliner/outliner_draw.cc
+++ b/source/blender/editors/space_outliner/outliner_draw.cc
@@ -2185,7 +2185,7 @@ static bool outliner_draw_warning_tree_element(uiBlock *block,
int icon = ICON_NONE;
const char *tip = "";
- const bool has_warning = outliner_element_warnings_get(te, &icon, &tip);
+ const bool has_warning = tree_element_warnings_get(te, &icon, &tip);
BLI_assert(has_warning);
UNUSED_VARS_NDEBUG(has_warning);
diff --git a/source/blender/editors/space_outliner/outliner_tree.cc b/source/blender/editors/space_outliner/outliner_tree.cc
index 92e12756b16..edf9abdd0b8 100644
--- a/source/blender/editors/space_outliner/outliner_tree.cc
+++ b/source/blender/editors/space_outliner/outliner_tree.cc
@@ -1116,7 +1116,7 @@ TreeElement *outliner_add_element(SpaceOutliner *space_outliner,
}
}
- if (outliner_element_warnings_get(te, nullptr, nullptr)) {
+ if (tree_element_warnings_get(te, nullptr, nullptr)) {
te->flag |= TE_HAS_WARNING;
}
@@ -1887,10 +1887,7 @@ void outliner_build_tree(Main *mainvar,
/* All tree displays should be created as sub-classes of AbstractTreeDisplay. */
BLI_assert(space_outliner->runtime->tree_display != nullptr);
- TreeSourceData source_data{};
- source_data.bmain = mainvar;
- source_data.scene = scene;
- source_data.view_layer = view_layer;
+ TreeSourceData source_data{*mainvar, *scene, *view_layer};
space_outliner->tree = space_outliner->runtime->tree_display->buildTree(source_data);
if ((space_outliner->flag & SO_SKIP_SORT_ALPHA) == 0) {
diff --git a/source/blender/editors/space_outliner/tree/tree_display.hh b/source/blender/editors/space_outliner/tree/tree_display.hh
index c14a5f133cf..8005b7d17dd 100644
--- a/source/blender/editors/space_outliner/tree/tree_display.hh
+++ b/source/blender/editors/space_outliner/tree/tree_display.hh
@@ -56,6 +56,11 @@ struct TreeSourceData {
Main *bmain;
Scene *scene;
ViewLayer *view_layer;
+
+ TreeSourceData(Main &bmain, Scene &scene, ViewLayer &view_layer)
+ : bmain(&bmain), scene(&scene), view_layer(&view_layer)
+ {
+ }
};
/* -------------------------------------------------------------------- */
diff --git a/source/blender/editors/space_outliner/tree/tree_element.cc b/source/blender/editors/space_outliner/tree/tree_element.cc
index 7afbe6efb6b..ea78f70f86d 100644
--- a/source/blender/editors/space_outliner/tree/tree_element.cc
+++ b/source/blender/editors/space_outliner/tree/tree_element.cc
@@ -105,7 +105,7 @@ void tree_element_expand(const AbstractTreeElement &tree_element, SpaceOutliner
tree_element.postExpand(space_outliner);
}
-bool outliner_element_warnings_get(TreeElement *te, int *r_icon, const char **r_message)
+bool tree_element_warnings_get(TreeElement *te, int *r_icon, const char **r_message)
{
TreeStoreElem *tselem = te->store_elem;
diff --git a/source/blender/editors/space_outliner/tree/tree_element.hh b/source/blender/editors/space_outliner/tree/tree_element.hh
index ac8c923fb60..aca5738b91a 100644
--- a/source/blender/editors/space_outliner/tree/tree_element.hh
+++ b/source/blender/editors/space_outliner/tree/tree_element.hh
@@ -107,6 +107,6 @@ void tree_element_expand(const AbstractTreeElement &tree_element, SpaceOutliner
* \param r_message The message to display as warning.
* \return true if there is a warning, false otherwise.
*/
-bool outliner_element_warnings_get(struct TreeElement *te, int *r_icon, const char **r_message);
+bool tree_element_warnings_get(struct TreeElement *te, int *r_icon, const char **r_message);
} // namespace blender::ed::outliner