diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index e9b4d4d96db64547d65ca87455cf6c9bc6d1f7e1..8138643385c3b495c7142aacdf685e622241ef0f 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -1902,7 +1902,7 @@ <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>0</integer> + <integer>1</integer> </map> <key>DebugInventoryFilters</key> <map> diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 244b001adb8e6f87129601974a6e8380f04db818..0c092e9a561fd7526f20046fbc66e4d9711a01ef 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -195,20 +195,6 @@ BOOL LLInvFVBridge::isLink() const return mIsLink; } -// Is a "System" folder -// System folders are predefined named folders that have a specific preferred type -// e.g. "Textures" which has an FT_TEXTURE preferred type. -// Those are folders used to route incoming items in the current (soon to be obsolete) inventory -// asset routing. -// If a folder uses the same name as a predefined folder but is not of the same preferred type -// or if it has a preferred type but a different name, it will not be considered a system folder. -// *TODO: Test that logic in all languages -bool LLInvFVBridge::isSystemFolder() const -{ - LLFolderType::EType preferred_type = getPreferredType(); - return (preferred_type == LLFolderType::FT_NONE ? false : LLViewerFolderType::lookupTypeFromNewCategoryName(getDisplayName()) == preferred_type); -} - /*virtual*/ /** * @brief Adds this item into clipboard storage diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index 9832c683c66cba7d7bef2ff65044277769dfa11c..2d625befb4cff555fb26f94ad01e3de584016aba 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -72,7 +72,6 @@ class LLInvFVBridge : public LLFolderViewEventListener BOOL canShare() const; BOOL canListOnMarketplace() const; BOOL canListOnMarketplaceNow() const; - bool isSystemFolder() const; // true if is a "System" folder //-------------------------------------------------------------------- // LLInvFVBridge functionality diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index 438081c177e2b6cc3adaa8aee80050bb9cf8f5ba..bc0254028122136ba2483b5827b4847d2a463872 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) diff --git a/indra/newview/llinventoryfilter.h b/indra/newview/llinventoryfilter.h index f9460822f7d54c8ba5d80e9c442b72540d74cc09..bba24ac65290b9f9e12463af3061e54b7fd41c23 100644 --- a/indra/newview/llinventoryfilter.h +++ b/indra/newview/llinventoryfilter.h @@ -57,7 +57,8 @@ class LLInventoryFilter FILTERTYPE_CATEGORY = 0x1 << 1, // search by folder type FILTERTYPE_UUID = 0x1 << 2, // find the object with UUID and any links to it FILTERTYPE_DATE = 0x1 << 3, // search by date range - FILTERTYPE_WEARABLE = 0x1 << 4 // search by wearable type + FILTERTYPE_WEARABLE = 0x1 << 4, // search by wearable type + FILTERTYPE_EMPTYFOLDERS = 0x1 << 5 // pass if folder is not a system folder to be hidden if empty }; enum EFilterLink @@ -88,6 +89,7 @@ class LLInventoryFilter void setFilterCategoryTypes(U64 types); void setFilterUUID(const LLUUID &object_id); void setFilterWearableTypes(U64 types); + void setFilterEmptySystemFolders(); void updateFilterTypes(U64 types, U64& current_types); void setFilterSubString(const std::string& string); diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index a9ec4af4f3011540735f8f7f38b814df542f9225..d06374d23234fed8c04c771dca11f47a6b7b29ca 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -240,6 +240,12 @@ void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params) getFilter()->setFilterCategoryTypes(getFilter()->getFilterCategoryTypes() & ~(1ULL << LLFolderType::FT_INBOX)); getFilter()->setFilterCategoryTypes(getFilter()->getFilterCategoryTypes() & ~(1ULL << LLFolderType::FT_OUTBOX)); + // set the filter for the empty folder if the debug setting is on + if (gSavedSettings.getBOOL("DebugHideEmptySystemFolders")) + { + getFilter()->setFilterEmptySystemFolders(); + } + // Initialize base class params. LLPanel::initFromParams(params); } diff --git a/indra/newview/llviewerfoldertype.cpp b/indra/newview/llviewerfoldertype.cpp index c39df7efce3019dd646b644bb8725b35e8a8067a..a179b61cffc78c7c61ade5cd39935c2ffa079588 100644 --- a/indra/newview/llviewerfoldertype.cpp +++ b/indra/newview/llviewerfoldertype.cpp @@ -30,7 +30,6 @@ #include "lldictionary.h" #include "llmemory.h" #include "llvisualparam.h" -#include "llviewercontrol.h" static const std::string empty_string; @@ -267,7 +266,7 @@ BOOL LLViewerFolderType::lookupIsQuietType(LLFolderType::EType folder_type) bool LLViewerFolderType::lookupIsHiddenIfEmpty(LLFolderType::EType folder_type) { const ViewerFolderEntry *entry = LLViewerFolderDictionary::getInstance()->lookup(folder_type); - if (gSavedSettings.getBOOL("DebugHideEmptySystemFolders") && entry) + if (entry) { return entry->mHideIfEmpty; }