diff options
author | Erik Kundiman <erik@megapahit.org> | 2025-08-21 06:33:49 +0800 |
---|---|---|
committer | Erik Kundiman <erik@megapahit.org> | 2025-08-21 06:33:49 +0800 |
commit | b3e00b61a9126a54383cc52c356d0c488d2ec91d (patch) | |
tree | 487b6aa41fbf524fbf0d6eead502424d6cc33d0b /indra/newview/llinventorypanel.cpp | |
parent | 2d8948ef173c5bfc37834301f4aa4fb72e78f03c (diff) | |
parent | 143de1ddbf4489c490d16cc8cbf0eca688a81b43 (diff) |
Merge tag 'Second_Life_Release#143de1dd-2025.06' into 2025.06
Diffstat (limited to 'indra/newview/llinventorypanel.cpp')
-rw-r--r-- | indra/newview/llinventorypanel.cpp | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 6f073d7023..a06e64b1dc 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -2304,6 +2304,7 @@ public: void removeItemID(const LLUUID& id) override; bool isInRootContent(const LLUUID& id, LLFolderViewItem* view_item) override; + bool hasPredecessorsInRootContent(const LLInventoryObject* model_item) const; protected: LLInventoryFavoritesItemsPanel(const Params&); @@ -2350,6 +2351,24 @@ bool LLInventoryFavoritesItemsPanel::isInRootContent(const LLUUID& id, LLFolderV return found != mRootContentIDs.end(); } +bool LLInventoryFavoritesItemsPanel::hasPredecessorsInRootContent(const LLInventoryObject* obj) const +{ + LLUUID parent_id = obj->getParentUUID(); + while (parent_id.notNull()) + { + if (mRootContentIDs.contains(parent_id)) + { + return true; + } + LLViewerInventoryCategory* cat = mInventory->getCategory(parent_id); + if (cat) + { + parent_id = cat->getParentUUID(); + } + } + return false; +} + void LLInventoryFavoritesItemsPanel::findAndInitRootContent(const LLUUID& id) { F64 curent_time = LLTimer::getTotalSeconds(); @@ -2501,7 +2520,8 @@ void LLInventoryFavoritesItemsPanel::itemChanged(const LLUUID& id, U32 mask, con } LLFolderViewItem* folder_view_item = getItemByID(cat->getUUID()); - if (!folder_view_item) + if (!folder_view_item + && !hasPredecessorsInRootContent(model_item)) { const LLUUID& parent_id = cat->getParentUUID(); mRootContentIDs.emplace(cat->getUUID()); @@ -2513,7 +2533,9 @@ void LLInventoryFavoritesItemsPanel::itemChanged(const LLUUID& id, U32 mask, con else { // New favorite item - if (model_item->getIsFavorite() && typedViewsFilter(id, model_item)) + if (model_item->getIsFavorite() + && typedViewsFilter(id, model_item) + && !hasPredecessorsInRootContent(model_item)) { const LLUUID& parent_id = model_item->getParentUUID(); mRootContentIDs.emplace(id); |