@@ -688,9 +688,11 @@ void LLInventoryPanel::itemChanged(const LLUUID& item_id, U32 mask, const LLInve
688
688
{
689
689
LLFolderViewModelItem* old_parent_vmi = old_parent->getViewModelItem ();
690
690
LLFolderViewModelItemInventory* viewmodel_folder = static_cast <LLFolderViewModelItemInventory*>(old_parent_vmi);
691
- LLFolderViewFolder* new_parent = (LLFolderViewFolder*)getItemByID (model_item->getParentUUID ());
692
- // Item has been moved.
693
- if (old_parent != new_parent)
691
+ LLFolderViewFolder* new_parent = getFolderByID (model_item->getParentUUID ());
692
+
693
+ if (old_parent != new_parent // Item has been moved.
694
+ && (new_parent != NULL || !isInRootContent (item_id, view_item)) // item is not or shouldn't be in root content
695
+ )
694
696
{
695
697
if (new_parent != NULL )
696
698
{
@@ -2268,6 +2270,7 @@ class LLInventoryFavoritesItemsPanel : public LLInventoryPanel
2268
2270
}
2269
2271
2270
2272
void removeItemID (const LLUUID& id) override ;
2273
+ bool isInRootContent (const LLUUID& id, LLFolderViewItem* view_item) override ;
2271
2274
2272
2275
protected:
2273
2276
LLInventoryFavoritesItemsPanel (const Params&);
@@ -2303,6 +2306,17 @@ void LLInventoryFavoritesItemsPanel::removeItemID(const LLUUID& id)
2303
2306
LLInventoryPanel::removeItemID (id);
2304
2307
}
2305
2308
2309
+ bool LLInventoryFavoritesItemsPanel::isInRootContent (const LLUUID& id, LLFolderViewItem* view_item)
2310
+ {
2311
+ if (!view_item->isFavorite ())
2312
+ {
2313
+ return false ;
2314
+ }
2315
+
2316
+ std::set<LLUUID>::iterator found = mRootContentIDs .find (id);
2317
+ return found != mRootContentIDs .end ();
2318
+ }
2319
+
2306
2320
void LLInventoryFavoritesItemsPanel::findAndInitRootContent (const LLUUID& id)
2307
2321
{
2308
2322
F64 curent_time = LLTimer::getTotalSeconds ();
0 commit comments