diff options
Diffstat (limited to 'linden/indra/newview/llfolderview.cpp')
-rw-r--r-- | linden/indra/newview/llfolderview.cpp | 61 |
1 files changed, 45 insertions, 16 deletions
diff --git a/linden/indra/newview/llfolderview.cpp b/linden/indra/newview/llfolderview.cpp index 1402d24..8e010b8 100644 --- a/linden/indra/newview/llfolderview.cpp +++ b/linden/indra/newview/llfolderview.cpp | |||
@@ -4480,7 +4480,7 @@ LLInventoryFilter::LLInventoryFilter(const std::string& name) : | |||
4480 | mModified(FALSE), | 4480 | mModified(FALSE), |
4481 | mNeedTextRebuild(TRUE) | 4481 | mNeedTextRebuild(TRUE) |
4482 | { | 4482 | { |
4483 | mFilterOps.mFilterTypes = 0xffffffff; | 4483 | mFilterOps.mFilterTypes = LLInventoryType::NIT_ALL; |
4484 | mFilterOps.mMinDate = time_min(); | 4484 | mFilterOps.mMinDate = time_min(); |
4485 | mFilterOps.mMaxDate = time_max(); | 4485 | mFilterOps.mMaxDate = time_max(); |
4486 | mFilterOps.mHoursAgo = 0; | 4486 | mFilterOps.mHoursAgo = 0; |
@@ -4491,6 +4491,7 @@ LLInventoryFilter::LLInventoryFilter(const std::string& name) : | |||
4491 | 4491 | ||
4492 | mSubStringMatchOffset = 0; | 4492 | mSubStringMatchOffset = 0; |
4493 | mFilterSubString.clear(); | 4493 | mFilterSubString.clear(); |
4494 | mFilterWorn = false; | ||
4494 | mFilterGeneration = 0; | 4495 | mFilterGeneration = 0; |
4495 | mMustPassGeneration = S32_MAX; | 4496 | mMustPassGeneration = S32_MAX; |
4496 | mMinRequiredGeneration = 0; | 4497 | mMinRequiredGeneration = 0; |
@@ -4522,9 +4523,12 @@ BOOL LLInventoryFilter::check(LLFolderViewItem* item) | |||
4522 | earliest = 0; | 4523 | earliest = 0; |
4523 | } | 4524 | } |
4524 | LLFolderViewEventListener* listener = item->getListener(); | 4525 | LLFolderViewEventListener* listener = item->getListener(); |
4526 | const LLUUID& item_id = listener->getUUID(); | ||
4525 | mSubStringMatchOffset = mFilterSubString.size() ? item->getSearchableLabel().find(mFilterSubString) : std::string::npos; | 4527 | mSubStringMatchOffset = mFilterSubString.size() ? item->getSearchableLabel().find(mFilterSubString) : std::string::npos; |
4526 | BOOL passed = (0x1 << listener->getInventoryType() & mFilterOps.mFilterTypes || listener->getInventoryType() == LLInventoryType::IT_NONE) | 4528 | BOOL passed = (listener->getNInventoryType() & mFilterOps.mFilterTypes || listener->getNInventoryType() == LLInventoryType::NIT_NONE) |
4527 | && (mFilterSubString.size() == 0 || mSubStringMatchOffset != std::string::npos) | 4529 | && (mFilterSubString.size() == 0 || mSubStringMatchOffset != std::string::npos) |
4530 | && (mFilterWorn == false || gAgent.isWearingItem(item_id) || | ||
4531 | gAgent.getAvatarObject() && gAgent.getAvatarObject()->isWearingAttachment(item_id)) | ||
4528 | && ((listener->getPermissionMask() & mFilterOps.mPermissions) == mFilterOps.mPermissions) | 4532 | && ((listener->getPermissionMask() & mFilterOps.mPermissions) == mFilterOps.mPermissions) |
4529 | && (listener->getCreationDate() >= earliest && listener->getCreationDate() <= mFilterOps.mMaxDate); | 4533 | && (listener->getCreationDate() >= earliest && listener->getCreationDate() <= mFilterOps.mMaxDate); |
4530 | return passed; | 4534 | return passed; |
@@ -4545,6 +4549,7 @@ BOOL LLInventoryFilter::isNotDefault() | |||
4545 | { | 4549 | { |
4546 | return mFilterOps.mFilterTypes != mDefaultFilterOps.mFilterTypes | 4550 | return mFilterOps.mFilterTypes != mDefaultFilterOps.mFilterTypes |
4547 | || mFilterSubString.size() | 4551 | || mFilterSubString.size() |
4552 | || mFilterWorn | ||
4548 | || mFilterOps.mPermissions != mDefaultFilterOps.mPermissions | 4553 | || mFilterOps.mPermissions != mDefaultFilterOps.mPermissions |
4549 | || mFilterOps.mMinDate != mDefaultFilterOps.mMinDate | 4554 | || mFilterOps.mMinDate != mDefaultFilterOps.mMinDate |
4550 | || mFilterOps.mMaxDate != mDefaultFilterOps.mMaxDate | 4555 | || mFilterOps.mMaxDate != mDefaultFilterOps.mMaxDate |
@@ -4553,8 +4558,9 @@ BOOL LLInventoryFilter::isNotDefault() | |||
4553 | 4558 | ||
4554 | BOOL LLInventoryFilter::isActive() | 4559 | BOOL LLInventoryFilter::isActive() |
4555 | { | 4560 | { |
4556 | return mFilterOps.mFilterTypes != 0xffffffff | 4561 | return mFilterOps.mFilterTypes != LLInventoryType::NIT_ALL |
4557 | || mFilterSubString.size() | 4562 | || mFilterSubString.size() |
4563 | || mFilterWorn | ||
4558 | || mFilterOps.mPermissions != PERM_NONE | 4564 | || mFilterOps.mPermissions != PERM_NONE |
4559 | || mFilterOps.mMinDate != time_min() | 4565 | || mFilterOps.mMinDate != time_min() |
4560 | || mFilterOps.mMaxDate != time_max() | 4566 | || mFilterOps.mMaxDate != time_max() |
@@ -4801,9 +4807,9 @@ void LLInventoryFilter::setModified(EFilterBehavior behavior) | |||
4801 | } | 4807 | } |
4802 | } | 4808 | } |
4803 | 4809 | ||
4804 | BOOL LLInventoryFilter::isFilterWith(LLInventoryType::EType t) | 4810 | BOOL LLInventoryFilter::isFilterWith(LLInventoryType::NType t) |
4805 | { | 4811 | { |
4806 | return mFilterOps.mFilterTypes & (0x01 << t); | 4812 | return mFilterOps.mFilterTypes & t; |
4807 | } | 4813 | } |
4808 | 4814 | ||
4809 | std::string LLInventoryFilter::getFilterText() | 4815 | std::string LLInventoryFilter::getFilterText() |
@@ -4813,6 +4819,11 @@ std::string LLInventoryFilter::getFilterText() | |||
4813 | return mFilterText; | 4819 | return mFilterText; |
4814 | } | 4820 | } |
4815 | 4821 | ||
4822 | return rebuildFilterText(); | ||
4823 | } | ||
4824 | |||
4825 | std::string LLInventoryFilter::rebuildFilterText() | ||
4826 | { | ||
4816 | mNeedTextRebuild = FALSE; | 4827 | mNeedTextRebuild = FALSE; |
4817 | std::string filtered_types; | 4828 | std::string filtered_types; |
4818 | std::string not_filtered_types; | 4829 | std::string not_filtered_types; |
@@ -4821,7 +4832,7 @@ std::string LLInventoryFilter::getFilterText() | |||
4821 | S32 num_filter_types = 0; | 4832 | S32 num_filter_types = 0; |
4822 | mFilterText.clear(); | 4833 | mFilterText.clear(); |
4823 | 4834 | ||
4824 | if (isFilterWith(LLInventoryType::IT_ANIMATION)) | 4835 | if (isFilterWith(LLInventoryType::NIT_ANIMATION)) |
4825 | { | 4836 | { |
4826 | filtered_types += " Animations,"; | 4837 | filtered_types += " Animations,"; |
4827 | filtered_by_type = TRUE; | 4838 | filtered_by_type = TRUE; |
@@ -4833,7 +4844,19 @@ std::string LLInventoryFilter::getFilterText() | |||
4833 | filtered_by_all_types = FALSE; | 4844 | filtered_by_all_types = FALSE; |
4834 | } | 4845 | } |
4835 | 4846 | ||
4836 | if (isFilterWith(LLInventoryType::IT_CALLINGCARD)) | 4847 | if (isFilterWith(LLInventoryType::NIT_BODYPART)) |
4848 | { | ||
4849 | filtered_types += " Body Parts,"; | ||
4850 | filtered_by_type = TRUE; | ||
4851 | num_filter_types++; | ||
4852 | } | ||
4853 | else | ||
4854 | { | ||
4855 | not_filtered_types += " Body Parts,"; | ||
4856 | filtered_by_all_types = FALSE; | ||
4857 | } | ||
4858 | |||
4859 | if (isFilterWith(LLInventoryType::NIT_CALLCARD)) | ||
4837 | { | 4860 | { |
4838 | filtered_types += " Calling Cards,"; | 4861 | filtered_types += " Calling Cards,"; |
4839 | filtered_by_type = TRUE; | 4862 | filtered_by_type = TRUE; |
@@ -4845,7 +4868,7 @@ std::string LLInventoryFilter::getFilterText() | |||
4845 | filtered_by_all_types = FALSE; | 4868 | filtered_by_all_types = FALSE; |
4846 | } | 4869 | } |
4847 | 4870 | ||
4848 | if (isFilterWith(LLInventoryType::IT_WEARABLE)) | 4871 | if (isFilterWith(LLInventoryType::NIT_CLOTHING)) |
4849 | { | 4872 | { |
4850 | filtered_types += " Clothing,"; | 4873 | filtered_types += " Clothing,"; |
4851 | filtered_by_type = TRUE; | 4874 | filtered_by_type = TRUE; |
@@ -4857,7 +4880,7 @@ std::string LLInventoryFilter::getFilterText() | |||
4857 | filtered_by_all_types = FALSE; | 4880 | filtered_by_all_types = FALSE; |
4858 | } | 4881 | } |
4859 | 4882 | ||
4860 | if (isFilterWith(LLInventoryType::IT_GESTURE)) | 4883 | if (isFilterWith(LLInventoryType::NIT_GESTURE)) |
4861 | { | 4884 | { |
4862 | filtered_types += " Gestures,"; | 4885 | filtered_types += " Gestures,"; |
4863 | filtered_by_type = TRUE; | 4886 | filtered_by_type = TRUE; |
@@ -4869,7 +4892,7 @@ std::string LLInventoryFilter::getFilterText() | |||
4869 | filtered_by_all_types = FALSE; | 4892 | filtered_by_all_types = FALSE; |
4870 | } | 4893 | } |
4871 | 4894 | ||
4872 | if (isFilterWith(LLInventoryType::IT_LANDMARK)) | 4895 | if (isFilterWith(LLInventoryType::NIT_LANDMARK)) |
4873 | { | 4896 | { |
4874 | filtered_types += " Landmarks,"; | 4897 | filtered_types += " Landmarks,"; |
4875 | filtered_by_type = TRUE; | 4898 | filtered_by_type = TRUE; |
@@ -4881,7 +4904,7 @@ std::string LLInventoryFilter::getFilterText() | |||
4881 | filtered_by_all_types = FALSE; | 4904 | filtered_by_all_types = FALSE; |
4882 | } | 4905 | } |
4883 | 4906 | ||
4884 | if (isFilterWith(LLInventoryType::IT_NOTECARD)) | 4907 | if (isFilterWith(LLInventoryType::NIT_NOTECARD)) |
4885 | { | 4908 | { |
4886 | filtered_types += " Notecards,"; | 4909 | filtered_types += " Notecards,"; |
4887 | filtered_by_type = TRUE; | 4910 | filtered_by_type = TRUE; |
@@ -4893,7 +4916,7 @@ std::string LLInventoryFilter::getFilterText() | |||
4893 | filtered_by_all_types = FALSE; | 4916 | filtered_by_all_types = FALSE; |
4894 | } | 4917 | } |
4895 | 4918 | ||
4896 | if (isFilterWith(LLInventoryType::IT_OBJECT) && isFilterWith(LLInventoryType::IT_ATTACHMENT)) | 4919 | if (isFilterWith(LLInventoryType::NIT_OBJECT)) |
4897 | { | 4920 | { |
4898 | filtered_types += " Objects,"; | 4921 | filtered_types += " Objects,"; |
4899 | filtered_by_type = TRUE; | 4922 | filtered_by_type = TRUE; |
@@ -4905,7 +4928,7 @@ std::string LLInventoryFilter::getFilterText() | |||
4905 | filtered_by_all_types = FALSE; | 4928 | filtered_by_all_types = FALSE; |
4906 | } | 4929 | } |
4907 | 4930 | ||
4908 | if (isFilterWith(LLInventoryType::IT_LSL)) | 4931 | if (isFilterWith(LLInventoryType::NIT_SCRIPT_LSL2)) |
4909 | { | 4932 | { |
4910 | filtered_types += " Scripts,"; | 4933 | filtered_types += " Scripts,"; |
4911 | filtered_by_type = TRUE; | 4934 | filtered_by_type = TRUE; |
@@ -4917,7 +4940,7 @@ std::string LLInventoryFilter::getFilterText() | |||
4917 | filtered_by_all_types = FALSE; | 4940 | filtered_by_all_types = FALSE; |
4918 | } | 4941 | } |
4919 | 4942 | ||
4920 | if (isFilterWith(LLInventoryType::IT_SOUND)) | 4943 | if (isFilterWith(LLInventoryType::NIT_SOUND)) |
4921 | { | 4944 | { |
4922 | filtered_types += " Sounds,"; | 4945 | filtered_types += " Sounds,"; |
4923 | filtered_by_type = TRUE; | 4946 | filtered_by_type = TRUE; |
@@ -4929,7 +4952,7 @@ std::string LLInventoryFilter::getFilterText() | |||
4929 | filtered_by_all_types = FALSE; | 4952 | filtered_by_all_types = FALSE; |
4930 | } | 4953 | } |
4931 | 4954 | ||
4932 | if (isFilterWith(LLInventoryType::IT_TEXTURE)) | 4955 | if (isFilterWith(LLInventoryType::NIT_TEXTURE)) |
4933 | { | 4956 | { |
4934 | filtered_types += " Textures,"; | 4957 | filtered_types += " Textures,"; |
4935 | filtered_by_type = TRUE; | 4958 | filtered_by_type = TRUE; |
@@ -4941,7 +4964,7 @@ std::string LLInventoryFilter::getFilterText() | |||
4941 | filtered_by_all_types = FALSE; | 4964 | filtered_by_all_types = FALSE; |
4942 | } | 4965 | } |
4943 | 4966 | ||
4944 | if (isFilterWith(LLInventoryType::IT_SNAPSHOT)) | 4967 | if (isFilterWith(LLInventoryType::NIT_SNAPSHOT)) |
4945 | { | 4968 | { |
4946 | filtered_types += " Snapshots,"; | 4969 | filtered_types += " Snapshots,"; |
4947 | filtered_by_type = TRUE; | 4970 | filtered_by_type = TRUE; |
@@ -4973,6 +4996,12 @@ std::string LLInventoryFilter::getFilterText() | |||
4973 | { | 4996 | { |
4974 | mFilterText += " - Since Logoff"; | 4997 | mFilterText += " - Since Logoff"; |
4975 | } | 4998 | } |
4999 | |||
5000 | if (getFilterWorn()) | ||
5001 | { | ||
5002 | mFilterText += " - Worn"; | ||
5003 | } | ||
5004 | |||
4976 | return mFilterText; | 5005 | return mFilterText; |
4977 | } | 5006 | } |
4978 | 5007 | ||