diff options
Diffstat (limited to 'linden/indra/newview/llfolderview.cpp')
-rw-r--r-- | linden/indra/newview/llfolderview.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/linden/indra/newview/llfolderview.cpp b/linden/indra/newview/llfolderview.cpp index cb9a379..4ef52f0 100644 --- a/linden/indra/newview/llfolderview.cpp +++ b/linden/indra/newview/llfolderview.cpp | |||
@@ -4490,6 +4490,7 @@ LLInventoryFilter::LLInventoryFilter(const std::string& name) : | |||
4490 | 4490 | ||
4491 | mSubStringMatchOffset = 0; | 4491 | mSubStringMatchOffset = 0; |
4492 | mFilterSubString.clear(); | 4492 | mFilterSubString.clear(); |
4493 | mFilterWorn = false; | ||
4493 | mFilterGeneration = 0; | 4494 | mFilterGeneration = 0; |
4494 | mMustPassGeneration = S32_MAX; | 4495 | mMustPassGeneration = S32_MAX; |
4495 | mMinRequiredGeneration = 0; | 4496 | mMinRequiredGeneration = 0; |
@@ -4521,9 +4522,12 @@ BOOL LLInventoryFilter::check(LLFolderViewItem* item) | |||
4521 | earliest = 0; | 4522 | earliest = 0; |
4522 | } | 4523 | } |
4523 | LLFolderViewEventListener* listener = item->getListener(); | 4524 | LLFolderViewEventListener* listener = item->getListener(); |
4525 | const LLUUID& item_id = listener->getUUID(); | ||
4524 | mSubStringMatchOffset = mFilterSubString.size() ? item->getSearchableLabel().find(mFilterSubString) : std::string::npos; | 4526 | mSubStringMatchOffset = mFilterSubString.size() ? item->getSearchableLabel().find(mFilterSubString) : std::string::npos; |
4525 | BOOL passed = (listener->getNInventoryType() & mFilterOps.mFilterTypes || listener->getNInventoryType() == LLInventoryType::NIT_NONE) | 4527 | BOOL passed = (listener->getNInventoryType() & mFilterOps.mFilterTypes || listener->getNInventoryType() == LLInventoryType::NIT_NONE) |
4526 | && (mFilterSubString.size() == 0 || mSubStringMatchOffset != std::string::npos) | 4528 | && (mFilterSubString.size() == 0 || mSubStringMatchOffset != std::string::npos) |
4529 | && (mFilterWorn == false || gAgent.isWearingItem(item_id) || | ||
4530 | gAgent.getAvatarObject() && gAgent.getAvatarObject()->isWearingAttachment(item_id)) | ||
4527 | && ((listener->getPermissionMask() & mFilterOps.mPermissions) == mFilterOps.mPermissions) | 4531 | && ((listener->getPermissionMask() & mFilterOps.mPermissions) == mFilterOps.mPermissions) |
4528 | && (listener->getCreationDate() >= earliest && listener->getCreationDate() <= mFilterOps.mMaxDate); | 4532 | && (listener->getCreationDate() >= earliest && listener->getCreationDate() <= mFilterOps.mMaxDate); |
4529 | return passed; | 4533 | return passed; |
@@ -4544,6 +4548,7 @@ BOOL LLInventoryFilter::isNotDefault() | |||
4544 | { | 4548 | { |
4545 | return mFilterOps.mFilterTypes != mDefaultFilterOps.mFilterTypes | 4549 | return mFilterOps.mFilterTypes != mDefaultFilterOps.mFilterTypes |
4546 | || mFilterSubString.size() | 4550 | || mFilterSubString.size() |
4551 | || mFilterWorn | ||
4547 | || mFilterOps.mPermissions != mDefaultFilterOps.mPermissions | 4552 | || mFilterOps.mPermissions != mDefaultFilterOps.mPermissions |
4548 | || mFilterOps.mMinDate != mDefaultFilterOps.mMinDate | 4553 | || mFilterOps.mMinDate != mDefaultFilterOps.mMinDate |
4549 | || mFilterOps.mMaxDate != mDefaultFilterOps.mMaxDate | 4554 | || mFilterOps.mMaxDate != mDefaultFilterOps.mMaxDate |
@@ -4554,6 +4559,7 @@ BOOL LLInventoryFilter::isActive() | |||
4554 | { | 4559 | { |
4555 | return mFilterOps.mFilterTypes != LLInventoryType::NIT_ALL | 4560 | return mFilterOps.mFilterTypes != LLInventoryType::NIT_ALL |
4556 | || mFilterSubString.size() | 4561 | || mFilterSubString.size() |
4562 | || mFilterWorn | ||
4557 | || mFilterOps.mPermissions != PERM_NONE | 4563 | || mFilterOps.mPermissions != PERM_NONE |
4558 | || mFilterOps.mMinDate != time_min() | 4564 | || mFilterOps.mMinDate != time_min() |
4559 | || mFilterOps.mMaxDate != time_max() | 4565 | || mFilterOps.mMaxDate != time_max() |
@@ -4989,6 +4995,12 @@ std::string LLInventoryFilter::rebuildFilterText() | |||
4989 | { | 4995 | { |
4990 | mFilterText += " - Since Logoff"; | 4996 | mFilterText += " - Since Logoff"; |
4991 | } | 4997 | } |
4998 | |||
4999 | if (getFilterWorn()) | ||
5000 | { | ||
5001 | mFilterText += " - Worn"; | ||
5002 | } | ||
5003 | |||
4992 | return mFilterText; | 5004 | return mFilterText; |
4993 | } | 5005 | } |
4994 | 5006 | ||