diff options
author | Lynx Linden <lynx@lindenlab.com> | 2009-12-21 15:49:52 +0000 |
---|---|---|
committer | Lynx Linden <lynx@lindenlab.com> | 2009-12-21 15:49:52 +0000 |
commit | bf7494017f5d90624243e5069dea9342c6b1869c (patch) | |
tree | f81a823c2cb344f95d06cba115c93677ffde7dc8 /indra/llui/llurlregistry.cpp | |
parent | d1eb2948f8a65e6f7631d836b2367ebe435e1efa (diff) |
EXT-3486: Support SLapps and URLs in the nav bar.
If the user enters a string into the navigation bar that is not
recognized as an SL location, the behavior is now:
- handle any secondlife:// SLapps, or
- open any http: or https: URLs in the media browser, or
- otherwise, send the text to the search floater
Diffstat (limited to 'indra/llui/llurlregistry.cpp')
-rw-r--r-- | indra/llui/llurlregistry.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/indra/llui/llurlregistry.cpp b/indra/llui/llurlregistry.cpp index afcff0d409..ad5c0911f8 100644 --- a/indra/llui/llurlregistry.cpp +++ b/indra/llui/llurlregistry.cpp @@ -223,3 +223,23 @@ bool LLUrlRegistry::hasUrl(const LLWString &text) LLUrlMatch match; return findUrl(text, match); } + +bool LLUrlRegistry::isUrl(const std::string &text) +{ + LLUrlMatch match; + if (findUrl(text, match)) + { + return (match.getStart() == 0 && match.getEnd() >= text.size()-1); + } + return false; +} + +bool LLUrlRegistry::isUrl(const LLWString &text) +{ + LLUrlMatch match; + if (findUrl(text, match)) + { + return (match.getStart() == 0 && match.getEnd() >= text.size()-1); + } + return false; +} |