Commit 2b7ff042 authored by Kitty Barnett's avatar Kitty Barnett
Browse files

Merged with Inventory-Panel tip

--HG--
branch : .Catznip
parents d76a22db 14557774
......@@ -2612,12 +2612,16 @@ void LLCollapseToFolders::doItem(LLFolderViewItem* pItem)
LLFolderViewFolder* pParentFolder = pItem->getParentFolder();
if (pParentFolder->isOpen())
{
// NOTE: we don't want one or two items under the Clothing folder causing it to collapse so we make a special
// (convenience) exception for user or system protected folders that have at least 2 folders in them
// NOTE: we don't want one item collapsing an entire hierarchy so make a special (convenience) exception
int cntPassedFolders = 0;
for (auto& itFolder = pParentFolder->getFoldersBegin(), endFolder = pParentFolder->getFoldersEnd(); itFolder != endFolder; ++itFolder)
{
if ((*itFolder)->descendantsPassedFilter())
cntPassedFolders++;
}
LLInvFVBridge* pItemBridge = pParentFolder->getViewModelItem<LLInvFVBridge>();
if ( (!pItemBridge) ||
(!LLFolderType::lookupIsProtectedType(pItemBridge->getPreferredType(), pItemBridge->getUUID())) ||
(pParentFolder->getFoldersCount() < 2) )
if ( (!pItemBridge) || (0 == cntPassedFolders) )
{
pItem->getParentFolder()->setOpenArrangeRecursively(false, LLFolderViewFolder::RECURSE_NO);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment