diff options
author | Jonathan Yap <jhwelch@gmail.com> | 2015-01-06 13:21:38 -0500 |
---|---|---|
committer | Jonathan Yap <jhwelch@gmail.com> | 2015-01-06 13:21:38 -0500 |
commit | 4422fd381230056cf990129087a131d4c6139120 (patch) | |
tree | b196b6df42b59afa56d2f8ebd8b73b0d34284c6b | |
parent | 0db67883470dc3e4381672bfbb40f3ef920a4a01 (diff) |
STORM-2091 A few small changes per code review requests.
-rw-r--r-- | indra/newview/llinventorybridge.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llpanelmaininventory.cpp | 16 |
2 files changed, 12 insertions, 6 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 07a14fe53c..199c90c705 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3739,6 +3739,7 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items LLInventoryModel::cat_array_t* cat_array; LLInventoryModel::item_array_t* item_array; gInventory.getDirectDescendentsOf(mUUID, cat_array, item_array); + // Enable Empty menu item only when there is something to act upon. if (0 == cat_array->size() && 0 == item_array->size()) { disabled_items.push_back(std::string("Empty Lost And Found")); @@ -3792,6 +3793,7 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items LLInventoryModel::cat_array_t* cat_array; LLInventoryModel::item_array_t* item_array; gInventory.getDirectDescendentsOf(mUUID, cat_array, item_array); + // Enable Empty menu item only when there is something to act upon. if (0 == cat_array->size() && 0 == item_array->size()) { disabled_items.push_back(std::string("Empty Trash")); diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index e646d889dd..f9ec3df333 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -1196,13 +1196,17 @@ BOOL LLPanelMainInventory::isActionEnabled(const LLSD& userdata) const std::string command_name = userdata.asString(); if (command_name == "not_empty") { + BOOL status = FALSE; 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 (current_item) + { + 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); + status = (0 == cat_array->size() && 0 == item_array->size()); + } + return status; } if (command_name == "delete") { |