diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2025-01-08 20:56:01 +0200 |
---|---|---|
committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2025-04-11 00:29:35 +0300 |
commit | f9503bdf8c209858aa9fbf8db3b9f90465ad8ae3 (patch) | |
tree | 1e8cca597f14242634a182903dcbf8f21f20eb6f /indra | |
parent | 7bffdd74af173f1419b990167616f763ec43c396 (diff) |
#3353 Fix favorited items not being readded on parent removal
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llinventorypanel.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index aba17c99d0..bcdd548cb6 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -2273,6 +2273,7 @@ protected: void findAndInitRootContent(const LLUUID& folder_id) override; void initRootContent() override; + // removeFavorite removes item from root, does not readd favorited children if present bool removeFavorite(const LLUUID& id, const LLInventoryObject* model_item); void itemChanged(const LLUUID& item_id, U32 mask, const LLInventoryObject* model_item) override; @@ -2435,6 +2436,7 @@ void LLInventoryFavoritesItemsPanel::itemChanged(const LLUUID& id, U32 mask, con if (cat->getPreferredType() != LLFolderType::FT_TRASH) { // If any descendants were in the list, remove them + // Todo: Consider implementing and checking hasFavorites to save on search LLFavoritesCollector is_favorite; LLInventoryModel::cat_array_t cat_array; LLInventoryModel::item_array_t item_array; @@ -2475,6 +2477,16 @@ void LLInventoryFavoritesItemsPanel::itemChanged(const LLUUID& id, U32 mask, con else { handled = removeFavorite(id, model_item); + if (handled) + { + const LLViewerInventoryCategory* cat = dynamic_cast<const LLViewerInventoryCategory*>(model_item); + // Todo: Consider implementing and checking hasFavorites to save on search + if (cat) + { + // re-add any favorited children + mBuildRootQueue.emplace_back(id); + } + } } } |