From f9503bdf8c209858aa9fbf8db3b9f90465ad8ae3 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 8 Jan 2025 20:56:01 +0200 Subject: #3353 Fix favorited items not being readded on parent removal --- indra/newview/llinventorypanel.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'indra') 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(model_item); + // Todo: Consider implementing and checking hasFavorites to save on search + if (cat) + { + // re-add any favorited children + mBuildRootQueue.emplace_back(id); + } + } } } -- cgit v1.2.3