From 28344855dc4c4b20f4188e7dd64991707d87377f Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 17 Nov 2011 19:48:39 -0800 Subject: EXP-1498 : Always create the folder widget, move empty filtering to foltering code. Still update issues though. --- indra/newview/llinventoryfilter.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'indra/newview/llinventoryfilter.cpp') 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(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 -- cgit v1.2.3 From 7c2bbfc4fc905e8fff63d58f19f5e22cd755281c Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 18 Nov 2011 17:22:40 -0800 Subject: EXP-1498, EXP-1595, EXP-1596 : Hide empty system folders in a dynamic way, turn the setting ON by default --- indra/newview/llinventoryfilter.cpp | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) (limited to 'indra/newview/llinventoryfilter.cpp') 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(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) -- cgit v1.2.3 From 3001ad1a02f85e5e4f902e4a5973d4ccfcc689bb Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 28 Nov 2011 20:37:58 -0800 Subject: EXP-1596 : Fetch system folders so we're sure they are empty if we need to hide them --- indra/newview/llinventoryfilter.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llinventoryfilter.cpp') diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index bc02540281..d54bce4619 100644 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -217,6 +217,8 @@ BOOL LLInventoryFilter::checkAgainstFilterType(const LLFolderViewItem* item) con 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... + gInventory.fetchDescendentsOf(object_id); return FALSE; } } -- cgit v1.2.3