From cb044d9981d7a823aed66428de9075c96f5b8f73 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Thu, 22 Jan 2015 15:02:21 +0100 Subject: [PATCH] FIRE-11103: Fix empty folders being shown in worn inventory panel --- indra/newview/llinventoryfilter.cpp | 14 +++++++++----- indra/newview/llinventoryfilter.h | 2 +- indra/newview/llinventorypanel.cpp | 7 +++++++ indra/newview/llpanelmaininventory.cpp | 5 +++-- 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index d336070e82..cb1747cb06 100755 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -355,11 +355,14 @@ bool LLInventoryFilter::checkAgainstFilterType(const LLFolderViewModelItemInvent // Pass if this item is worn (hiding COF and Outfits folders) if (filterTypes & FILTERTYPE_WORN) { - if (!object) return FALSE; - LLUUID cat_id = object->getParentUUID(); - const LLViewerInventoryCategory *cat = gInventory.getCategory(cat_id); - return !LLAppearanceMgr::instance().getIsInCOF(object_id) - && (!cat || cat->getPreferredType() != LLFolderType::FT_OUTFIT) + if (!object) + { + return FALSE; + } + const LLUUID& cat_id = object->getParentUUID(); + const LLViewerInventoryCategory* cat = gInventory.getCategory(cat_id); + return !LLAppearanceMgr::instance().getIsInCOF(object_id) // Not a link in COF + && (!cat || cat->getPreferredType() != LLFolderType::FT_OUTFIT) // Not a link in an outfit folder && get_is_item_worn(object_id); } // @@ -1173,6 +1176,7 @@ LLInventoryFilter& LLInventoryFilter::operator=( const LLInventoryFilter& othe setFilterPermissions(other.getFilterPermissions()); setFilterSubString(other.getFilterSubString()); setDateRangeLastLogoff(other.isSinceLogoff()); + setFilterWorn(other.getFilterWorn()); return *this; } diff --git a/indra/newview/llinventoryfilter.h b/indra/newview/llinventoryfilter.h index c0155a5ca8..f0703036ac 100755 --- a/indra/newview/llinventoryfilter.h +++ b/indra/newview/llinventoryfilter.h @@ -214,7 +214,7 @@ public: U64 getFilterLinks() const; void setFilterWorn(BOOL sl); - BOOL getFilterWorn() { return mFilterOps.mFilterTypes & FILTERTYPE_WORN; } + BOOL getFilterWorn() const { return mFilterOps.mFilterTypes & FILTERTYPE_WORN; } // +-------------------------------------------------------------------+ // + Execution And Results diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index acf30205d3..845e0f41fe 100755 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -520,6 +520,13 @@ void LLInventoryPanel::modelChanged(U32 mask) view_item->refresh(); } + // FIRE-11103: Fix empty folders being shown in worn inventory panel + LLFolderViewFolder* parent = view_item->getParentFolder(); + if(parent) + { + parent->getViewModelItem()->dirtyDescendantsFilter(); + } + // } } diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index d677b1ada5..2ba8f4f5e6 100755 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -226,8 +226,9 @@ BOOL LLPanelMainInventory::postBuild() worn_items_panel->setWorn(TRUE); worn_items_panel->setSortOrder(gSavedSettings.getU32(LLInventoryPanel::DEFAULT_SORT_ORDER)); worn_items_panel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); - worn_items_panel->getFilter().setFilterObjectTypes(0xffffffff - (0x1 << LLInventoryType::IT_GESTURE)); - worn_items_panel->getFilter().markDefault(); + LLInventoryFilter& worn_filter = worn_items_panel->getFilter(); + worn_filter.setFilterObjectTypes(worn_filter.getFilterObjectTypes() & ~(0x1 << LLInventoryType::IT_GESTURE | 0x1 << LLInventoryType::IT_CATEGORY)); + worn_filter.markDefault(); // Do not go all crazy and recurse through the whole inventory // worn_items_panel->openAllFolders();