diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2023-10-14 02:40:59 +0300 |
---|---|---|
committer | akleshchev <117672381+akleshchev@users.noreply.github.com> | 2023-10-17 21:26:39 +0300 |
commit | a62f5bfac1e55455c67e1c36eb388af99795dab6 (patch) | |
tree | 46fed0ab92d4b9e34c2d7e7c6abfdd7c7498a238 /indra/newview/llinventorybridge.cpp | |
parent | 19ac7d18e811748c9f9c756a7830429714bc8ca2 (diff) |
SL-20232 Allow deletion of worn items #1
Diffstat (limited to 'indra/newview/llinventorybridge.cpp')
-rw-r--r-- | indra/newview/llinventorybridge.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index c41a4c5686..4d7fc41ae3 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -309,9 +309,9 @@ void LLInvFVBridge::setCreationDate(time_t creation_date_utc) // Can be destroyed (or moved to trash) -BOOL LLInvFVBridge::isItemRemovable() const +BOOL LLInvFVBridge::isItemRemovable(bool check_worn) const { - return get_is_item_removable(getInventoryModel(), mUUID); + return get_is_item_removable(getInventoryModel(), mUUID, check_worn); } // Can be moved to another folder @@ -1063,7 +1063,7 @@ void LLInvFVBridge::addDeleteContextMenuOptions(menuentry_vec_t &items, items.push_back(std::string("Delete")); - if (!isItemRemovable() || isPanelActive("Favorite Items")) + if (!isItemRemovable(false) || isPanelActive("Favorite Items")) { disabled_items.push_back(std::string("Delete")); } @@ -2405,20 +2405,21 @@ void LLFolderBridge::update() class LLIsItemRemovable : public LLFolderViewFunctor { public: - LLIsItemRemovable() : mPassed(TRUE) {} + LLIsItemRemovable(bool check_worn = true) : mPassed(TRUE), mCheckWorn(check_worn) {} virtual void doFolder(LLFolderViewFolder* folder) { - mPassed &= folder->getViewModelItem()->isItemRemovable(); + mPassed &= folder->getViewModelItem()->isItemRemovable(mCheckWorn); } virtual void doItem(LLFolderViewItem* item) { - mPassed &= item->getViewModelItem()->isItemRemovable(); + mPassed &= item->getViewModelItem()->isItemRemovable(mCheckWorn); } BOOL mPassed; + bool mCheckWorn; }; // Can be destroyed (or moved to trash) -BOOL LLFolderBridge::isItemRemovable() const +BOOL LLFolderBridge::isItemRemovable(bool check_worn) const { if (!get_is_category_removable(getInventoryModel(), mUUID)) { |