Add a mechanism with which to determine viewer channel in the case of no commandline option
This commit is contained in:
@@ -2262,6 +2262,33 @@ bool LLAppViewer::initConfiguration()
|
|||||||
LL_INFOS() << "Using command line specified settings filename: "
|
LL_INFOS() << "Using command line specified settings filename: "
|
||||||
<< user_settings_filename << LL_ENDL;
|
<< 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
|
// - load overrides from user_settings
|
||||||
loadSettingsFromDirectory(settings_w, "User");
|
loadSettingsFromDirectory(settings_w, "User");
|
||||||
|
|||||||
@@ -141,6 +141,7 @@ LLVersionInfo::ViewerMaturity LLVersionInfo::getViewerMaturity()
|
|||||||
std::string channel = getChannel();
|
std::string channel = getChannel();
|
||||||
|
|
||||||
static const boost::regex is_test_channel("\\bTest\\b");
|
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_beta_channel("\\bBeta\\b");
|
||||||
static const boost::regex is_project_channel("\\bProject\\b");
|
static const boost::regex is_project_channel("\\bProject\\b");
|
||||||
static const boost::regex is_release_channel("\\bRelease\\b");
|
static const boost::regex is_release_channel("\\bRelease\\b");
|
||||||
@@ -153,6 +154,10 @@ LLVersionInfo::ViewerMaturity LLVersionInfo::getViewerMaturity()
|
|||||||
{
|
{
|
||||||
maturity = BETA_VIEWER;
|
maturity = BETA_VIEWER;
|
||||||
}
|
}
|
||||||
|
else if (boost::regex_search(channel, is_alpha_channel))
|
||||||
|
{
|
||||||
|
maturity = ALPHA_VIEWER;
|
||||||
|
}
|
||||||
else if (boost::regex_search(channel, is_project_channel))
|
else if (boost::regex_search(channel, is_project_channel))
|
||||||
{
|
{
|
||||||
maturity = PROJECT_VIEWER;
|
maturity = PROJECT_VIEWER;
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ public:
|
|||||||
{
|
{
|
||||||
TEST_VIEWER,
|
TEST_VIEWER,
|
||||||
PROJECT_VIEWER,
|
PROJECT_VIEWER,
|
||||||
|
ALPHA_VIEWER,
|
||||||
BETA_VIEWER,
|
BETA_VIEWER,
|
||||||
RELEASE_VIEWER
|
RELEASE_VIEWER
|
||||||
} ViewerMaturity;
|
} ViewerMaturity;
|
||||||
|
|||||||
Reference in New Issue
Block a user