summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llinventorypanel.cpp20
-rw-r--r--indra/newview/llinventorypanel.h1
2 files changed, 18 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();
diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h
index 45373bd47a..473283352f 100644
--- a/indra/newview/llinventorypanel.h
+++ b/indra/newview/llinventorypanel.h
@@ -252,6 +252,7 @@ public:
static void setSFViewAndOpenFolder(const LLInventoryPanel* panel, const LLUUID& folder_id);
void addItemID(const LLUUID& id, LLFolderViewItem* itemp);
virtual void removeItemID(const LLUUID& id);
+ virtual bool isInRootContent(const LLUUID& id, LLFolderViewItem* view_item) { return false; }
LLFolderViewItem* getItemByID(const LLUUID& id);
LLFolderViewFolder* getFolderByID(const LLUUID& id);
void setSelectionByID(const LLUUID& obj_id, bool take_keyboard_focus);