Skip to content
Snippets Groups Projects
Commit 80f85b39 authored by Loren Shih's avatar Loren Shih
Browse files

EXT-2817 : COF contents in appearanceSP are sometimes blank on startup

COF folder was being removed from panel because its parent is outside the panel.  Added checks so that first-level children of panel root are never to be removed.

--HG--
branch : avatar-pipeline
parent a22bb005
No related branches found
No related tags found
No related merge requests found
...@@ -328,22 +328,26 @@ void LLInventoryPanel::modelChanged(U32 mask) ...@@ -328,22 +328,26 @@ void LLInventoryPanel::modelChanged(U32 mask)
// around in the panel's directory structure (i.e. reparented). // around in the panel's directory structure (i.e. reparented).
if (model_item && view_item) if (model_item && view_item)
{ {
LLFolderViewFolder* new_parent = (LLFolderViewFolder*)mFolders->getItemByID(model_item->getParentUUID()); // Don't process the item if it's hanging from the root, since its
// model_item's parent will be NULL.
// Item has been moved. if (view_item->getRoot() != view_item->getParent())
if (view_item->getParentFolder() != new_parent)
{ {
if (new_parent != NULL) LLFolderViewFolder* new_parent = (LLFolderViewFolder*)mFolders->getItemByID(model_item->getParentUUID());
{ // Item has been moved.
// Item is to be moved and we found its new parent in the panel's directory, so move the item's UI. if (view_item->getParentFolder() != new_parent)
view_item->getParentFolder()->extractItem(view_item);
view_item->addToFolder(new_parent, mFolders);
}
else
{ {
// Item is to be moved outside the panel's directory (e.g. moved to trash for a panel that if (new_parent != NULL)
// doesn't include trash). Just remove the item's UI. {
view_item->destroyView(); // Item is to be moved and we found its new parent in the panel's directory, so move the item's UI.
view_item->getParentFolder()->extractItem(view_item);
view_item->addToFolder(new_parent, mFolders);
}
else
{
// Item is to be moved outside the panel's directory (e.g. moved to trash for a panel that
// doesn't include trash). Just remove the item's UI.
view_item->destroyView();
}
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment