[Bf-blender-cvs] [558a6a45b43] master: Cleanup: Avoid misleading Outliner tree element callback name

Julian Eisel noreply at git.blender.org
Tue Aug 30 12:25:26 CEST 2022


Commit: 558a6a45b433b2280a96238bd05adeedce25af80
Author: Julian Eisel
Date:   Fri Aug 26 17:01:52 2022 +0200
Branches: master
https://developer.blender.org/rB558a6a45b433b2280a96238bd05adeedce25af80

Cleanup: Avoid misleading Outliner tree element callback name

These functions used the term "find", which makes it sound like a lookup
callback, when in fact it would add elements to a set for further
processing. So use "collect" instead.

===================================================================

M	source/blender/editors/space_outliner/outliner_collections.cc
M	source/blender/editors/space_outliner/outliner_dragdrop.cc
M	source/blender/editors/space_outliner/outliner_intern.hh
M	source/blender/editors/space_outliner/outliner_tools.cc

===================================================================

diff --git a/source/blender/editors/space_outliner/outliner_collections.cc b/source/blender/editors/space_outliner/outliner_collections.cc
index 440b77adefc..23ee8a2c3f2 100644
--- a/source/blender/editors/space_outliner/outliner_collections.cc
+++ b/source/blender/editors/space_outliner/outliner_collections.cc
@@ -88,7 +88,7 @@ Collection *outliner_collection_from_tree_element(const TreeElement *te)
   return nullptr;
 }
 
-TreeTraversalAction outliner_find_selected_collections(TreeElement *te, void *customdata)
+TreeTraversalAction outliner_collect_selected_collections(TreeElement *te, void *customdata)
 {
   struct IDsSelectedData *data = static_cast<IDsSelectedData *>(customdata);
   TreeStoreElem *tselem = TREESTORE(te);
@@ -105,7 +105,7 @@ TreeTraversalAction outliner_find_selected_collections(TreeElement *te, void *cu
   return TRAVERSE_CONTINUE;
 }
 
-TreeTraversalAction outliner_find_selected_objects(TreeElement *te, void *customdata)
+TreeTraversalAction outliner_collect_selected_objects(TreeElement *te, void *customdata)
 {
   struct IDsSelectedData *data = static_cast<IDsSelectedData *>(customdata);
   TreeStoreElem *tselem = TREESTORE(te);
@@ -136,7 +136,7 @@ void ED_outliner_selected_objects_get(const bContext *C, ListBase *objects)
                          &space_outliner->tree,
                          0,
                          TSE_SELECTED,
-                         outliner_find_selected_objects,
+                         outliner_collect_selected_objects,
                          &data);
   LISTBASE_FOREACH (LinkData *, link, &data.selected_array) {
     TreeElement *ten_selected = (TreeElement *)link->data;
@@ -296,7 +296,7 @@ struct CollectionEditData {
   bool is_liboverride_hierarchy_root_allowed;
 };
 
-static TreeTraversalAction collection_find_data_to_edit(TreeElement *te, void *customdata)
+static TreeTraversalAction collection_collect_data_to_edit(TreeElement *te, void *customdata)
 {
   CollectionEditData *data = static_cast<CollectionEditData *>(customdata);
   Collection *collection = outliner_collection_from_tree_element(te);
@@ -346,7 +346,7 @@ void outliner_collection_delete(
   /* We first walk over and find the Collections we actually want to delete
    * (ignoring duplicates). */
   outliner_tree_traverse(
-      space_outliner, &space_outliner->tree, 0, TSE_SELECTED, collection_find_data_to_edit, &data);
+      space_outliner, &space_outliner->tree, 0, TSE_SELECTED, collection_collect_data_to_edit, &data);
 
   /* Effectively delete the collections. */
   GSetIterator collections_to_edit_iter;
@@ -708,7 +708,7 @@ static int collection_link_exec(bContext *C, wmOperator *op)
 
   /* We first walk over and find the Collections we actually want to link (ignoring duplicates). */
   outliner_tree_traverse(
-      space_outliner, &space_outliner->tree, 0, TSE_SELECTED, collection_find_data_to_edit, &data);
+      space_outliner, &space_outliner->tree, 0, TSE_SELECTED, collection_collect_data_to_edit, &data);
 
   /* Effectively link the collections. */
   GSetIterator collections_to_edit_iter;
@@ -767,7 +767,7 @@ static int collection_instance_exec(bContext *C, wmOperator *UNUSED(op))
   /* We first walk over and find the Collections we actually want to instance
    * (ignoring duplicates). */
   outliner_tree_traverse(
-      space_outliner, &space_outliner->tree, 0, TSE_SELECTED, collection_find_data_to_edit, &data);
+      space_outliner, &space_outliner->tree, 0, TSE_SELECTED, collection_collect_data_to_edit, &data);
 
   /* Find an active collection to add to, that doesn't give dependency cycles. */
   LayerCollection *active_lc = BKE_layer_collection_get_active(view_layer);
@@ -824,7 +824,7 @@ void OUTLINER_OT_collection_instance(wmOperatorType *ot)
 /** \name Exclude Collection
  * \{ */
 
-static TreeTraversalAction layer_collection_find_data_to_edit(TreeElement *te, void *customdata)
+static TreeTraversalAction layer_collection_collect_data_to_edit(TreeElement *te, void *customdata)
 {
   CollectionEditData *data = static_cast<CollectionEditData *>(customdata);
   TreeStoreElem *tselem = TREESTORE(te);
@@ -869,7 +869,7 @@ static bool collections_view_layer_poll(bContext *C, bool clear, int flag)
                          &space_outliner->tree,
                          0,
                          TSE_SELECTED,
-                         layer_collection_find_data_to_edit,
+                         layer_collection_collect_data_to_edit,
                          &data);
 
   GSetIterator collections_to_edit_iter;
@@ -941,7 +941,7 @@ static int collection_view_layer_exec(bContext *C, wmOperator *op)
                          &space_outliner->tree,
                          0,
                          TSE_SELECTED,
-                         layer_collection_find_data_to_edit,
+                         layer_collection_collect_data_to_edit,
                          &data);
 
   GSetIterator collections_to_edit_iter;
