summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2021-09-20 14:03:19 +0100
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2021-09-20 14:03:19 +0100
commit9bb566ea26c7fd5d93b5b42a9ee3f4aba92ebf7a (patch)
tree00f6cc59164c068d88ddc1a06fca464cfa2b2922
parentc10d601ce8d2a6ca7e354772a217a998cd9865b3 (diff)
SL-15999 - support for temporarily changing other settings while noninteractive, including a fix for unwanted SLURL redirects
-rw-r--r--indra/newview/llappviewer.cpp68
1 files changed, 41 insertions, 27 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 970bc0a83d..eab91f5d02 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -2439,6 +2439,37 @@ namespace
}
} // anonymous namespace
+// Set a named control temporarily for this session, as when set via the command line --set option.
+bool tempSetControl(const std::string& name, const std::string& value)
+{
+ std::string name_part;
+ std::string group_part;
+ LLControlVariable* control = NULL;
+
+ // Name can be further split into ControlGroup.Name, with the default control group being Global
+ size_t pos = name.find('.');
+ if (pos != std::string::npos)
+ {
+ group_part = name.substr(0, pos);
+ name_part = name.substr(pos+1);
+ LL_INFOS() << "Setting " << group_part << "." << name_part << " to " << value << LL_ENDL;
+ LLControlGroup* g = LLControlGroup::getInstance(group_part);
+ if (g) control = g->getControl(name_part);
+ }
+ else
+ {
+ LL_INFOS() << "Setting Global." << name << " to " << value << LL_ENDL;
+ control = gSavedSettings.getControl(name);
+ }
+
+ if (control)
+ {
+ control->setValue(value, false);
+ return true;
+ }
+ return false;
+}
+
bool LLAppViewer::initConfiguration()
{
//Load settings files list
@@ -2635,34 +2666,10 @@ bool LLAppViewer::initConfiguration()
{
const std::string& name = *itr;
const std::string& value = *(++itr);
- std::string name_part;
- std::string group_part;
- LLControlVariable* control = NULL;
-
- // Name can be further split into ControlGroup.Name, with the default control group being Global
- size_t pos = name.find('.');
- if (pos != std::string::npos)
+ if (!tempSetControl(name,value))
{
- group_part = name.substr(0, pos);
- name_part = name.substr(pos+1);
- LL_INFOS() << "Setting " << group_part << "." << name_part << " to " << value << LL_ENDL;
- LLControlGroup* g = LLControlGroup::getInstance(group_part);
- if (g) control = g->getControl(name_part);
- }
- else
- {
- LL_INFOS() << "Setting Global." << name << " to " << value << LL_ENDL;
- control = gSavedSettings.getControl(name);
- }
-
- if (control)
- {
- control->setValue(value, false);
- }
- else
- {
LL_WARNS() << "Failed --set " << name << ": setting name unknown." << LL_ENDL;
- }
+ }
}
}
}
@@ -2747,6 +2754,14 @@ bool LLAppViewer::initConfiguration()
}
}
+ gNonInteractive = gSavedSettings.getBOOL("NonInteractive");
+ if (gNonInteractive)
+ {
+ tempSetControl("SLURLPassToOtherInstance", "FALSE");
+ llassert_always(!gSavedSettings.getBOOL("SLURLPassToOtherInstance"));
+ }
+
+
// Handle slurl use. NOTE: Don't let SL-55321 reappear.
// This initial-SLURL logic, up through the call to
// sendURLToOtherInstance(), must precede LLSplashScreen::show() --
@@ -2978,7 +2993,6 @@ bool LLAppViewer::initWindow()
// store setting in a global for easy access and modification
gHeadlessClient = gSavedSettings.getBOOL("HeadlessClient");
- gNonInteractive = gSavedSettings.getBOOL("NonInteractive");
// always start windowed
BOOL ignorePixelDepth = gSavedSettings.getBOOL("IgnorePixelDepth");