diff options
Diffstat (limited to 'indra/newview/llversioninfo.cpp')
-rwxr-xr-x | indra/newview/llversioninfo.cpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/indra/newview/llversioninfo.cpp b/indra/newview/llversioninfo.cpp index 6a8fad0134..178ea3d50e 100755 --- a/indra/newview/llversioninfo.cpp +++ b/indra/newview/llversioninfo.cpp @@ -133,3 +133,43 @@ void LLVersionInfo::resetChannel(const std::string& channel) sWorkingChannelName = channel; sVersionChannel.clear(); // Reset version and channel string til next use. } + +//static +ViewerMaturity getViewerMaturity() +{ + ViewerMaturity maturity; + + std::string channel = getChannel(); + + static const boost::regex is_test_channel("\\bTest\\b"); + static const boost::regex is_beta_channel("\\bBeta\\b"); + static const boost::regex is_project_channel("\\bProject\\b"); + static const boost::regex is_release_channel("\\bRelease\\b"); + + if (boost::regex_search(channel, is_release_channel)) + { + maturity = RELEASE_VIEWER; + } + else if (boost::regex_search(channel, is_beta_channel)) + { + maturity = BETA_VIEWER; + } + else if (boost::regex_search(channel, is_project_channel)) + { + maturity = PROJECT_VIEWER; + } + else if (boost::regex_search(channel, is_test_channel)) + { + maturity = TEST_VIEWER; + } + else + { + LL_WARNS() << "Channel '" << channel + << "' does not follow naming convention, assuming Test" + << LL_ENDL; + maturity = TEST_VIEWER; + } + return maturity; +} + + |