diff --git a/indra/newview/fscommon.cpp b/indra/newview/fscommon.cpp index 4fc5740da1..d59ef02a5b 100644 --- a/indra/newview/fscommon.cpp +++ b/indra/newview/fscommon.cpp @@ -92,10 +92,10 @@ bool FSCommon::is_irc_me_prefix(std::string_view text) std::string FSCommon::unescape_name(std::string_view name) { // bugfix for SL-46920: preventing filenames that break stuff. - char * curl_str = curl_unescape(name.data(), static_cast(name.size())); // Calling data() should be ok here because we also pass the length + char* curl_str = curl_unescape(name.data(), static_cast(name.size())); // Calling data() should be ok here because we also pass the length std::string unescaped_name(curl_str); curl_free(curl_str); - curl_str = NULL; + curl_str = nullptr; return unescaped_name; } @@ -301,11 +301,12 @@ bool FSCommon::isLinden(const LLUUID& av_id) if (LLGridManager::getInstance()->isInOpenSim()) { LLViewerRegion* region = gAgent.getRegion(); - if (!region) return false; - bool is_god = false; + if (!region) + return false; + + bool is_god{ false }; // They may not be "Lindens" per se, but opensim has gods. - std::set gods = region->getGods(); - if (!gods.empty()) + if (std::set gods = region->getGods(); !gods.empty()) { is_god = (gods.find(first_name + " " + last_name) != gods.end() || gods.find(last_name) != gods.end()); @@ -453,7 +454,7 @@ std::string FSCommon::getAvatarNameByDisplaySettings(const LLAvatarName& av_name std::string name; static LLCachedControl NameTagShowUsernames(gSavedSettings, "NameTagShowUsernames"); static LLCachedControl UseDisplayNames(gSavedSettings, "UseDisplayNames"); - if ((NameTagShowUsernames) && (UseDisplayNames)) + if (NameTagShowUsernames && UseDisplayNames) { name = av_name.getCompleteName(); } @@ -494,21 +495,21 @@ bool FSCommon::isDefaultTexture(const LLUUID& asset_id) bool FSCommon::isLegacySkin() { - std::string current_skin = gSavedSettings.getString("FSInternalSkinCurrent"); - return (current_skin == "Vintage"); + static bool is_legacy_skin = gSavedSettings.getString("FSInternalSkinCurrent") == "Vintage"; + return is_legacy_skin; } bool FSCommon::isFilterEditorKeyCombo(KEY key, MASK mask) { - return (mask == MASK_CONTROL && key == 'F' && gSavedSettings.getBOOL("FSSelectLocalSearchEditorOnShortcut")); + static LLCachedControl select_search_on_shortcut(gSavedSettings, "FSSelectLocalSearchEditorOnShortcut"); + return (mask == MASK_CONTROL && key == 'F' && select_search_on_shortcut); } LLUUID FSCommon::getGroupForRezzing() { LLUUID group_id{ gAgent.getGroupID() }; - LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); - if (parcel && gSavedSettings.getBOOL("RezUnderLandGroup")) + if (LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); parcel && gSavedSettings.getBOOL("RezUnderLandGroup")) { // In both cases, group-owned or not, the group ID is the same; // No need to query the parcel owner ID as it will be either diff --git a/indra/newview/llagentbenefits.cpp b/indra/newview/llagentbenefits.cpp index ce14b51ce7..5716617de1 100644 --- a/indra/newview/llagentbenefits.cpp +++ b/indra/newview/llagentbenefits.cpp @@ -307,7 +307,7 @@ S32 LLAgentBenefits::get2KTextureUploadCost(S32 area) const { // OpenSim legacy economy //return m_texture_upload_cost; - return LLGridManager::instance().isInSecondLife() ? m_texture_upload_cost : LLGlobalEconomy::instance().getPriceUpload(); + return getTextureUploadCost(); // } return m_2k_texture_upload_cost[0]; diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index b73a5ef9f6..ef74b65272 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -742,6 +742,10 @@ bool idle_startup() gSavedSettings.setBOOL("FSInternalShowNavbarFavoritesPanel", gSavedSettings.getBOOL("ShowNavbarFavoritesPanel")); // + // Added to determine if toolbar gets hidden when empty + if (gToolBarView) + gToolBarView->setHideBottomOnEmpty(FSCommon::isLegacySkin()); + if (LLFeatureManager::getInstance()->isSafe()) { LLNotificationsUtil::add("DisplaySetToSafe"); diff --git a/indra/newview/lltoolbarview.cpp b/indra/newview/lltoolbarview.cpp index 03210d1d65..a2e5ceb2a3 100644 --- a/indra/newview/lltoolbarview.cpp +++ b/indra/newview/lltoolbarview.cpp @@ -131,9 +131,6 @@ bool LLToolBarView::postBuild() // Member variable needed for console chat bottom offset mBottomChatStack = findChild("bottom_chat_stack"); - // Added to determine if toolbar gets hidden when empty - mHideBottomOnEmpty = FSCommon::isLegacySkin(); - return true; } diff --git a/indra/newview/lltoolbarview.h b/indra/newview/lltoolbarview.h index f75babb56b..0d2d080f52 100644 --- a/indra/newview/lltoolbarview.h +++ b/indra/newview/lltoolbarview.h @@ -102,9 +102,12 @@ public: bool isModified() const; // Getters for member variables needed for console chat bottom offset - LLView* getBottomChatStack() const { return mBottomChatStack; }; + LLView* getBottomChatStack() const { return mBottomChatStack; } // + // Added to determine if toolbar gets hidden when empty + void setHideBottomOnEmpty(bool hideBottomOnEmpty) { mHideBottomOnEmpty = hideBottomOnEmpty; } + protected: friend class LLUICtrlFactory; LLToolBarView(const Params&); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 9cb532b399..55289bd697 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -7336,10 +7336,9 @@ void LLViewerWindow::setUIVisibility(bool visible) // Beq Note: Added a skin check to fix FIRE-29517 "hitch when entering mouselook" // This was caused having to search for a non-existent childview. If another skin other than vintage // ever needs chat_bar_utility_bar_stack in the future, this will need to be updated. - if (gSavedSettings.getString("FSInternalSkinCurrent") == "Vintage") + if (FSCommon::isLegacySkin()) { - LLView* utilityBarStack = mRootView->findChildView("chat_bar_utility_bar_stack"); - if (utilityBarStack) + if (LLView* utilityBarStack = mRootView->findChildView("chat_bar_utility_bar_stack"); utilityBarStack) { utilityBarStack->setVisible(visible); }