diff options
| author | Erik Kundiman <erik@megapahit.org> | 2025-03-07 16:44:21 +0800 |
|---|---|---|
| committer | Erik Kundiman <erik@megapahit.org> | 2025-03-07 16:44:21 +0800 |
| commit | 266e96605781960799dc5388cc1ac168432ff106 (patch) | |
| tree | 5f46ae7d39a8a954ea9f79dc7216cad6aca2ee6a /indra/newview/llinventorymodel.cpp | |
| parent | 530ff898b00d1759ab4abb32dcf9767960ce7170 (diff) | |
| parent | bf949ce004c25917aabddd1cd24be812713e4602 (diff) | |
Merge branch '2024.12-ForeverFPS'
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); |
