summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorypanel.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2026-05-26 00:53:11 +0300
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2026-05-29 01:52:15 +0300
commite0b3b7fc3f07e0823726deba920db2ee5c382746 (patch)
tree5cc9ac178ec953691044899f6f99de9804533bd9 /indra/newview/llinventorypanel.cpp
parent0be27809566c1378fa613aa7c42bfd2406a9f764 (diff)
#3729 Reduce inventory memory overhead
UI elements already cache display name, getDisplayName() calls are rare and only come with other calls. For items, any UI calls already engage internal getItem optimizations, so doing getItem in getDisplayName() has negligible performance overhead while avoiding storing a dupplicate of item's name. This also cuts performance overhead from allocations, so it's a net benefit performance wise on first load. System folders do utilize display names that are different from default names, but they are not panel specific, they are global localizations. Store those in the model, not in the bridge. Usage example: LLFolderViewItem::postBuild() already calls getName after getDisplayName(), so getItem will utilize mLastItem either way and the only refresh needed happens if user renames the item. Without the user the update happens only once.
Diffstat (limited to 'indra/newview/llinventorypanel.cpp')
-rw-r--r--indra/newview/llinventorypanel.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index 06dd830416..e87ef025c6 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.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
@@ -581,8 +581,9 @@ void LLInventoryPanel::itemChanged(const LLUUID& item_id, U32 mask, const LLInve
LLInvFVBridge* bridge = (LLInvFVBridge*)view_item->getViewModelItem();
if(bridge)
{
- // Clear the display name first, so it gets properly re-built during refresh()
- bridge->clearDisplayName();
+ // Clear the searchable name first, so it gets
+ // properly re-built during refresh()
+ bridge->clearSearchableName();
view_item->refresh();
}
@@ -1676,7 +1677,7 @@ void LLInventoryPanel::onSelectionChange(const std::deque<LLFolderViewItem*>& it
LLFolderBridge* prev_bridge = (LLFolderBridge*)prev_folder_item->getViewModelItem();
if(prev_bridge)
{
- prev_bridge->clearDisplayName();
+ prev_bridge->clearSearchableName();
prev_bridge->setShowDescendantsCount(false);
prev_folder_item->refresh();
}
@@ -1685,7 +1686,7 @@ void LLInventoryPanel::onSelectionChange(const std::deque<LLFolderViewItem*>& it
LLFolderBridge* bridge = (LLFolderBridge*)folder_item->getViewModelItem();
if(bridge)
{
- bridge->clearDisplayName();
+ bridge->clearSearchableName();
bridge->setShowDescendantsCount(true);
folder_item->refresh();
mPreviousSelectedFolder = bridge->getUUID();
@@ -1700,7 +1701,7 @@ void LLInventoryPanel::onSelectionChange(const std::deque<LLFolderViewItem*>& it
LLFolderBridge* prev_bridge = (LLFolderBridge*)prev_folder_item->getViewModelItem();
if(prev_bridge)
{
- prev_bridge->clearDisplayName();
+ prev_bridge->clearSearchableName();
prev_bridge->setShowDescendantsCount(false);
prev_folder_item->refresh();
}
@@ -1720,7 +1721,7 @@ void LLInventoryPanel::updateFolderLabel(const LLUUID& folder_id)
LLFolderBridge* bridge = (LLFolderBridge*)folder_item->getViewModelItem();
if(bridge)
{
- bridge->clearDisplayName();
+ bridge->clearSearchableName();
bridge->setShowDescendantsCount(true);
folder_item->refresh();
}