Add a mechanism with which to determine viewer channel in the case of no commandline option

This commit is contained in:
Drake Arconis
2016-01-20 10:09:23 -05:00
parent 5e611669ab
commit 6b84bfac15
3 changed files with 33 additions and 0 deletions

View File

@@ -2262,6 +2262,33 @@ bool LLAppViewer::initConfiguration()
LL_INFOS() << "Using command line specified settings filename: "
<< user_settings_filename << LL_ENDL;
}
else
{
std::string channel(LLVersionInfo::getChannel());
LLStringUtil::toLower(channel);
switch (LLVersionInfo::getViewerMaturity())
{
default:
case LLVersionInfo::TEST_VIEWER:
case LLVersionInfo::PROJECT_VIEWER:
case LLVersionInfo::ALPHA_VIEWER:
case LLVersionInfo::BETA_VIEWER:
{
channel.erase(std::remove_if(channel.begin(), channel.end(), isspace), channel.end());
break;
}
case LLVersionInfo::RELEASE_VIEWER:
size_t pos = channel.find(' ');
if (pos != channel.npos)
channel.erase(pos, channel.npos);
break;
}
std::string settings_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS,
llformat("settings_%s.xml", channel.c_str()));
gSavedSettings.setString("ClientSettingsFile", settings_filename);
LL_INFOS() << "Using default settings filename from channel: "
<< settings_filename << LL_ENDL;
}
// - load overrides from user_settings
loadSettingsFromDirectory(settings_w, "User");

View File

@@ -141,6 +141,7 @@ LLVersionInfo::ViewerMaturity LLVersionInfo::getViewerMaturity()
std::string channel = getChannel();
static const boost::regex is_test_channel("\\bTest\\b");
static const boost::regex is_alpha_channel("\\bAlpha\\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");
@@ -153,6 +154,10 @@ LLVersionInfo::ViewerMaturity LLVersionInfo::getViewerMaturity()
{
maturity = BETA_VIEWER;
}
else if (boost::regex_search(channel, is_alpha_channel))
{
maturity = ALPHA_VIEWER;
}
else if (boost::regex_search(channel, is_project_channel))
{
maturity = PROJECT_VIEWER;

View File

@@ -73,6 +73,7 @@ public:
{
TEST_VIEWER,
PROJECT_VIEWER,
ALPHA_VIEWER,
BETA_VIEWER,
RELEASE_VIEWER
} ViewerMaturity;