From c58e152236abfc1c414eb6c64783334ca9555b58 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Thu, 4 Feb 2010 14:29:43 -0500 Subject: EXT-4801 : hitting trash button for trashed items does not delete item EXT-4957 : add const correctness for LLFolderViewEventListener::isItemRemovable This checkin affects several files but is a lot less scary than it looks. It's mostly to add const correctness, and to rename isInTrash to isItemInTrash so that its naming is consistent with isItemRemovable/isItemMovable. The only functionality change is to disable the trash button when an item is already in the trash. --- indra/newview/llpanelmaininventory.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index a5a61f0c7b..1895993a8e 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -1071,7 +1071,11 @@ BOOL LLPanelMainInventory::isActionEnabled(const LLSD& userdata) { const LLUUID &item_id = (*iter); LLFolderViewItem *item = folder->getItemByID(item_id); - can_delete &= item->getListener()->isItemRemovable(); + const LLFolderViewEventListener *listener = item->getListener(); + llassert(listener); + if (!listener) return FALSE; + can_delete &= listener->isItemRemovable(); + can_delete &= !listener->isItemInTrash(); } return can_delete; } -- cgit v1.2.3