From 8e6d54e7b90befda29dcb4f1ffb83ae6e60d0f97 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Thu, 11 May 2017 17:18:43 +0300 Subject: MAINT-7403 Disallow emptying Trash while in the Recent tab of Inventory --- indra/newview/llinventorybridge.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index bf4a2301ae..e944e3830f 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3870,6 +3870,13 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items } if(trash_id == mUUID) { + bool is_recent_panel = false; + LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE); + if (active_panel && (active_panel->getName() == "Recent Items")) + { + is_recent_panel = true; + } + // This is the trash. items.push_back(std::string("Empty Trash")); @@ -3877,7 +3884,7 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items 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()) + if ((0 == cat_array->size() && 0 == item_array->size()) || is_recent_panel) { disabled_items.push_back(std::string("Empty Trash")); } -- cgit v1.2.3