diff options
Diffstat (limited to 'indra/newview/llnavigationbar.cpp')
-rw-r--r-- | indra/newview/llnavigationbar.cpp | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/indra/newview/llnavigationbar.cpp b/indra/newview/llnavigationbar.cpp index c3d0f1bfc2..e11df06d86 100644 --- a/indra/newview/llnavigationbar.cpp +++ b/indra/newview/llnavigationbar.cpp @@ -52,6 +52,7 @@ #include "llsearchcombobox.h" #include "llsidetray.h" #include "llslurl.h" +#include "llurlsimstring.h" #include "llurlregistry.h" #include "llurldispatcher.h" #include "llviewerinventory.h" @@ -507,34 +508,29 @@ void LLNavigationBar::onLocationSelection() std::string region_name; LLVector3 local_coords(128, 128, 0); + S32 x = 0, y = 0, z = 0; // Is the typed location a SLURL? - LLSLURL slurl = LLSLURL(typed_location); - if (slurl.getType() == LLSLURL::LOCATION) + if (LLSLURL::isSLURL(typed_location)) { - region_name = slurl.getRegion(); - local_coords = slurl.getPosition(); + // Yes. Extract region name and local coordinates from it. + if (LLURLSimString::parse(LLSLURL::stripProtocol(typed_location), ®ion_name, &x, &y, &z)) + local_coords.set(x, y, z); + else + return; } - else if(!slurl.isValid()) + // we have to do this check after previous, because LLUrlRegistry contains handlers for slurl too + //but we need to know whether typed_location is a simple http url. + else if (LLUrlRegistry::instance().isUrl(typed_location)) { - // we have to do this check after previous, because LLUrlRegistry contains handlers for slurl too - // but we need to know whether typed_location is a simple http url. - if (LLUrlRegistry::instance().isUrl(typed_location)) - { // display http:// URLs in the media browser, or // anything else is sent to the search floater LLWeb::loadURL(typed_location); return; - } - else - { - // assume that an user has typed the {region name} or possible {region_name, parcel} - region_name = typed_location.substr(0,typed_location.find(',')); - } } else { - // was an app slurl, home, whatever. Bail - return; + // assume that an user has typed the {region name} or possible {region_name, parcel} + region_name = typed_location.substr(0,typed_location.find(',')); } // Resolve the region name to its global coordinates. @@ -566,7 +562,7 @@ void LLNavigationBar::onTeleportFinished(const LLVector3d& global_agent_pos) */ LLAgentUI::buildLocationString(location, LLAgentUI::LOCATION_FORMAT_NO_MATURITY, gAgent.getPosAgentFromGlobal(global_agent_pos)); - std::string tooltip (LLSLURL(gAgent.getRegion()->getName(), global_agent_pos).getSLURLString()); + std::string tooltip (LLSLURL::buildSLURLfromPosGlobal(gAgent.getRegion()->getName(), global_agent_pos, false)); LLLocationHistoryItem item (location, global_agent_pos, tooltip,TYPED_REGION_SLURL);// we can add into history only TYPED location @@ -655,7 +651,7 @@ void LLNavigationBar::onRegionNameResponse( LLVector3d region_pos = from_region_handle(region_handle); LLVector3d global_pos = region_pos + (LLVector3d) local_coords; - llinfos << "Teleporting to: " << LLSLURL(region_name, global_pos).getSLURLString() << llendl; + llinfos << "Teleporting to: " << LLSLURL::buildSLURLfromPosGlobal(region_name, global_pos, false) << llendl; gAgent.teleportViaLocation(global_pos); } |