summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerhome.cpp
diff options
context:
space:
mode:
authorLynx Linden <lynx@lindenlab.com>2009-12-15 16:00:28 +0000
committerLynx Linden <lynx@lindenlab.com>2009-12-15 16:00:28 +0000
commit870d4449f5eec1c2a7e5e4627a0433846ab256aa (patch)
tree978b060155de581f627fd52c74eba63643829aad /indra/newview/llviewerhome.cpp
parentd82f82d7965ec9360cb49ec7e6c1c2f984d4539b (diff)
EXT-3441: Support various substitutions for Search URL.
The search URL is now specified in app_settings/settings.xml (instead of in floater_search.xml), and it is now defined more flexibly with support for various substitution strings, such as [QUERY], [AUTH_KEY], [MATURITY], [GODLIKE], etc. I pulled the common substitution code out into a new static method, LLWeb::expandURLSubstitutions(). This provides support for common strings like [VERSION], [CHANNEL], [LANGUAGE], [OS], etc. The Help and Home sidetray code has been updated to use this new function, to avoid replicating this behavior 3 times. I also cleaned up the app_settings/settings.xml file and removed the old search keys of: SearchURLDefault, SearchURLQuery, and SearchURLSuffix2.
Diffstat (limited to 'indra/newview/llviewerhome.cpp')
-rw-r--r--indra/newview/llviewerhome.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/indra/newview/llviewerhome.cpp b/indra/newview/llviewerhome.cpp
index 58630978c4..2bae07f665 100644
--- a/indra/newview/llviewerhome.cpp
+++ b/indra/newview/llviewerhome.cpp
@@ -35,12 +35,11 @@
#include "llviewerhome.h"
#include "lllogininstance.h"
+#include "llsd.h"
#include "llui.h"
#include "lluri.h"
-#include "llsd.h"
-#include "llversioninfo.h"
#include "llviewercontrol.h"
-#include "llviewernetwork.h"
+#include "llweb.h"
//static
std::string LLViewerHome::getHomeURL()
@@ -49,16 +48,12 @@ std::string LLViewerHome::getHomeURL()
// this value from settings.xml and support various substitutions
LLSD substitution;
- substitution["VERSION"] = LLVersionInfo::getVersion();
- substitution["CHANNEL"] = LLURI::escape(gSavedSettings.getString("VersionChannelName"));
- substitution["LANGUAGE"] = LLUI::getLanguage();
substitution["AUTH_KEY"] = LLURI::escape(getAuthKey());
- substitution["GRID"] = LLViewerLogin::getInstance()->getGridLabel();
+ // get the home URL and expand all of the substitutions
+ // (also adds things like [LANGUAGE], [VERSION], [OS], etc.)
std::string homeURL = gSavedSettings.getString("HomeSidePanelURL");
- LLStringUtil::format(homeURL, substitution);
-
- return homeURL;
+ return LLWeb::expandURLSubstitutions(homeURL, substitution);
}
//static