From f5886bfaff0385acf0a55bc1b8678330ae89442a Mon Sep 17 00:00:00 2001
From: Richard Nelson <richard@lindenlab.com>
Date: Mon, 8 Aug 2011 14:37:36 -0700
Subject: [PATCH] EXP-1065 FIX Inventory has slowed to a crawl. Clicking
 between items has an average one second delay. Same with switching between
 tabs. disable traversal of inventory contents for findView family of
 functions

---
 indra/newview/llfolderview.cpp     | 12 ++----------
 indra/newview/llfolderview.h       |  1 -
 indra/newview/llfolderviewitem.h   |  2 ++
 indra/newview/llinventorypanel.cpp |  4 +---
 4 files changed, 5 insertions(+), 14 deletions(-)

diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp
index 7581fa91c5a..02be477e0d3 100644
--- a/indra/newview/llfolderview.cpp
+++ b/indra/newview/llfolderview.cpp
@@ -369,16 +369,6 @@ void LLFolderView::closeAllFolders()
 	arrangeAll();
 }
 
-void LLFolderView::openFolder(const std::string& foldername)
-{
-	LLFolderViewFolder* inv = findChild<LLFolderViewFolder>(foldername);
-	if (inv)
-	{
-		setSelection(inv, FALSE, FALSE);
-		inv->setOpen(TRUE);
-	}
-}
-
 void LLFolderView::openTopLevelFolders()
 {
 	for (folders_t::iterator iter = mFolders.begin();
@@ -720,8 +710,10 @@ void LLFolderView::extendSelection(LLFolderViewItem* selection, LLFolderViewItem
 	mSignalSelectCallback = SIGNAL_KEYBOARD_FOCUS;
 }
 
+static LLFastTimer::DeclareTimer FTM_SANITIZE_SELECTION("Sanitize Selection");
 void LLFolderView::sanitizeSelection()
 {
+	LLFastTimer _(FTM_SANITIZE_SELECTION);
 	// store off current item in case it is automatically deselected
 	// and we want to preserve context
 	LLFolderViewItem* original_selected_item = getCurSelectedItem();
diff --git a/indra/newview/llfolderview.h b/indra/newview/llfolderview.h
index 0b92548fd0f..705a76a7b4e 100644
--- a/indra/newview/llfolderview.h
+++ b/indra/newview/llfolderview.h
@@ -108,7 +108,6 @@ class LLFolderView : public LLFolderViewFolder, public LLEditMenuHandler
 
 	// Close all folders in the view
 	void closeAllFolders();
-	void openFolder(const std::string& foldername);
 	void openTopLevelFolders();
 
 	virtual void toggleOpen() {};
diff --git a/indra/newview/llfolderviewitem.h b/indra/newview/llfolderviewitem.h
index f70e63ecdf6..dac0c3032c4 100644
--- a/indra/newview/llfolderviewitem.h
+++ b/indra/newview/llfolderviewitem.h
@@ -328,6 +328,8 @@ class LLFolderViewItem : public LLView
 	virtual BOOL handleMouseUp( S32 x, S32 y, MASK mask );
 	virtual BOOL handleDoubleClick( S32 x, S32 y, MASK mask );
 
+	virtual LLView* findChildView(const std::string& name, BOOL recurse) const { return NULL; }
+
 	//	virtual void handleDropped();
 	virtual void draw();
 	virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index d5d40ca65d3..1aa402802e6 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -812,9 +812,7 @@ void LLInventoryPanel::openStartFolderOrMyInventory()
 			&& fchild->getListener()
 				&& fchild->getListener()->getUUID() == gInventory.getRootFolderID())
 		{
-			const std::string& child_name = child->getName();
-			mFolderRoot->openFolder(child_name);
-			mFolderRoot->clearSelection();	// No need to keep it selected though!
+			fchild->setOpen(TRUE);
 			break;
 		}
 	}
-- 
GitLab