diff options
| author | Jonathan Yap <jhwelch@gmail.com> | 2014-12-10 11:09:28 -0500 |
|---|---|---|
| committer | Jonathan Yap <jhwelch@gmail.com> | 2014-12-10 11:09:28 -0500 |
| commit | 0db67883470dc3e4381672bfbb40f3ef920a4a01 (patch) | |
| tree | 1e934597c8e97711f86844158088cb797e269614 /indra/newview/llpanelmaininventory.cpp | |
| parent | 68413474c4479eee9bdbeb34ea131475ba1d646e (diff) | |
STORM-2091 "Empty Trash"/"Empty Lost and Found" menu item is active even if empty
Diffstat (limited to 'indra/newview/llpanelmaininventory.cpp')
| -rw-r--r-- | indra/newview/llpanelmaininventory.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index eb40616a9c..e646d889dd 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -1194,6 +1194,16 @@ bool LLPanelMainInventory::isSaveTextureEnabled(const LLSD& userdata) BOOL LLPanelMainInventory::isActionEnabled(const LLSD& userdata) { const std::string command_name = userdata.asString(); + if (command_name == "not_empty") + { + LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem(); + if (!current_item) return FALSE; + const LLUUID& item_id = static_cast<LLFolderViewModelItemInventory*>(current_item->getViewModelItem())->getUUID(); + LLInventoryModel::cat_array_t* cat_array; + LLInventoryModel::item_array_t* item_array; + gInventory.getDirectDescendentsOf(item_id, cat_array, item_array); + return (0 == cat_array->size() && 0 == item_array->size()); + } if (command_name == "delete") { return getActivePanel()->isSelectionRemovable(); |
