summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorypanel.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2025-01-09 22:41:07 +0200
committerAndrey Lihatskiy <alihatskiy@productengine.com>2025-04-11 00:32:29 +0300
commit3daf08696ec08ec9cf6344211a23bcc205112e2e (patch)
tree2479c9911410ffe8189f4b593cbdf5c0128290bc /indra/newview/llinventorypanel.cpp
parentb1fa03e224f90a2369de27c89597ad0b2a63eb6f (diff)
#3374 Fix item reparenting moving containing folder
Diffstat (limited to 'indra/newview/llinventorypanel.cpp')
-rw-r--r--indra/newview/llinventorypanel.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index 5528bfa66b..25d1175ac2 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -688,9 +688,11 @@ void LLInventoryPanel::itemChanged(const LLUUID& item_id, U32 mask, const LLInve
{
LLFolderViewModelItem* old_parent_vmi = old_parent->getViewModelItem();
LLFolderViewModelItemInventory* viewmodel_folder = static_cast<LLFolderViewModelItemInventory*>(old_parent_vmi);
- LLFolderViewFolder* new_parent = (LLFolderViewFolder*)getItemByID(model_item->getParentUUID());
- // Item has been moved.
- if (old_parent != new_parent)
+ LLFolderViewFolder* new_parent = getFolderByID(model_item->getParentUUID());
+
+ if (old_parent != new_parent // Item has been moved.
+ && (new_parent != NULL || !isInRootContent(item_id, view_item)) // item is not or shouldn't be in root content
+ )
{
if (new_parent != NULL)
{
@@ -2271,6 +2273,7 @@ public:
}
void removeItemID(const LLUUID& id) override;
+ bool isInRootContent(const LLUUID& id, LLFolderViewItem* view_item) override;
protected:
LLInventoryFavoritesItemsPanel(const Params&);
@@ -2306,6 +2309,17 @@ void LLInventoryFavoritesItemsPanel::removeItemID(const LLUUID& id)
LLInventoryPanel::removeItemID(id);
}
+bool LLInventoryFavoritesItemsPanel::isInRootContent(const LLUUID& id, LLFolderViewItem* view_item)
+{
+ if (!view_item->isFavorite())
+ {
+ return false;
+ }
+
+ std::set<LLUUID>::iterator found = mRootContentIDs.find(id);
+ return found != mRootContentIDs.end();
+}
+
void LLInventoryFavoritesItemsPanel::findAndInitRootContent(const LLUUID& id)
{
F64 curent_time = LLTimer::getTotalSeconds();