summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorybridge.cpp
diff options
context:
space:
mode:
authorJonathan Yap <jhwelch@gmail.com>2014-12-10 11:09:28 -0500
committerJonathan Yap <jhwelch@gmail.com>2014-12-10 11:09:28 -0500
commit0db67883470dc3e4381672bfbb40f3ef920a4a01 (patch)
tree1e934597c8e97711f86844158088cb797e269614 /indra/newview/llinventorybridge.cpp
parent68413474c4479eee9bdbeb34ea131475ba1d646e (diff)
STORM-2091 "Empty Trash"/"Empty Lost and Found" menu item is active even if empty
Diffstat (limited to 'indra/newview/llinventorybridge.cpp')
-rw-r--r--indra/newview/llinventorybridge.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index eebb6a0384..07a14fe53c 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -3736,6 +3736,14 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items
// This is the lost+found folder.
items.push_back(std::string("Empty Lost And Found"));
+ LLInventoryModel::cat_array_t* cat_array;
+ LLInventoryModel::item_array_t* item_array;
+ gInventory.getDirectDescendentsOf(mUUID, cat_array, item_array);
+ if (0 == cat_array->size() && 0 == item_array->size())
+ {
+ disabled_items.push_back(std::string("Empty Lost And Found"));
+ }
+
disabled_items.push_back(std::string("New Folder"));
disabled_items.push_back(std::string("New Script"));
disabled_items.push_back(std::string("New Note"));
@@ -3780,6 +3788,14 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items
{
// This is the trash.
items.push_back(std::string("Empty Trash"));
+
+ LLInventoryModel::cat_array_t* cat_array;
+ LLInventoryModel::item_array_t* item_array;
+ gInventory.getDirectDescendentsOf(mUUID, cat_array, item_array);
+ if (0 == cat_array->size() && 0 == item_array->size())
+ {
+ disabled_items.push_back(std::string("Empty Trash"));
+ }
}
else if(isItemInTrash())
{