diff options
author | Vadim Savchuk <vsavchuk@productengine.com> | 2009-12-16 14:56:18 +0200 |
---|---|---|
committer | Vadim Savchuk <vsavchuk@productengine.com> | 2009-12-16 14:56:18 +0200 |
commit | 734f37816ef35089bc0f5710dc1f9684bc5b9b69 (patch) | |
tree | 38bcf9ca3bce50b9d0fba8b717b910bcbba638d7 /indra/newview/llviewerhelputil.cpp | |
parent | e398f41074f40c0779d7cc29a8127540ac78b1f9 (diff) | |
parent | 88291b378eda6178ae3f2cbda60feddf0e68e3fa (diff) |
Merge from default branch.
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview/llviewerhelputil.cpp')
-rw-r--r-- | indra/newview/llviewerhelputil.cpp | 43 |
1 files changed, 8 insertions, 35 deletions
diff --git a/indra/newview/llviewerhelputil.cpp b/indra/newview/llviewerhelputil.cpp index df08470518..5ba4fc834c 100644 --- a/indra/newview/llviewerhelputil.cpp +++ b/indra/newview/llviewerhelputil.cpp @@ -34,12 +34,11 @@ #include "llviewerprecompiledheaders.h" #include "llviewerhelputil.h" -#include "llcontrol.h" +#include "llsd.h" #include "llstring.h" -#include "llsys.h" #include "lluri.h" -#include "llversioninfo.h" - +#include "llweb.h" +#include "llviewercontrol.h" ////////////////////////////////////////////// // Build a help URL from a topic and formatter @@ -59,40 +58,14 @@ std::string LLViewerHelpUtil::helpURLEncode( const std::string &component ) return escaped; } -static std::string buildHelpVersion( const U32 ver_int ) -{ - std::ostringstream ver_str; - ver_str << ver_int; - return ver_str.str(); // not encoded - numbers are rfc3986-safe -} - //static -std::string LLViewerHelpUtil::buildHelpURL( const std::string &topic, - LLControlGroup &savedSettings, - const LLOSInfo &osinfo ) +std::string LLViewerHelpUtil::buildHelpURL( const std::string &topic) { - std::string helpURL = savedSettings.getString("HelpURLFormat"); LLSD substitution; substitution["TOPIC"] = helpURLEncode(topic); - substitution["CHANNEL"] = helpURLEncode(savedSettings.getString("VersionChannelName")); - - substitution["VERSION"] = helpURLEncode(LLVersionInfo::getVersion()); - substitution["VERSION_MAJOR"] = buildHelpVersion(LLVersionInfo::getMajor()); - substitution["VERSION_MINOR"] = buildHelpVersion(LLVersionInfo::getMinor()); - substitution["VERSION_PATCH"] = buildHelpVersion(LLVersionInfo::getPatch()); - substitution["VERSION_BUILD"] = buildHelpVersion(LLVersionInfo::getBuild()); - - substitution["OS"] = helpURLEncode(osinfo.getOSStringSimple()); - - std::string language = savedSettings.getString("Language"); - if( language.empty() || language == "default" ) - { - language = savedSettings.getString("SystemLanguage"); - } - substitution["LANGUAGE"] = helpURLEncode(language); - - LLStringUtil::format(helpURL, substitution); - - return helpURL; + // get the help URL and expand all of the substitutions + // (also adds things like [LANGUAGE], [VERSION], [OS], etc.) + std::string helpURL = gSavedSettings.getString("HelpURLFormat"); + return LLWeb::expandURLSubstitutions(helpURL, substitution); } |