diff options
author | Mnikolenko ProductEngine <mnikolenko@productengine.com> | 2014-03-28 18:22:03 +0200 |
---|---|---|
committer | Mnikolenko ProductEngine <mnikolenko@productengine.com> | 2014-03-28 18:22:03 +0200 |
commit | 4994d9d97d23afad234950f45a4ce99a276c5b5c (patch) | |
tree | bd476c6373bbb7afeb08ab65d1e090736003ad4b | |
parent | e0fb4b598266e8aaf6bbc73bae5e5390e361cfb2 (diff) |
MAINT-3878 FIXED Don't hide folder if it has descendants.
-rwxr-xr-x | indra/newview/llinventoryfilter.cpp | 19 |
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; } |