diff options
| author | Mike Antipov <mantipov@productengine.com> | 2010-01-25 14:48:39 +0200 |
|---|---|---|
| committer | Mike Antipov <mantipov@productengine.com> | 2010-01-25 14:48:39 +0200 |
| commit | eff95bbea9bb9234e9df9fca7f5bc033f1b99358 (patch) | |
| tree | c390c131bffaa95f2c100941cce02ec20186c390 /indra/newview/llappearancemgr.cpp | |
| parent | 088056c5bf4adc589c7fcc65236b90a466e59705 (diff) | |
| parent | 7094921d1f235ff45cc5b3ef58b64c2812c8676f (diff) | |
Merge with default branch
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview/llappearancemgr.cpp')
| -rw-r--r-- | indra/newview/llappearancemgr.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 61d60fdff9..03180b6a9d 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -428,7 +428,7 @@ static void onWearableAssetFetch(LLWearable* wearable, void* data) holder->mResolved += 1; } -LLUUID LLAppearanceManager::getCOF() +const LLUUID LLAppearanceManager::getCOF() const { return gInventory.findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT); } @@ -1311,3 +1311,23 @@ void LLAppearanceManager::linkRegisteredAttachments() } mRegisteredAttachments.clear(); } + +BOOL LLAppearanceManager::getIsInCOF(const LLUUID& obj_id) const +{ + return gInventory.isObjectDescendentOf(obj_id, getCOF()); +} + +BOOL LLAppearanceManager::getIsProtectedCOFItem(const LLUUID& obj_id) const +{ + if (!getIsInCOF(obj_id)) return FALSE; + const LLInventoryObject *obj = gInventory.getObject(obj_id); + if (!obj) return FALSE; + + // Can't delete bodyparts, since this would be equivalent to removing the item. + if (obj->getType() == LLAssetType::AT_BODYPART) return TRUE; + + // Can't delete the folder link, since this is saved for bookkeeping. + if (obj->getActualType() == LLAssetType::AT_LINK_FOLDER) return TRUE; + + return FALSE; +} |
