summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2014-03-20 15:17:36 -0700
committerMerov Linden <merov@lindenlab.com>2014-03-20 15:17:36 -0700
commit74c4f3d0e6ab0d5c7dc6b7480ef63b2898e7a6f2 (patch)
treebfd29b97de0358a45993dd5eb3d948beb6bfc19e
parent03622e0833fd2d2bdcc9ed3ed0c009ad9e9fee3e (diff)
DD-50 : Add the filtering code for marketplace prefiltered tabs
-rwxr-xr-xindra/newview/llinventoryfilter.cpp66
1 files changed, 24 insertions, 42 deletions
diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp
index 284c354fc6..41567c5237 100755
--- a/indra/newview/llinventoryfilter.cpp
+++ b/indra/newview/llinventoryfilter.cpp
@@ -132,6 +132,30 @@ bool LLInventoryFilter::checkFolder(const LLUUID& folder_id) const
LLInventoryModelBackgroundFetch::instance().start(folder_id);
}
+ // Marketplace folder filtering
+ const U32 filterTypes = mFilterOps.mFilterTypes;
+ if (filterTypes & FILTERTYPE_MARKETPLACE_ACTIVE)
+ {
+ if (!LLMarketplaceData::instance().getActivationState(folder_id))
+ {
+ return false;
+ }
+ }
+ if (filterTypes & FILTERTYPE_MARKETPLACE_INACTIVE)
+ {
+ if (LLMarketplaceData::instance().getActivationState(folder_id))
+ {
+ return false;
+ }
+ }
+ if (filterTypes & FILTERTYPE_MARKETPLACE_UNASSOCIATED)
+ {
+ if (!LLMarketplaceData::instance().getListingID(folder_id).empty())
+ {
+ return false;
+ }
+ }
+
// Always check against the clipboard
const BOOL passed_clipboard = checkAgainstClipboard(folder_id);
@@ -245,48 +269,6 @@ bool LLInventoryFilter::checkAgainstFilterType(const LLFolderViewModelItemInvent
}
}
- ////////////////////////////////////////////////////////////////////////////////
- // FILTERTYPE_MARKETPLACE_ACTIVE
- // Pass if this item is a folder and is active
- if (filterTypes & FILTERTYPE_MARKETPLACE_ACTIVE)
- {
- if (object_type == LLInventoryType::IT_CATEGORY)
- {
- if (LLMarketplaceData::instance().getActivationState(object_id))
- {
- return FALSE;
- }
- }
- }
-
- ////////////////////////////////////////////////////////////////////////////////
- // FILTERTYPE_MARKETPLACE_INACTIVE
- // Pass if this item is a folder and is not active
- if (filterTypes & FILTERTYPE_MARKETPLACE_INACTIVE)
- {
- if (object_type == LLInventoryType::IT_CATEGORY)
- {
- if (!LLMarketplaceData::instance().getActivationState(object_id))
- {
- return FALSE;
- }
- }
- }
-
- ////////////////////////////////////////////////////////////////////////////////
- // FILTERTYPE_MARKETPLACE_UNASSOCIATED
- // Pass if this item is a folder and is active
- if (filterTypes & FILTERTYPE_MARKETPLACE_UNASSOCIATED)
- {
- if (object_type == LLInventoryType::IT_CATEGORY)
- {
- if (LLMarketplaceData::instance().getListingID(object_id).empty())
- {
- return FALSE;
- }
- }
- }
-
return TRUE;
}