From bdd6f81decdb5ef3246c2e9baf684670f95988b2 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Mon, 8 May 2023 19:12:39 +0200 Subject: [PATCH] Add some const because why not? --- indra/newview/fsdata.cpp | 26 +++++++++++++------------- indra/newview/fsdata.h | 34 +++++++++++++++++----------------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/indra/newview/fsdata.cpp b/indra/newview/fsdata.cpp index ad7ae37544..f56772ea3d 100644 --- a/indra/newview/fsdata.cpp +++ b/indra/newview/fsdata.cpp @@ -612,7 +612,7 @@ void FSData::selectNextMOTD() } //WS: Create a new LLSD based on the data from the mLegacyClientList if -LLSD FSData::resolveClientTag(const LLUUID& id, bool new_system, const LLColor4& color) +LLSD FSData::resolveClientTag(const LLUUID& id, bool new_system, const LLColor4& color) const { LLSD curtag; curtag["uuid"] = id.asString(); @@ -762,9 +762,9 @@ void FSData::saveLLSD(const LLSD& data, const std::string& filename, const LLDat #endif } -S32 FSData::getAgentFlags(const LLUUID& avatar_id) +S32 FSData::getAgentFlags(const LLUUID& avatar_id) const { - std::map::iterator iter = mTeamAgents.find(avatar_id); + std::map::const_iterator iter = mTeamAgents.find(avatar_id); if (iter == mTeamAgents.end()) { return -1; @@ -772,27 +772,27 @@ S32 FSData::getAgentFlags(const LLUUID& avatar_id) return iter->second; } -bool FSData::isSupport(const LLUUID& avatar_id) +bool FSData::isSupport(const LLUUID& avatar_id) const { S32 flags = getAgentFlags(avatar_id); return (flags != -1 && (flags & SUPPORT)); } -bool FSData::isDeveloper(const LLUUID& avatar_id) +bool FSData::isDeveloper(const LLUUID& avatar_id) const { S32 flags = getAgentFlags(avatar_id); return (flags != -1 && (flags & DEVELOPER)); } -bool FSData::isQA(const LLUUID& avatar_id) +bool FSData::isQA(const LLUUID& avatar_id) const { S32 flags = getAgentFlags(avatar_id); return (flags != -1 && (flags & QA)); } -LLSD FSData::allowedLogin() +LLSD FSData::allowedLogin() const { - std::map::iterator iter = mBlockedVersions.find(LLVersionInfo::getInstance()->getChannelAndVersionFS()); + std::map::const_iterator iter = mBlockedVersions.find(LLVersionInfo::getInstance()->getChannelAndVersionFS()); if (iter == mBlockedVersions.end()) { return LLSD(); @@ -831,24 +831,24 @@ LLSD FSData::allowedLogin() } } -bool FSData::isFirestormGroup(const LLUUID& id) +bool FSData::isFirestormGroup(const LLUUID& id) const { return isSupportGroup(id) || isTestingGroup(id); } -bool FSData::isSupportGroup(const LLUUID& id) +bool FSData::isSupportGroup(const LLUUID& id) const { return mSupportGroup.count(id); } -bool FSData::isTestingGroup(const LLUUID& id) +bool FSData::isTestingGroup(const LLUUID& id) const { return mTestingGroup.count(id); } -bool FSData::isAgentFlag(const LLUUID& agent_id, flags_t flag) +bool FSData::isAgentFlag(const LLUUID& agent_id, flags_t flag) const { - std::map::iterator iter = mTeamAgents.find(agent_id); + std::map::const_iterator iter = mTeamAgents.find(agent_id); if (iter == mTeamAgents.end()) { return false; diff --git a/indra/newview/fsdata.h b/indra/newview/fsdata.h index 76926fa132..eecec41fba 100644 --- a/indra/newview/fsdata.h +++ b/indra/newview/fsdata.h @@ -45,7 +45,7 @@ public: void processResponder(const LLSD& content, const std::string& url, bool save_to_file, const LLDate& last_modified); void addAgents(); - LLSD resolveClientTag(const LLUUID& id, bool new_system, const LLColor4& new_system_color); + LLSD resolveClientTag(const LLUUID& id, bool new_system, const LLColor4& new_system_color) const; enum flags_t { @@ -59,34 +59,31 @@ public: GATEWAY = (1 << 7), //0x80 128 }; - std::set mSupportGroup; - std::set mTestingGroup; - - bool isDeveloper(const LLUUID& avatar_id); - bool isSupport(const LLUUID& avatar_id); - bool isQA(const LLUUID& avatar_id); - bool isFirestormGroup(const LLUUID& id); - bool isSupportGroup(const LLUUID& id); - bool isTestingGroup(const LLUUID& id); + bool isDeveloper(const LLUUID& avatar_id) const; + bool isSupport(const LLUUID& avatar_id) const; + bool isQA(const LLUUID& avatar_id) const; + bool isFirestormGroup(const LLUUID& id) const; + bool isSupportGroup(const LLUUID& id) const; + bool isTestingGroup(const LLUUID& id) const; // returns -1 if agent is not found. - S32 getAgentFlags(const LLUUID& avatar_id); + S32 getAgentFlags(const LLUUID& avatar_id) const; - LLSD allowedLogin(); + LLSD allowedLogin() const; - bool enableLegacySearch() {return mLegacySearch;} + bool enableLegacySearch() const { return mLegacySearch; } std::string processRequestForInfo(const LLUUID& requester, const std::string& message, const std::string& name, const LLUUID& sessionid); static LLSD getSystemInfo(); static void callbackReqInfo(const LLSD ¬ification, const LLSD &response); - std::string getOpenSimMOTD() { return mOpenSimMOTD; } + std::string getOpenSimMOTD() const { return mOpenSimMOTD; } void selectNextMOTD(); - bool getFSDataDone() { return mFSDataDone; } - bool getAgentsDone() { return mAgentsDone; } + bool getFSDataDone() const { return mFSDataDone; } + bool getAgentsDone() const { return mAgentsDone; } - bool isAgentFlag(const LLUUID& agent_id, FSData::flags_t flag); + bool isAgentFlag(const LLUUID& agent_id, FSData::flags_t flag) const; private: static void sendInfo(const LLUUID& destination, const LLUUID& sessionid, const std::string& my_name, EInstantMessage dialog); @@ -102,6 +99,9 @@ private: std::map mTeamAgents; std::map mBlockedVersions; + uuid_set_t mSupportGroup; + uuid_set_t mTestingGroup; + LLSD mHeaders; LLSD mLegacyClientList; LLSD mRandomMOTDs;