diff options
author | Mark Palange (Mani) <palange@lindenlab.com> | 2010-11-01 15:18:18 -0700 |
---|---|---|
committer | Mark Palange (Mani) <palange@lindenlab.com> | 2010-11-01 15:18:18 -0700 |
commit | 6ab2e44e945ddc085a7b4b5f1524de924419a897 (patch) | |
tree | 37baa5e1439e1612e025dc71a504ecb530145499 /indra/newview/llversioninfo.cpp | |
parent | be8c9fc21758bcbc1d9f3d565b221310344231bd (diff) |
VWR-23666 Removed setting VersionChannelName. LLVersionInfo::resetChannel() and unit tests. Reviewed by brad.
Diffstat (limited to 'indra/newview/llversioninfo.cpp')
-rw-r--r-- | indra/newview/llversioninfo.cpp | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/indra/newview/llversioninfo.cpp b/indra/newview/llversioninfo.cpp index 733d05834a..53994c68f2 100644 --- a/indra/newview/llversioninfo.cpp +++ b/indra/newview/llversioninfo.cpp @@ -95,9 +95,42 @@ const std::string &LLVersionInfo::getShortVersion() return version; } +namespace +{ + /// Storage of the channel name the viewer is using. + // The channel name is set by hardcoded constant, + // or by calling LLVersionInfo::resetChannel() + std::string sWorkingChannelName(LL_CHANNEL); + + // Storage for the "version and channel" string. + // This will get reset too. + std::string sVersionChannel(""); +} + +//static +const std::string &LLVersionInfo::getVersionAndChannel() +{ + if (sVersionChannel.empty()) + { + // cache the version string + std::ostringstream stream; + stream << LLVersionInfo::getVersion() + << " " + << LLVersionInfo::getChannel(); + sVersionChannel = stream.str(); + } + + return sVersionChannel; +} + //static const std::string &LLVersionInfo::getChannel() { - static std::string name(LL_CHANNEL); - return name; + return sWorkingChannelName; +} + +void LLVersionInfo::resetChannel(const std::string& channel) +{ + sWorkingChannelName = channel; + sVersionChannel.clear(); // Reset version and channel string til next use. } |