summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rwxr-xr-xindra/newview/llinventoryfilter.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp
index 15463e0d33..b0d0cb217b 100755
--- a/indra/newview/llinventoryfilter.cpp
+++ b/indra/newview/llinventoryfilter.cpp
@@ -177,6 +177,7 @@ 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)
{
@@ -244,13 +245,25 @@ bool LLInventoryFilter::checkAgainstFilterType(const LLFolderViewModelItemInvent
bool is_hidden_if_empty = LLViewerFolderType::lookupIsHiddenIfEmpty(listener->getPreferredType());
if (is_hidden_if_empty)
{
- // Force the fetching of those folders so they are hidden iff they really are empty...
+ // Force the fetching of those folders so they are hidden if they really are empty...
gInventory.fetchDescendentsOf(object_id);
- return FALSE;
+
+ LLInventoryModel::cat_array_t* cat_array = NULL;
+ LLInventoryModel::item_array_t* item_array = NULL;
+ gInventory.getDirectDescendentsOf(object_id,cat_array,item_array);
+ S32 descendents_actual = 0;
+ if(cat_array && item_array)
+ {
+ descendents_actual = cat_array->count() + item_array->count();
+ }
+ if (descendents_actual == 0)
+ {
+ return FALSE;
+ }
}
}
}
-
+
return TRUE;
}