From 4436e808b16b873d21b40ccf3f9f52b352faeca0 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 3 Feb 2017 12:49:19 -0500 Subject: DRTVWR-418: Eliminate llui reference to newview's gSavedSettings. Instead, since gSavedSettings is an LLControlGroup and LLControlGroup derives from LLInstanceTracker, just look up the LLControlGroup with canonical name. --- indra/llui/llfloater.cpp | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'indra/llui/llfloater.cpp') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 4f664a1ccc..e0f2a12a27 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -64,8 +64,6 @@ // use this to control "jumping" behavior when Ctrl-Tabbing const S32 TABBED_FLOATER_OFFSET = 0; -extern LLControlGroup gSavedSettings; - namespace LLInitParam { void TypeValues::declareValues() @@ -653,13 +651,22 @@ void LLFloater::openFloater(const LLSD& key) && !getFloaterHost() && (!getVisible() || isMinimized())) { - //Don't play a sound for incoming voice call based upon chat preference setting - bool playSound = !(getName() == "incoming call" && gSavedSettings.getBOOL("PlaySoundIncomingVoiceCall") == FALSE); + // gSavedSettings is a global instance of LLControlGroup, but since + // LLControlGroup is derived from LLInstanceTracker, we can also look + // it up by name. + LLControlGroup* gSavedSettingsp = LLControlGroup::getInstance("Global"); + //Play a sound for incoming voice call based upon chat preference setting. + //If it's not an incoming call, play it anyway. + //If we can't find gSavedSettings, play it anyway. + //If the setting is ON, play it anyway. + bool playSound = (getName() != "incoming call" || + (! gSavedSettingsp) || + gSavedSettingsp->getBOOL("PlaySoundIncomingVoiceCall")); - if(playSound) - { - make_ui_sound("UISndWindowOpen"); - } + if(playSound) + { + make_ui_sound("UISndWindowOpen"); + } } //RN: for now, we don't allow rehosting from one multifloater to another -- cgit v1.2.3