From 3e2734ccbc7a47c313bf874c2c91e00f1abab6b1 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Tue, 20 Feb 2018 17:52:36 +0200 Subject: MAINT-5165 Hide Inbox and Outbox despite "Show Filters..." settings --- indra/newview/llinventoryfilter.cpp | 2 +- indra/newview/llinventorymodel.cpp | 11 +++++++++++ indra/newview/llinventorymodel.h | 4 +++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index 9193613e9f..f64c39c3ad 100644 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -153,7 +153,7 @@ bool LLInventoryFilter::checkFolder(const LLUUID& folder_id) const // we're showing all folders, overriding filter if (mFilterOps.mShowFolderState == LLInventoryFilter::SHOW_ALL_FOLDERS) { - return true; + return !gInventory.isCategoryHidden(folder_id); } // when applying a filter, matching folders get their contents downloaded first diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 6a1ec9f991..60f470a938 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -342,6 +342,17 @@ LLViewerInventoryCategory* LLInventoryModel::getCategory(const LLUUID& id) const return category; } +bool LLInventoryModel::isCategoryHidden(const LLUUID& id) const +{ + const LLViewerInventoryCategory* category = getCategory(id); + if (category) + { + LLFolderType::EType cat_type = category->getPreferredType(); + return (cat_type == LLFolderType::FT_INBOX || cat_type == LLFolderType::FT_OUTBOX); + } + return false; +} + S32 LLInventoryModel::getItemCount() const { return mItemMap.size(); diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index 01e0ed7e9b..576c5e9e20 100644 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -316,7 +316,9 @@ public: // Copy content of all folders of type "type" into folder "id" and delete/purge the empty folders // Note : This method has been designed for FT_OUTBOX (aka Merchant Outbox) but can be used for other categories void consolidateForType(const LLUUID& id, LLFolderType::EType type); - + + bool isCategoryHidden(const LLUUID& id) const; + private: mutable LLPointer mLastItem; // cache recent lookups -- cgit v1.2.3