summaryrefslogtreecommitdiff
path: root/indra/newview/llinventoryfunctions.cpp
diff options
context:
space:
mode:
authorVadim Savchuk <vsavchuk@productengine.com>2010-06-30 17:09:16 +0300
committerVadim Savchuk <vsavchuk@productengine.com>2010-06-30 17:09:16 +0300
commit4d84caed36006e3f3e7d0468335456fe7d034e94 (patch)
treec4cc596ba8fbeafdb4a26969c8b7853d7c683ca5 /indra/newview/llinventoryfunctions.cpp
parenta7fba99d55f335f3f366cac351b782b803cdf349 (diff)
parent2f5c6456991881ca5a80f021d6d4c94739d16565 (diff)
Merge from default branch
--HG-- branch : product-engine
Diffstat (limited to 'indra/newview/llinventoryfunctions.cpp')
-rw-r--r--indra/newview/llinventoryfunctions.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index 7e9a2cb716..7463658003 100644
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -323,7 +323,9 @@ BOOL get_is_item_removable(const LLInventoryModel* model, const LLUUID& id)
BOOL get_is_category_removable(const LLInventoryModel* model, const LLUUID& id)
{
- // This function doesn't check the folder's children.
+ // NOTE: This function doesn't check the folder's children.
+ // See LLFolderBridge::isItemRemovable for a function that does
+ // consider the children.
if (!model)
{
@@ -337,17 +339,29 @@ BOOL get_is_category_removable(const LLInventoryModel* model, const LLUUID& id)
if (!isAgentAvatarValid()) return FALSE;
- LLInventoryCategory* category = model->getCategory(id);
+ const LLInventoryCategory* category = model->getCategory(id);
if (!category)
{
return FALSE;
}
- if (LLFolderType::lookupIsProtectedType(category->getPreferredType()))
+ const LLFolderType::EType folder_type = category->getPreferredType();
+
+ if (LLFolderType::lookupIsProtectedType(folder_type))
{
return FALSE;
}
+ // Can't delete the outfit that is currently being worn.
+ if (folder_type == LLFolderType::FT_OUTFIT)
+ {
+ const LLViewerInventoryItem *base_outfit_link = LLAppearanceMgr::instance().getBaseOutfitLink();
+ if (base_outfit_link && (category == base_outfit_link->getLinkedCategory()))
+ {
+ return FALSE;
+ }
+ }
+
return TRUE;
}