Kelly Washington avatar Kelly Washington committed 68af98e

MAINT-1897 Poor performance viewing large group member lists
* Clean up 'is group' extra data in namelists.

Comments (0)

Files changed (2)

indra/newview/llnamelistctrl.cpp

 {
 	BOOL handled = FALSE;
 	S32 column_index = getColumnIndexFromOffset(x);
-	LLScrollListItem* hit_item = hitItem(x, y);
+	LLNameListItem* hit_item = dynamic_cast<LLNameListItem*>(hitItem(x, y));
 	if (hit_item
 		&& column_index == mNameColumnIndex)
 	{
 				LLCoordGL pos( sticky_rect.mRight - info_icon_size, sticky_rect.mTop - (sticky_rect.getHeight() - icon->getHeight())/2 );
 
 				// Should we show a group or an avatar inspector?
-				bool is_group = hit_item->getValue()["is_group"].asBoolean();
+				bool is_group = hit_item->isGroup();
 
 				LLToolTip::Params params;
 				params.background_visible( false );
 	const std::string& suffix)
 {
 	LLUUID id = name_item.value().asUUID();
-	LLNameListItem* item = NULL;
-
-	// Store item type so that we can invoke the proper inspector.
-	// *TODO Vadim: Is there a more proper way of storing additional item data?
-	{
-		LLNameListCtrl::NameItem item_p(name_item);
-		item_p.value = LLSD().with("uuid", id).with("is_group", name_item.target() == GROUP);
-		item = new LLNameListItem(item_p);
-		LLScrollListCtrl::addRow(item, item_p, pos);
-	}
+	LLNameListItem* item = new LLNameListItem(name_item,name_item.target() == GROUP);
 
 	if (!item) return NULL;
 
+	LLScrollListCtrl::addRow(item, name_item, pos);
+
 	// use supplied name by default
 	std::string fullname = name_item.name;
 	switch(name_item.target)
 			setNeedsSort();
 		}
 	}
-
+	
 	dirtyColumns();
 }
 

indra/newview/llnamelistctrl.h

 class LLNameListItem : public LLScrollListItem, public LLHandleProvider<LLNameListItem>
 {
 public:
-	LLUUID	getUUID() const		{ return getValue()["uuid"].asUUID(); }
+	bool isGroup() const { return mIsGroup; }
+	void setIsGroup(bool is_group) { mIsGroup = is_group; }
+
 protected:
 	friend class LLNameListCtrl;
 
 	LLNameListItem( const LLScrollListItem::Params& p )
-	:	LLScrollListItem(p)
+	:	LLScrollListItem(p), mIsGroup(false)
 	{
 	}
+
+	LLNameListItem( const LLScrollListItem::Params& p, bool is_group )
+	:	LLScrollListItem(p), mIsGroup(is_group)
+	{
+	}
+
+private:
+	bool mIsGroup;
 };
 
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.