summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorymodel.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2025-02-19 14:06:26 +0200
committerGitHub <noreply@github.com>2025-02-19 14:06:26 +0200
commit8c1f00eebc6863c39d0143aeb7e37c68459d454f (patch)
treeb3c32a7800e8424d20145d198d548cac550b7956 /indra/newview/llinventorymodel.cpp
parentfd0227c52c1e45fc3ae7abd90a14d7077b1cfdd1 (diff)
parent8114850e947f2a76e54912524722c48f22851228 (diff)
Merge Forever Fps into 2025.03
Merge Forever Fps into 2025.03
Diffstat (limited to 'indra/newview/llinventorymodel.cpp')
-rw-r--r--indra/newview/llinventorymodel.cpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp
index d57cb13362..9fffe6378e 100644
--- a/indra/newview/llinventorymodel.cpp
+++ b/indra/newview/llinventorymodel.cpp
@@ -1305,6 +1305,47 @@ void LLInventoryModel::collectDescendentsIf(const LLUUID& id,
}
}
+bool LLInventoryModel::hasMatchingDescendents(const LLUUID& id,
+ bool include_trash,
+ LLInventoryCollectFunctor& matches)
+{
+ if (!include_trash)
+ {
+ const LLUUID trash_id = findCategoryUUIDForType(LLFolderType::FT_TRASH);
+ if (trash_id.notNull() && (trash_id == id))
+ return false;
+ }
+ cat_array_t* cat_array = get_ptr_in_map(mParentChildCategoryTree, id);
+ if (cat_array)
+ {
+ for (auto& cat : *cat_array)
+ {
+ if (matches(cat, NULL))
+ {
+ return true;
+ }
+ if (hasMatchingDescendents(cat->getUUID(), include_trash, matches))
+ {
+ return true;
+ }
+ }
+ }
+
+ item_array_t* item_array = get_ptr_in_map(mParentChildItemTree, id);
+
+ if (item_array)
+ {
+ for (auto& item : *item_array)
+ {
+ if (matches(NULL, item))
+ {
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
void LLInventoryModel::addChangedMaskForLinks(const LLUUID& object_id, U32 mask)
{
const LLInventoryObject *obj = getObject(object_id);