summaryrefslogtreecommitdiff
path: root/indra/newview/llinventoryfilter.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2020-09-22 22:54:36 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2020-09-22 22:54:36 +0300
commitc2b55c4362111c124df30eb339461486bda32ec9 (patch)
tree841267dade995551e9d1ab8f39ab98c7a56174db /indra/newview/llinventoryfilter.cpp
parente566e82269ff52a88e3dc28345bba6c273a2eebf (diff)
parent60ed688026269568a9eef67437dc780f88c92871 (diff)
Merged master(DRTVWR-503) into DRTVWR-514-keymappings
Diffstat (limited to 'indra/newview/llinventoryfilter.cpp')
-rw-r--r--indra/newview/llinventoryfilter.cpp90
1 files changed, 61 insertions, 29 deletions
diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp
index 745b953996..72013f7396 100644
--- a/indra/newview/llinventoryfilter.cpp
+++ b/indra/newview/llinventoryfilter.cpp
@@ -192,10 +192,15 @@ bool LLInventoryFilter::checkFolder(const LLUUID& folder_id) const
// when applying a filter, matching folders get their contents downloaded first
// but make sure we are not interfering with pre-download
if (isNotDefault()
- && !gInventory.isCategoryComplete(folder_id)
&& LLStartUp::getStartupState() > STATE_WEARABLES_WAIT)
- {
- LLInventoryModelBackgroundFetch::instance().start(folder_id);
+ {
+ LLViewerInventoryCategory* cat = gInventory.getCategory(folder_id);
+ if (!cat || (cat->getVersion() == LLViewerInventoryCategory::VERSION_UNKNOWN))
+ {
+ // At the moment background fetch only cares about VERSION_UNKNOWN,
+ // so do not check isCategoryComplete that compares descendant count
+ LLInventoryModelBackgroundFetch::instance().start(folder_id);
+ }
}
// Marketplace folder filtering
@@ -287,21 +292,34 @@ bool LLInventoryFilter::checkAgainstFilterType(const LLFolderViewModelItemInvent
// Pass if this item's type is of the correct filter type
if (filterTypes & FILTERTYPE_OBJECT)
{
-
- // If it has no type, pass it, unless it's a link.
- if (object_type == LLInventoryType::IT_NONE)
- {
- if (object && object->getIsLinkType())
- {
- return FALSE;
- }
- }
- else if ((1LL << object_type & mFilterOps.mFilterObjectTypes) == U64(0))
- {
- return FALSE;
- }
+ switch (object_type)
+ {
+ case LLInventoryType::IT_NONE:
+ // If it has no type, pass it, unless it's a link.
+ if (object && object->getIsLinkType())
+ {
+ return FALSE;
+ }
+ break;
+ case LLInventoryType::IT_UNKNOWN:
+ {
+ // Unknows are only shown when we show every type.
+ // Unknows are 255 and won't fit in 64 bits.
+ if (mFilterOps.mFilterObjectTypes != 0xffffffffffffffffULL)
+ {
+ return FALSE;
+ }
+ break;
+ }
+ default:
+ if ((1LL << object_type & mFilterOps.mFilterObjectTypes) == U64(0))
+ {
+ return FALSE;
+ }
+ break;
+ }
}
-
+
if(filterTypes & FILTERTYPE_WORN)
{
if (!get_is_item_worn(object_id))
@@ -426,18 +444,32 @@ bool LLInventoryFilter::checkAgainstFilterType(const LLInventoryItem* item) cons
// Pass if this item's type is of the correct filter type
if (filterTypes & FILTERTYPE_OBJECT)
{
- // If it has no type, pass it, unless it's a link.
- if (object_type == LLInventoryType::IT_NONE)
- {
- if (item && item->getIsLinkType())
- {
- return false;
- }
- }
- else if ((1LL << object_type & mFilterOps.mFilterObjectTypes) == U64(0))
- {
- return false;
- }
+ switch (object_type)
+ {
+ case LLInventoryType::IT_NONE:
+ // If it has no type, pass it, unless it's a link.
+ if (item && item->getIsLinkType())
+ {
+ return FALSE;
+ }
+ break;
+ case LLInventoryType::IT_UNKNOWN:
+ {
+ // Unknows are only shown when we show every type.
+ // Unknows are 255 and won't fit in 64 bits.
+ if (mFilterOps.mFilterObjectTypes != 0xffffffffffffffffULL)
+ {
+ return FALSE;
+ }
+ break;
+ }
+ default:
+ if ((1LL << object_type & mFilterOps.mFilterObjectTypes) == U64(0))
+ {
+ return FALSE;
+ }
+ break;
+ }
}
////////////////////////////////////////////////////////////////////////////////