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.
meow-7.2.2
Loren Shih 2010-03-30 16:24:18 -04:00
parent 094700f499
commit d7002c0695
2 changed files with 44 additions and 45 deletions

View File

@ -31,10 +31,12 @@
*/
#include "llviewerprecompiledheaders.h"
#include "llinventorybridge.h"
// external projects
#include "lltransfersourceasset.h"
#include "llinventorybridge.h"
#include "llagent.h"
#include "llagentcamera.h"
@ -1923,50 +1925,6 @@ BOOL move_inv_category_world_to_agent(const LLUUID& object_id,
return accept;
}
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;
}
//Used by LLFolderBridge as callback for directory recursion.
class LLRightClickInventoryFetchObserver : public LLInventoryFetchObserver
{

View File

@ -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
///----------------------------------------------------------------------------