summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelmaininventory.cpp
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2013-02-08 22:38:54 -0800
committerMerov Linden <merov@lindenlab.com>2013-02-08 22:38:54 -0800
commit5ecac2e900054526c5e9e2fe5610f470ad06df32 (patch)
treee65cda79851337c39df8d7b693d6b753a743dc1b /indra/newview/llpanelmaininventory.cpp
parent22bc40ad60d166cd9e8ff90671a6171a1954cd9b (diff)
CHUI-735 : Fixed! Refactor the code to move isSelectionRemovable() to the LLInventoryPanel level. Use it when using the delete key.
Diffstat (limited to 'indra/newview/llpanelmaininventory.cpp')
-rw-r--r--indra/newview/llpanelmaininventory.cpp22
1 files changed, 1 insertions, 21 deletions
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp
index 82b79db60a..d6535c88e9 100644
--- a/indra/newview/llpanelmaininventory.cpp
+++ b/indra/newview/llpanelmaininventory.cpp
@@ -1112,27 +1112,7 @@ BOOL LLPanelMainInventory::isActionEnabled(const LLSD& userdata)
const std::string command_name = userdata.asString();
if (command_name == "delete")
{
- BOOL can_delete = FALSE;
- LLFolderView* root = getActivePanel()->getRootFolder();
- if (root)
- {
- can_delete = TRUE;
- std::set<LLFolderViewItem*> selection_set = root->getSelectionList();
- if (selection_set.empty()) return FALSE;
- for (std::set<LLFolderViewItem*>::iterator iter = selection_set.begin();
- iter != selection_set.end();
- ++iter)
- {
- LLFolderViewItem *item = *iter;
- const LLFolderViewModelItemInventory *listener = static_cast<const LLFolderViewModelItemInventory*>(item->getViewModelItem());
- llassert(listener);
- if (!listener) return FALSE;
- can_delete &= listener->isItemRemovable();
- can_delete &= !listener->isItemInTrash();
- }
- return can_delete;
- }
- return FALSE;
+ return getActivePanel()->isSelectionRemovable();
}
if (command_name == "save_texture")
{