summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/llui/llfolderview.cpp3
-rw-r--r--indra/llui/llfolderviewitem.cpp13
-rw-r--r--indra/newview/llinventorypanel.cpp27
-rw-r--r--indra/newview/llpanelmarketplaceinboxinventory.cpp26
4 files changed, 57 insertions, 12 deletions
diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp
index db4ab8487e..758b4bb176 100644
--- a/indra/llui/llfolderview.cpp
+++ b/indra/llui/llfolderview.cpp
@@ -4,7 +4,7 @@
*
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
* Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
+ * Copyright (C) 2026, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -1423,6 +1423,7 @@ bool LLFolderView::search(LLFolderViewItem* first_item, const std::string &searc
}
}
+ // Note: for inventory getSearchableName should already be 'upper' case.
std::string current_item_label(search_item->getViewModelItem()->getSearchableName());
LLStringUtil::toUpper(current_item_label);
auto search_string_length = llmin(upper_case_string.size(), current_item_label.size());
diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp
index ac759393d0..c8ef421677 100644
--- a/indra/llui/llfolderviewitem.cpp
+++ b/indra/llui/llfolderviewitem.cpp
@@ -190,7 +190,7 @@ LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p)
mItemHeight(p.item_height),
mControlLabelRotation(0.f),
mDragAndDropTarget(false),
- mLabel(utf8str_to_wstring(p.name)),
+ mLabel(utf8str_to_wstring(p.name)), // will be immediately reset in postBuild()
mRoot(p.root),
mViewModelItem(p.listener),
mIsMouseOverTitle(false),
@@ -244,8 +244,10 @@ bool LLFolderViewItem::postBuild()
llassert(vmi); // not supposed to happen, if happens, find out why and fix
if (vmi)
{
- // getDisplayName() is expensive (due to internal getLabelSuffix() and name building)
- // it also sets search strings so it requires a filter reset
+ // First getDisplayName() is expensive due to internal
+ // lazy getLabelSuffix(), it is however needed as it sets
+ // search string, which can later determine visibility.
+ // Refreshing a search string also requires a filter reset.
mLabel = utf8str_to_wstring(vmi->getDisplayName());
mIsFavorite = vmi->isFavorite() && !vmi->isItemInTrash();
@@ -253,11 +255,8 @@ bool LLFolderViewItem::postBuild()
vmi->dirtyFilter();
}
- // Don't do full refresh on constructor if it is possible to avoid
+ // Don't do full refresh on constructor if it is possible to avoid,
// it significantly slows down bulk view creation.
- // Todo: Ideally we need to move getDisplayName() out of constructor as well.
- // Like: make a logic that will let filter update search string,
- // while LLFolderViewItem::arrange() updates visual part
mSuffixNeedsRefresh = true;
mLabelWidthDirty = true;
return true;
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index 0a6c95f309..301a0a0cc9 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -1063,7 +1063,18 @@ LLFolderViewFolder * LLInventoryPanel::createFolderViewFolder(LLInvFVBridge * br
{
LLFolderViewFolder::Params params(mParams.folder);
- params.name = bridge->getDisplayName();
+#ifndef LL_RELEASE_FOR_DOWNLOAD
+ // Only usable for debug and first call has a large
+ // overhead from search string construction.
+ // As inventory names aren't unique and can change,
+ // there is little we can use them for in release builds.
+ params.name = bridge->getName();
+#else
+ // We don't have a source of unique names and inventory
+ // items can reach millions in quantity, just use
+ // a short descriptor
+ params.name = "fld";
+#endif
params.root = mFolderRoot.get();
params.listener = bridge;
params.allow_drop = allow_drop;
@@ -1078,7 +1089,19 @@ LLFolderViewItem * LLInventoryPanel::createFolderViewItem(LLInvFVBridge * bridge
{
LLFolderViewItem::Params params(mParams.item);
- params.name = bridge->getDisplayName();
+#ifndef LL_RELEASE_FOR_DOWNLOAD
+ // Only usable for debug and first call has a large
+ // overhead from search string construction.
+ // As inventory names aren't unique, are large and can change,
+ // there is little we can use them for in release builds.
+ // Prefer shorter
+ params.name = bridge->getName();
+#else
+ // We don't have a source of unique names and inventory
+ // items can reach millions in quantity, just use
+ // a short descriptor
+ params.name = "itm";
+#endif
params.creation_date = bridge->getCreationDate();
params.root = mFolderRoot.get();
params.listener = bridge;
diff --git a/indra/newview/llpanelmarketplaceinboxinventory.cpp b/indra/newview/llpanelmarketplaceinboxinventory.cpp
index cb2906d633..e0dbd9acd2 100644
--- a/indra/newview/llpanelmarketplaceinboxinventory.cpp
+++ b/indra/newview/llpanelmarketplaceinboxinventory.cpp
@@ -82,7 +82,18 @@ LLFolderViewFolder * LLInboxInventoryPanel::createFolderViewFolder(LLInvFVBridge
LLInboxFolderViewFolder::Params params;
- params.name = bridge->getDisplayName();
+#ifndef LL_RELEASE_FOR_DOWNLOAD
+ // Only usable for debug and first call has a large
+ // overhead from search string construction.
+ // As inventory names aren't unique and can change,
+ // there is little we can use them for in release builds.
+ params.name = bridge->getName();
+#else
+ // We don't have a source of unique names and inventory
+ // items can reach millions in quantity, just use
+ // a short descriptor
+ params.name = "fld";
+#endif
params.root = mFolderRoot.get();
params.listener = bridge;
params.font_color = item_color;
@@ -98,7 +109,18 @@ LLFolderViewItem * LLInboxInventoryPanel::createFolderViewItem(LLInvFVBridge * b
LLInboxFolderViewItem::Params params;
- params.name = bridge->getDisplayName();
+#ifndef LL_RELEASE_FOR_DOWNLOAD
+ // Only usable for debug and first call has a large
+ // overhead from search string construction.
+ // As inventory names aren't unique and can change,
+ // there is little we can use them for in release builds.
+ params.name = bridge->getName();
+#else
+ // We don't have a source of unique names and inventory
+ // items can reach millions in quantity, just use
+ // a short descriptor
+ params.name = "itm";
+#endif
params.creation_date = bridge->getCreationDate();
params.root = mFolderRoot.get();
params.listener = bridge;