summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2010-06-25 16:07:27 -0400
committerLoren Shih <seraph@lindenlab.com>2010-06-25 16:07:27 -0400
commit913923850051409047d7df83cb005e3d270b5e3a (patch)
tree977990bfc4570483a04d1729b6ffab4c00874ce3
parent4eca0ee2be0529fc85b0b36c614fefebf2d75244 (diff)
EXT-7914 FIXED Current outfit can be removed via My Inventory -> Trash button
Now disabling remove if an outfit is linked in the COF.
-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 37088064c6..8940339265 100644
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -282,7 +282,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)
{
@@ -296,17 +298,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;
}