diff options
author | Loren Shih <seraph@lindenlab.com> | 2010-03-30 16:24:18 -0400 |
---|---|---|
committer | Loren Shih <seraph@lindenlab.com> | 2010-03-30 16:24:18 -0400 |
commit | d7002c0695927f2135e86a837d4472886ea42eb6 (patch) | |
tree | 75314bbf572f6ac650c3ce9449ac44677938571e /indra/newview/llinventoryfunctions.cpp | |
parent | 094700f49926a1ffb0678bf83cd4670841b618f7 (diff) |
EXT-3529 : INFRASTRUCTURE : Move LLFindWearables code and others into LLInventoryFunctions
These functions are defined in LLInventoryFunctions.h but their implementation is in LLInventoryBridge... moved everything to LLInventoryFunctions.
Diffstat (limited to 'indra/newview/llinventoryfunctions.cpp')
-rw-r--r-- | indra/newview/llinventoryfunctions.cpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index ab2133d779..3e16dfea5f 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -239,6 +239,47 @@ bool LLNameCategoryCollector::operator()( return false; } +bool LLFindCOFValidItems::operator()(LLInventoryCategory* cat, + LLInventoryItem* item) +{ + // Valid COF items are: + // - links to wearables (body parts or clothing) + // - links to attachments + // - links to gestures + // - links to ensemble folders + LLViewerInventoryItem *linked_item = ((LLViewerInventoryItem*)item)->getLinkedItem(); + if (linked_item) + { + LLAssetType::EType type = linked_item->getType(); + return (type == LLAssetType::AT_CLOTHING || + type == LLAssetType::AT_BODYPART || + type == LLAssetType::AT_GESTURE || + type == LLAssetType::AT_OBJECT); + } + else + { + LLViewerInventoryCategory *linked_category = ((LLViewerInventoryItem*)item)->getLinkedCategory(); + // BAP remove AT_NONE support after ensembles are fully working? + return (linked_category && + ((linked_category->getPreferredType() == LLFolderType::FT_NONE) || + (LLFolderType::lookupIsEnsembleType(linked_category->getPreferredType())))); + } +} + +bool LLFindWearables::operator()(LLInventoryCategory* cat, + LLInventoryItem* item) +{ + if(item) + { + if((item->getType() == LLAssetType::AT_CLOTHING) + || (item->getType() == LLAssetType::AT_BODYPART)) + { + return TRUE; + } + } + return FALSE; +} + ///---------------------------------------------------------------------------- /// LLAssetIDMatches ///---------------------------------------------------------------------------- |