@@ -1075,7 +1075,7 @@ static int collection_isolate_exec(bContext *C, wmOperator *op)
                          &space_outliner->tree,
                          0,
                          TSE_SELECTED,
-                         layer_collection_find_data_to_edit,
+                         layer_collection_collect_data_to_edit,
                          &data);
 
   GSetIterator collections_to_edit_iter;
@@ -1175,7 +1175,7 @@ static int collection_visibility_exec(bContext *C, wmOperator *op)
                          &space_outliner->tree,
                          0,
                          TSE_SELECTED,
-                         layer_collection_find_data_to_edit,
+                         layer_collection_collect_data_to_edit,
                          &data);
 
   GSetIterator collections_to_edit_iter;
@@ -1327,7 +1327,7 @@ static int collection_flag_exec(bContext *C, wmOperator *op)
                            &space_outliner->tree,
                            0,
                            TSE_SELECTED,
-                           layer_collection_find_data_to_edit,
+                           layer_collection_collect_data_to_edit,
                            &data);
     GSetIterator collections_to_edit_iter;
     GSET_ITER (collections_to_edit_iter, data.collections_to_edit) {
@@ -1356,7 +1356,7 @@ static int collection_flag_exec(bContext *C, wmOperator *op)
                            &space_outliner->tree,
                            0,
                            TSE_SELECTED,
-                           collection_find_data_to_edit,
+                           collection_collect_data_to_edit,
                            &data);
     GSetIterator collections_to_edit_iter;
     GSET_ITER (collections_to_edit_iter, data.collections_to_edit) {
@@ -1461,7 +1461,7 @@ struct OutlinerHideEditData {
 /** \name Visibility for Collection & Object Operators
  * \{ */
 
-static TreeTraversalAction outliner_hide_find_data_to_edit(TreeElement *te, void *customdata)
+static TreeTraversalAction outliner_hide_collect_data_to_edit(TreeElement *te, void *customdata)
 {
   OutlinerHideEditData *data = static_cast<OutlinerHideEditData *>(customdata);
   TreeStoreElem *tselem = TREESTORE(te);
@@ -1508,7 +1508,7 @@ static int outliner_hide_exec(bContext *C, wmOperator *UNUSED(op))
                          &space_outliner->tree,
                          0,
                          TSE_SELECTED,
-                         outliner_hide_find_data_to_edit,
+                         outliner_hide_collect_data_to_edit,
                          &data);
 
   GSetIterator collections_to_edit_iter;
@@ -1604,7 +1604,7 @@ static int outliner_color_tag_set_exec(bContext *C, wmOperator *op)
                          &space_outliner->tree,
                          0,
                          TSE_SELECTED,
-                         outliner_find_selected_collections,
+                         outliner_collect_selected_collections,
                          &selected);
 
   LISTBASE_FOREACH (LinkData *, link, &selected.selected_array) {
diff --git a/source/blender/editors/space_outliner/outliner_dragdrop.cc b/source/blender/editors/space_outliner/outliner_dragdrop.cc
index 81224fb6a2b..4a0e00b8bf1 100644
--- a/source/blender/editors/space_outliner/outliner_dragdrop.cc
+++ b/source/blender/editors/space_outliner/outliner_dragdrop.cc
@@ -1476,7 +1476,7 @@ static int outliner_item_drag_drop_invoke(bContext *C,
                              &space_outliner->tree,
                              0,
                              TSE_SELECTED,
-                             outliner_find_selected_objects,
+                             outliner_collect_selected_objects,
                              &selected);
     }
     else {
@@ -1484,7 +1484,7 @@ static int outliner_item_drag_drop_invoke(bContext *C,
                              &space_outliner->tree,
                              0,
                              TSE_SELECTED,
-                             outliner_find_selected_collections,
+                             outliner_collect_selected_collections,
                              &selected);
     }
 
diff --git a/source/blender/editors/space_outliner/outliner_intern.hh b/source/blender/editors/space_outliner/outliner_intern.hh
index 47b3dbe6152..3d91ee6b062 100644
--- a/source/blender/editors/space_outliner/outliner_intern.hh
+++ b/source/blender/editors/space_outliner/outliner_intern.hh
@@ -284,8 +284,8 @@ typedef struct IDsSelectedData {
   struct ListBase selected_array;
 } IDsSelectedData;
 
-TreeTraversalAction outliner_find_selected_collections(TreeElement *te, void *customdata);
-TreeTraversalAction outliner_find_selected_objects(TreeElement *te, void *customdata);
+TreeTraversalAction outliner_collect_selected_collections(TreeElement *te, void *customdata);
+TreeTraversalAction outliner_collect_selected_objects(TreeElement *te, void *customdata);
 
 /* outliner_draw.c ---------------------------------------------- */
 
diff --git a/source/blender/editors/space_outliner/outliner_tools.cc b/source/blender/editors/space_outliner/outliner_tools.cc
index ae6b2ee6d58..69c88f3b874 100644
--- a/source/blender/editors/space_outliner/outliner_tools.cc
+++ b/source/blender/editors/space_outliner/outliner_tool

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list