示例#1
0
void LLNameListCtrl::onAvatarNameCache(const LLUUID& agent_id,
									   const LLAvatarName& av_name,
									   std::string suffix,
									   LLHandle<LLNameListItem> item)
{
	avatar_name_cache_connection_map_t::iterator it = mAvatarNameCacheConnections.find(agent_id);
	if (it != mAvatarNameCacheConnections.end())
	{
		if (it->second.connected())
		{
			it->second.disconnect();
		}
		mAvatarNameCacheConnections.erase(it);
	}

	std::string name;
	if (mShortNames)
		name = av_name.getDisplayName();
	else
		name = av_name.getCompleteName();

	// Append optional suffix.
	if (!suffix.empty())
	{
		name.append(suffix);
	}

	LLNameListItem* list_item = item.get();
	if (list_item && list_item->getUUID() == agent_id)
	{
		LLScrollListCell* cell = list_item->getColumn(mNameColumnIndex);
		if (cell)
		{
			cell->setValue(name);
			setNeedsSort();
		}
	}
	
	//////////////////////////////////////////////////////////////////////////
	// BAKER - FIX NameListCtrl
 	//if (mPendingLookupsRemaining <= 0)
 	{
 		// We might get into a state where mPendingLookupsRemaining might
 		//	go negative.  So just reset it right now and figure out if it's
 		//	possible later :)
 		//mPendingLookupsRemaining = 0;
		
 		mNameListCompleteSignal(true);
 	}
 	//else
 	{
 	//	mPendingLookupsRemaining--;
 	}
	//////////////////////////////////////////////////////////////////////////

	dirtyColumns();
}
void LLNameListCtrl::onAvatarNameCache(const LLUUID& agent_id,
									   const LLAvatarName& av_name,
									   LLHandle<LLScrollListItem> item)
{
	std::string name;
	if (mShortNames)
		name = av_name.mDisplayName;
	else
		name = av_name.getCompleteName();

	LLScrollListItem* list_item = item.get();
	if (list_item && list_item->getUUID() == agent_id)
	{
		LLScrollListCell* cell = list_item->getColumn(mNameColumnIndex);
		if (cell)
		{
			cell->setValue(name);
			setNeedsSort();
		}
	}

	dirtyColumns();
}