diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2009-12-04 19:01:31 -0500 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2009-12-04 19:01:31 -0500 |
commit | 16efeb85817cce82e594cf8482f5e52385a59ad1 (patch) | |
tree | 85878d4b882faa0157d1be26dc6e0e28d582c218 /indra/newview/llinventorymodel.cpp | |
parent | f017058345ba1bc2682051017d3f9c0d6ea3db72 (diff) | |
parent | 938c51d2a483962556ee183c24e2b3f635f2c56b (diff) |
merge
--HG--
branch : avatar-pipeline
Diffstat (limited to 'indra/newview/llinventorymodel.cpp')
-rw-r--r-- | indra/newview/llinventorymodel.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 29096ff718..fb9be1e04f 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -211,6 +211,25 @@ BOOL LLInventoryModel::isObjectDescendentOf(const LLUUID& obj_id, return FALSE; } +const LLViewerInventoryCategory *LLInventoryModel::getFirstNondefaultParent(const LLUUID& obj_id) const +{ + const LLInventoryObject* obj = getObject(obj_id); + const LLUUID& parent_id = obj->getParentUUID(); + while (!parent_id.isNull()) + { + const LLViewerInventoryCategory *cat = getCategory(parent_id); + if (!cat) break; + const LLFolderType::EType folder_type = cat->getPreferredType(); + if (folder_type != LLFolderType::FT_NONE && + folder_type != LLFolderType::FT_ROOT_INVENTORY && + !LLFolderType::lookupIsEnsembleType(folder_type)) + { + return cat; + } + } + return NULL; +} + // Get the object by id. Returns NULL if not found. LLInventoryObject* LLInventoryModel::getObject(const LLUUID& id) const { |