diff options
author | Erik Kundiman <erik@megapahit.org> | 2025-02-18 17:50:06 +0800 |
---|---|---|
committer | Erik Kundiman <erik@megapahit.org> | 2025-02-18 17:50:06 +0800 |
commit | 4bf9c1314565bbca8ca62db994e201de7c5a97b7 (patch) | |
tree | 9e118846d4abb1fa6edccbcc615beac8b7f8972a /indra/newview/llinventorymodel.cpp | |
parent | 54afd71f42d8bc15217dd14d3924661bd9aaa044 (diff) | |
parent | 0679cbdec89fbd3ec470768bdf469f6a1d326859 (diff) |
Merge commit '0679cbdec89fbd3ec470768bdf469f6a1d326859' into tmp
Diffstat (limited to 'indra/newview/llinventorymodel.cpp')
-rw-r--r-- | indra/newview/llinventorymodel.cpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 53ea02983a..b6ff31a7ed 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); |