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
path: root/source
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2021-03-02 00:43:40 +0300
committerHans Goudey <h.goudey@me.com>2021-03-02 00:43:40 +0300
commit3084f6a8e0ee65af624fd57bd7f7f15472dc68e6 (patch)
tree3bf9b84178fc2671b82ac5039800ac0195f90024 /source
parent6c6b1c015c570e728b007cd94723eb2c711bec4b (diff)
Cleanup: Rename node UI storage function
"ensure" makes more sense in this case because the function actually adds an item to the map if one doesn't exist yet.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/node_ui_storage.cc15
1 files changed, 7 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/node_ui_storage.cc b/source/blender/blenkernel/intern/node_ui_storage.cc
index ea492c4d36a..d3473eedae0 100644
--- a/source/blender/blenkernel/intern/node_ui_storage.cc
+++ b/source/blender/blenkernel/intern/node_ui_storage.cc
@@ -33,7 +33,7 @@ using blender::Map;
using blender::StringRef;
using blender::Vector;
-static void ui_storage_ensure(bNodeTree &ntree)
+NodeTreeUIStorage &ui_storage_ensure(bNodeTree &ntree)
{
if (ntree.ui_storage == nullptr) {
ntree.ui_storage = new NodeTreeUIStorage();
@@ -109,12 +109,11 @@ static void node_error_message_log(bNodeTree &ntree,
}
}
-static NodeUIStorage &find_node_ui_storage(bNodeTree &ntree,
- const NodeTreeEvaluationContext &context,
- const bNode &node)
+static NodeUIStorage &node_ui_storage_ensure(bNodeTree &ntree,
+ const NodeTreeEvaluationContext &context,
+ const bNode &node)
{
- ui_storage_ensure(ntree);
- NodeTreeUIStorage &ui_storage = *ntree.ui_storage;
+ NodeTreeUIStorage &ui_storage = ui_storage_ensure(ntree);
Map<std::string, NodeUIStorage> &node_tree_ui_storage =
ui_storage.context_map.lookup_or_add_default(context);
@@ -133,7 +132,7 @@ void BKE_nodetree_error_message_add(bNodeTree &ntree,
{
node_error_message_log(ntree, node, message, type);
- NodeUIStorage &node_ui_storage = find_node_ui_storage(ntree, context, node);
+ NodeUIStorage &node_ui_storage = node_ui_storage_ensure(ntree, context, node);
node_ui_storage.warnings.append({type, std::move(message)});
}
@@ -142,6 +141,6 @@ void BKE_nodetree_attribute_hint_add(bNodeTree &ntree,
const bNode &node,
const StringRef attribute_name)
{
- NodeUIStorage &node_ui_storage = find_node_ui_storage(ntree, context, node);
+ NodeUIStorage &node_ui_storage = node_ui_storage_ensure(ntree, context, node);
node_ui_storage.attribute_name_hints.add_as(attribute_name);
}