Commit c0aa18e1 authored by Kitty Barnett's avatar Kitty Barnett

Merged with .Catznip tip

--HG--
branch : Catznip
parents ecb745b0 2b7ff042
......@@ -2620,12 +2620,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);
}
......
......@@ -7926,7 +7926,7 @@ void handle_attachment_find_original()
LLObjectSelectionHandle hSelection = LLSelectMgr::getInstance()->getSelection();
if ( (SELECT_TYPE_ATTACHMENT == hSelection->getSelectType()) || (SELECT_TYPE_HUD == hSelection->getSelectType()) )
{
const LLViewerObject* pAttachObj = hSelection->getPrimaryObject();
const LLViewerObject* pAttachObj = hSelection->getFirstRootObject();
if ( (pAttachObj) && (!pAttachObj->isTempAttachment()) )
{
const LLUUID& idAttachItem = pAttachObj->getAttachmentItemID();
......@@ -7941,7 +7941,7 @@ bool enable_attachment_find_original()
if ( (SELECT_TYPE_ATTACHMENT != hSelection->getSelectType()) && (SELECT_TYPE_HUD != hSelection->getSelectType()) )
return false;
const LLViewerObject* pAttachObj = hSelection->getPrimaryObject();
const LLViewerObject* pAttachObj = hSelection->getFirstRootObject();
return (pAttachObj) && (!pAttachObj->isTempAttachment());
}
// [/SL:KB]
......
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