// protected
void LLPanelDirBrowser::updateResultCount()
{
	LLScrollListCtrl* list = findChild<LLScrollListCtrl>("results");
	if (!list) return;

	S32 result_count = list->getItemCount();
	std::string result_text;

	if (!mHaveSearchResults) result_count = 0;

	if (childIsVisible("Next >")) 
	{
		// Item count be off by a few if bogus items sent from database
		// Just use the number of results per page. JC
		result_text = llformat(">%d found", mResultsPerPage);
	}
	else 
	{
		result_text = llformat("%d found", result_count);
	}
	
	childSetValue("result_text", result_text);
	
	if (result_count == 0)
	{
		// add none found response
		if (list->getItemCount() == 0)
		{
			list->setCommentText(LLTrans::getString("NoneFound"));
			list->operateOnAll(LLCtrlListInterface::OP_DESELECT);
		}
	}
	else
	{
		list->setEnabled(true);
	}
}