diff options
author | Loren Shih <seraph@lindenlab.com> | 2009-12-07 13:50:30 -0500 |
---|---|---|
committer | Loren Shih <seraph@lindenlab.com> | 2009-12-07 13:50:30 -0500 |
commit | ee159d8e742a7281f304fc45b692c111706d294e (patch) | |
tree | 362eb9968fa778bfdd4a300b6a0b642818a973be /indra/newview/llinventorymodel.cpp | |
parent | 3ddd6ad286c5cf24dbfd6b5e46fcb23f9ac25e19 (diff) | |
parent | 83fbe4a631ed04d620b0da2fe58b92d74764183f (diff) |
automated merge viewer2.0->viewer2.0
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 { |