summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorygallerymenu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llinventorygallerymenu.cpp')
-rw-r--r--indra/newview/llinventorygallerymenu.cpp43
1 files changed, 3 insertions, 40 deletions
diff --git a/indra/newview/llinventorygallerymenu.cpp b/indra/newview/llinventorygallerymenu.cpp
index 2bca33dec4..4b47346473 100644
--- a/indra/newview/llinventorygallerymenu.cpp
+++ b/indra/newview/llinventorygallerymenu.cpp
@@ -388,43 +388,6 @@ bool is_inbox_folder(LLUUID item_id)
return gInventory.isObjectDescendentOf(item_id, inbox_id);
}
-bool is_category_removable(const LLUUID &folder_id, bool check_worn)
-{
- if (!get_is_category_removable(&gInventory, folder_id))
- {
- return false;
- }
-
- // check children
- LLInventoryModel::cat_array_t* cat_array;
- LLInventoryModel::item_array_t* item_array;
- gInventory.getDirectDescendentsOf(folder_id, cat_array, item_array);
-
- for (LLInventoryModel::item_array_t::value_type& item : *item_array)
- {
- if (!get_is_item_removable(&gInventory, item->getUUID(), check_worn))
- {
- return false;
- }
- }
-
- for (LLInventoryModel::cat_array_t::value_type& cat : *cat_array)
- {
- if (!is_category_removable(cat->getUUID(), check_worn))
- {
- return false;
- }
- }
-
- const LLUUID mp_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS);
- if (mp_id.notNull() && gInventory.isObjectDescendentOf(folder_id, mp_id))
- {
- return false;
- }
-
- return true;
-}
-
void LLInventoryGalleryContextMenu::updateMenuItemsVisibility(LLContextMenu* menu)
{
LLUUID selected_id = mUUIDs.front();
@@ -532,7 +495,7 @@ void LLInventoryGalleryContextMenu::updateMenuItemsVisibility(LLContextMenu* men
}
}
items.push_back(std::string("Purge Item"));
- if (is_folder && !is_category_removable(selected_id, true))
+ if (is_folder && !get_is_category_and_children_removable(&gInventory, selected_id, true))
{
disabled_items.push_back(std::string("Purge Item"));
}
@@ -580,12 +543,12 @@ void LLInventoryGalleryContextMenu::updateMenuItemsVisibility(LLContextMenu* men
items.push_back(std::string("Cut"));
items.push_back(std::string("Delete"));
- if(!is_category_removable(selected_id, false))
+ if(!get_is_category_and_children_removable(&gInventory, selected_id, false))
{
disabled_items.push_back(std::string("Delete"));
disabled_items.push_back(std::string("Cut"));
}
- else if (!is_category_removable(selected_id, true))
+ else if (!get_is_category_and_children_removable(&gInventory, selected_id, true))
{
disabled_items.push_back(std::string("Cut"));
}