summaryrefslogtreecommitdiff
path: root/indra/newview/llappviewermacosx.cpp
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2015-10-19 12:03:08 -0700
committerRider Linden <rider@lindenlab.com>2015-10-19 12:03:08 -0700
commit53b947e0397d6b88fdc6c0a10144e5a6d02a67d3 (patch)
tree38c94f216386ba6653e8152d9db0198807f4f2cc /indra/newview/llappviewermacosx.cpp
parented7963bad14abd628fa60d0d5baf357f1858c48c (diff)
parent4312629e7c5749b86add9d42e6e550602f34dbf5 (diff)
Merge from viewer release.
Diffstat (limited to 'indra/newview/llappviewermacosx.cpp')
-rwxr-xr-xindra/newview/llappviewermacosx.cpp50
1 files changed, 32 insertions, 18 deletions
diff --git a/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp
index 56154a2de3..09227806fd 100755
--- a/indra/newview/llappviewermacosx.cpp
+++ b/indra/newview/llappviewermacosx.cpp
@@ -62,9 +62,10 @@ namespace
// They are not used immediately by the app.
int gArgC;
char** gArgV;
- LLAppViewerMacOSX* gViewerAppPtr;
+ LLAppViewerMacOSX* gViewerAppPtr = NULL;
void (*gOldTerminateHandler)() = NULL;
+ std::string gHandleSLURL;
}
static void exceptionTerminateHandler()
@@ -107,7 +108,11 @@ bool initViewer()
{
LL_WARNS() << "Application init failed." << LL_ENDL;
}
-
+ else if (!gHandleSLURL.empty())
+ {
+ dispatchUrl(gHandleSLURL);
+ gHandleSLURL = "";
+ }
return ok;
}
@@ -393,22 +398,31 @@ bool LLAppViewerMacOSX::getMasterSystemAudioMute()
void handleUrl(const char* url_utf8)
{
- if (url_utf8)
+ if (url_utf8 && gViewerAppPtr)
{
- std::string url = url_utf8;
- // Safari 3.2 silently mangles secondlife:///app/ URLs into
- // secondlife:/app/ (only one leading slash).
- // Fix them up to meet the URL specification. JC
- const std::string prefix = "secondlife:/app/";
- std::string test_prefix = url.substr(0, prefix.length());
- LLStringUtil::toLower(test_prefix);
- if (test_prefix == prefix)
- {
- url.replace(0, prefix.length(), "secondlife:///app/");
- }
-
- LLMediaCtrl* web = NULL;
- const bool trusted_browser = false;
- LLURLDispatcher::dispatch(url, "", web, trusted_browser);
+ gHandleSLURL = "";
+ dispatchUrl(url_utf8);
}
+ else if (url_utf8)
+ {
+ gHandleSLURL = url_utf8;
+ }
+}
+
+void dispatchUrl(std::string url)
+{
+ // Safari 3.2 silently mangles secondlife:///app/ URLs into
+ // secondlife:/app/ (only one leading slash).
+ // Fix them up to meet the URL specification. JC
+ const std::string prefix = "secondlife:/app/";
+ std::string test_prefix = url.substr(0, prefix.length());
+ LLStringUtil::toLower(test_prefix);
+ if (test_prefix == prefix)
+ {
+ url.replace(0, prefix.length(), "secondlife:///app/");
+ }
+
+ LLMediaCtrl* web = NULL;
+ const bool trusted_browser = false;
+ LLURLDispatcher::dispatch(url, "", web, trusted_browser);
}