Exemplo n.º 1
0
// static 
void LLFloaterWorldMap::onLocationCommit( void* userdata )
{
	LLFloaterWorldMap *self = gFloaterWorldMap;
	if( !self || self->mIsClosing )
	{
		return;
	}

	self->clearLocationSelection(FALSE);
	self->mCompletingRegionName = "";
	self->mLastRegionName = "";

	std::string str = self->childGetValue("location").asString();

	// Trim any leading and trailing spaces in the search target
	std::string saved_str = str;
	LLStringUtil::trim( str );
	if ( str != saved_str )
	{	// Set the value in the UI if any spaces were removed
		self->childSetValue("location", str);
	}

	LLStringUtil::toLower(str);
	gFloaterWorldMap->mCompletingRegionName = str;
	LLWorldMap::getInstance()->mIsTrackingCommit = TRUE;
	self->mExactMatch = FALSE;
	if (str.length() >= 3)
	{
		LLWorldMap::getInstance()->sendNamedRegionRequest(str);
	}
	else
	{
		str += "#";
		LLWorldMap::getInstance()->sendNamedRegionRequest(str);
	}
}