summaryrefslogtreecommitdiff
path: root/indra/newview/llinventoryfilter.cpp
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2011-11-18 17:22:40 -0800
committerMerov Linden <merov@lindenlab.com>2011-11-18 17:22:40 -0800
commit7c2bbfc4fc905e8fff63d58f19f5e22cd755281c (patch)
treeedf36c59ea7e9fbee610d7685e753be701754382 /indra/newview/llinventoryfilter.cpp
parentdf7f4f60b60e7d53060e4d8e3d0ca03bf74bf24e (diff)
EXP-1498, EXP-1595, EXP-1596 : Hide empty system folders in a dynamic way, turn the setting ON by default
Diffstat (limited to 'indra/newview/llinventoryfilter.cpp')
-rw-r--r--indra/newview/llinventoryfilter.cpp30
1 files changed, 20 insertions, 10 deletions
diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp
index 438081c177..bc02540281 100644
--- a/indra/newview/llinventoryfilter.cpp
+++ b/indra/newview/llinventoryfilter.cpp
@@ -119,16 +119,6 @@ bool LLInventoryFilter::checkFolder(const LLFolderViewFolder* folder)
const LLFolderViewEventListener* listener = folder->getListener();
const LLUUID folder_id = listener->getUUID();
- const LLInvFVBridge *bridge = dynamic_cast<const LLInvFVBridge *>(folder->getListener());
- bool is_system_folder = bridge->isSystemFolder();
- bool is_hidden_if_empty = LLViewerFolderType::lookupIsHiddenIfEmpty(listener->getPreferredType());
- bool is_empty = (gInventory.categoryHasChildren(folder_id) != LLInventoryModel::CHILDREN_YES);
-
- if (is_system_folder && is_empty && is_hidden_if_empty)
- {
- return false;
- }
-
if (mFilterOps.mFilterTypes & FILTERTYPE_CATEGORY)
{
// Can only filter categories for items in your inventory
@@ -217,6 +207,21 @@ BOOL LLInventoryFilter::checkAgainstFilterType(const LLFolderViewItem* item) con
}
}
+ ////////////////////////////////////////////////////////////////////////////////
+ // FILTERTYPE_EMPTYFOLDERS
+ // Pass if this item is a folder and is not a system folder that should be hidden
+ if (filterTypes & FILTERTYPE_EMPTYFOLDERS)
+ {
+ if (object_type == LLInventoryType::IT_CATEGORY)
+ {
+ bool is_hidden_if_empty = LLViewerFolderType::lookupIsHiddenIfEmpty(listener->getPreferredType());
+ if (is_hidden_if_empty)
+ {
+ return FALSE;
+ }
+ }
+ }
+
return TRUE;
}
@@ -354,6 +359,11 @@ void LLInventoryFilter::setFilterWearableTypes(U64 types)
mFilterOps.mFilterTypes |= FILTERTYPE_WEARABLE;
}
+void LLInventoryFilter::setFilterEmptySystemFolders()
+{
+ mFilterOps.mFilterTypes |= FILTERTYPE_EMPTYFOLDERS;
+}
+
void LLInventoryFilter::setFilterUUID(const LLUUID& object_id)
{
if (mFilterOps.mFilterUUID == LLUUID::null)