summaryrefslogtreecommitdiff
path: root/indra/newview/llinventoryfilter.cpp
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2011-11-17 19:48:39 -0800
committerMerov Linden <merov@lindenlab.com>2011-11-17 19:48:39 -0800
commit28344855dc4c4b20f4188e7dd64991707d87377f (patch)
tree12baafe5906b589c620a265a0372ebac50757a0a /indra/newview/llinventoryfilter.cpp
parent13a7fbc7a0cf460b4f57028b2e46c33426aa3a01 (diff)
EXP-1498 : Always create the folder widget, move empty filtering to foltering code. Still update issues though.
Diffstat (limited to 'indra/newview/llinventoryfilter.cpp')
-rw-r--r--indra/newview/llinventoryfilter.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp
index 516b47e616..438081c177 100644
--- a/indra/newview/llinventoryfilter.cpp
+++ b/indra/newview/llinventoryfilter.cpp
@@ -36,6 +36,7 @@
#include "llviewercontrol.h"
#include "llfolderview.h"
#include "llinventorybridge.h"
+#include "llviewerfoldertype.h"
// linden library includes
#include "lltrans.h"
@@ -117,7 +118,17 @@ 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