Skip to content
Snippets Groups Projects
Commit 91392385 authored by Loren Shih's avatar Loren Shih
Browse files

EXT-7914 FIXED Current outfit can be removed via My Inventory -> Trash button

Now disabling remove if an outfit is linked in the COF.
parent 4eca0ee2
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment