summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorMaxim Nikolenko <maximnproductengine@lindenlab.com>2023-05-10 16:02:14 +0300
committerMaxim Nikolenko <maximnproductengine@lindenlab.com>2023-05-10 16:02:14 +0300
commit4a09f190d55483857ad70b7d2ddb75a98f0f57d7 (patch)
treeab3e655bb275989171a48b1c60901efc2aa7ca87 /indra/newview
parent8a1cb8c00cf75ff1e09c72c2fb487728ec77c66b (diff)
SL-19650 don't build anything except direct children views for single-folder panel
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llinventorypanel.cpp28
-rw-r--r--indra/newview/llinventorypanel.h5
2 files changed, 24 insertions, 9 deletions
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index 6d739c909c..d6eee523f4 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -161,7 +161,8 @@ LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) :
mInvFVBridgeBuilder(NULL),
mInventoryViewModel(p.name),
mGroupedItemBridge(new LLFolderViewGroupedItemBridge),
- mFocusSelection(false)
+ mFocusSelection(false),
+ mBuildChildrenViews(true)
{
mInvFVBridgeBuilder = &INVENTORY_BRIDGE_BUILDER;
@@ -1016,8 +1017,11 @@ LLFolderViewItem* LLInventoryPanel::buildViewsTree(const LLUUID& id,
LLInventoryObject const* objectp,
LLFolderViewItem *folder_view_item,
LLFolderViewFolder *parent_folder,
- const EBuildModes &mode)
+ const EBuildModes &mode,
+ S32 depth)
{
+ depth++;
+
// Force the creation of an extra root level folder item if required by the inventory panel (default is "false")
bool allow_drop = true;
bool create_root = false;
@@ -1117,7 +1121,8 @@ LLFolderViewItem* LLInventoryPanel::buildViewsTree(const LLUUID& id,
}
}
- bool create_children = folder_view_item && objectp->getType() == LLAssetType::AT_CATEGORY;
+ bool create_children = folder_view_item && objectp->getType() == LLAssetType::AT_CATEGORY
+ && (mBuildChildrenViews || depth == 0);
if (create_children)
{
@@ -1137,7 +1142,10 @@ LLFolderViewItem* LLInventoryPanel::buildViewsTree(const LLUUID& id,
{
create_children = false;
// run it again for the sake of creating children
- mBuildViewsQueue.push_back(id);
+ if (mBuildChildrenViews || depth == 0)
+ {
+ mBuildViewsQueue.push_back(id);
+ }
}
else
{
@@ -1150,7 +1158,10 @@ LLFolderViewItem* LLInventoryPanel::buildViewsTree(const LLUUID& id,
{
create_children = false;
// run it to create children, current caller is only interested in current view
- mBuildViewsQueue.push_back(id);
+ if (mBuildChildrenViews || depth == 0)
+ {
+ mBuildViewsQueue.push_back(id);
+ }
break;
}
case BUILD_ONE_FOLDER:
@@ -1198,11 +1209,11 @@ LLFolderViewItem* LLInventoryPanel::buildViewsTree(const LLUUID& id,
// each time, especially since content is growing, we can just
// iter over copy of mItemMap in some way
LLFolderViewItem* view_itemp = getItemByID(cat->getUUID());
- buildViewsTree(cat->getUUID(), id, cat, view_itemp, parentp, (mode == BUILD_ONE_FOLDER ? BUILD_NO_CHILDREN : mode));
+ buildViewsTree(cat->getUUID(), id, cat, view_itemp, parentp, (mode == BUILD_ONE_FOLDER ? BUILD_NO_CHILDREN : mode), depth);
}
else
{
- buildViewsTree(cat->getUUID(), id, cat, NULL, parentp, (mode == BUILD_ONE_FOLDER ? BUILD_NO_CHILDREN : mode));
+ buildViewsTree(cat->getUUID(), id, cat, NULL, parentp, (mode == BUILD_ONE_FOLDER ? BUILD_NO_CHILDREN : mode), depth);
}
}
}
@@ -1222,7 +1233,7 @@ LLFolderViewItem* LLInventoryPanel::buildViewsTree(const LLUUID& id,
// each time, especially since content is growing, we can just
// iter over copy of mItemMap in some way
LLFolderViewItem* view_itemp = getItemByID(item->getUUID());
- buildViewsTree(item->getUUID(), id, item, view_itemp, parentp, mode);
+ buildViewsTree(item->getUUID(), id, item, view_itemp, parentp, mode, depth);
}
}
}
@@ -2078,6 +2089,7 @@ static LLDefaultChildRegistry::Register<LLInventorySingleFolderPanel> t_single_f
LLInventorySingleFolderPanel::LLInventorySingleFolderPanel(const Params& params)
: LLInventoryPanel(params)
{
+ mBuildChildrenViews = false;
getFilter().setSingleFolderMode(true);
getFilter().setEmptyLookupMessage("InventorySingleFolderNoMatches");
getFilter().setDefaultEmptyLookupMessage("InventorySingleFolderEmpty");
diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h
index f2eab4a642..1476194195 100644
--- a/indra/newview/llinventorypanel.h
+++ b/indra/newview/llinventorypanel.h
@@ -305,6 +305,8 @@ protected:
*/
const LLInventoryFolderViewModelBuilder* mInvFVBridgeBuilder;
+ bool mBuildChildrenViews;
+
//--------------------------------------------------------------------
// Sorting
@@ -372,7 +374,8 @@ private:
LLInventoryObject const* objectp,
LLFolderViewItem *target_view,
LLFolderViewFolder *parent_folder_view,
- const EBuildModes &mode);
+ const EBuildModes &mode,
+ S32 depth = -1);
typedef enum e_views_initialization_state
{