From 74c4f3d0e6ab0d5c7dc6b7480ef63b2898e7a6f2 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 20 Mar 2014 15:17:36 -0700 Subject: DD-50 : Add the filtering code for marketplace prefiltered tabs --- indra/newview/llinventoryfilter.cpp | 66 ++++++++++++++----------------------- 1 file 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; } -- cgit v1.2.3