summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2009-11-24 20:14:01 -0500
committerLoren Shih <seraph@lindenlab.com>2009-11-24 20:14:01 -0500
commit80f85b39378bf63741c93ffc306c8bede67ea727 (patch)
tree3e4f4b179bf6156c8b2d10f6ffa20845927c434c /indra/newview
parenta22bb00530bb779d8e5bb40b68e55767604d88dc (diff)
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
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llinventorypanel.cpp32
1 files changed, 18 insertions, 14 deletions
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index 47201b2ccc..7168c33ce2 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -328,22 +328,26 @@ void LLInventoryPanel::modelChanged(U32 mask)
// around in the panel's directory structure (i.e. reparented).
if (model_item && view_item)
{
- LLFolderViewFolder* new_parent = (LLFolderViewFolder*)mFolders->getItemByID(model_item->getParentUUID());
-
- // Item has been moved.
- if (view_item->getParentFolder() != new_parent)
+ // Don't process the item if it's hanging from the root, since its
+ // model_item's parent will be NULL.
+ if (view_item->getRoot() != view_item->getParent())
{
- if (new_parent != NULL)
- {
- // 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
+ LLFolderViewFolder* new_parent = (LLFolderViewFolder*)mFolders->getItemByID(model_item->getParentUUID());
+ // Item has been moved.
+ if (view_item->getParentFolder() != new_parent)
{
- // 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();
+ if (new_parent != NULL)
+ {
+ // 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();
+ }
}
}
}