From 3fc39776dd7a347870a5005808c69f27413de424 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 27 May 2015 14:38:51 -0400 Subject: MAINT-5232: Remove dubious polling in LLMuteList::getInstance(). The LLMuteList singleton instance might be requested before gMessageSystem is constructed. LLMuteList wants to register a couple gMessageSystem callbacks. Since gMessageSystem is not (yet) itself an LLSingleton, LLMuteList's constructor can't just call it into existence. Until now, LLMuteList overrode LLSingleton's getInstance() method: every time getInstance() was called, the subclass override method would check whether gMessageSystem had been initialized, and if so, register its callbacks before forwarding the call to the base-class LLSingleton::getInstance() method. Change to use LLPounceable::callWhenReady() instead. This is the reason gMessageSystem was made an LLPounceable. --- indra/newview/llmutelist.h | 5 ----- 1 file changed, 5 deletions(-) (limited to 'indra/newview/llmutelist.h') diff --git a/indra/newview/llmutelist.h b/indra/newview/llmutelist.h index 3e998b4f0e..d315f225bf 100755 --- a/indra/newview/llmutelist.h +++ b/indra/newview/llmutelist.h @@ -84,11 +84,6 @@ public: LLMuteList(); ~LLMuteList(); - // Implemented locally so that we can perform some delayed initialization. - // Callers should be careful to call this one and not LLSingleton::getInstance() - // which would circumvent that mechanism. -MG - static LLMuteList* getInstance(); - void addObserver(LLMuteListObserver* observer); void removeObserver(LLMuteListObserver* observer); -- cgit v1.2.3 From d2c3c2f9fe197b1856e9a8ed37aeb56b77e2ff07 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 15 Sep 2016 20:18:12 -0400 Subject: MAINT-5232: Normalize LLSingleton subclasses. A shocking number of LLSingleton subclasses had public constructors -- and in several instances, were being explicitly instantiated independently of the LLSingleton machinery. This breaks the new LLSingleton dependency-tracking machinery. It seems only fair that if you say you want an LLSingleton, there should only be ONE INSTANCE! Introduce LLSINGLETON() and LLSINGLETON_EMPTY_CTOR() macros. These handle the friend class LLSingleton; and explicitly declare a private nullary constructor. To try to enforce the LLSINGLETON() convention, introduce a new pure virtual LLSingleton method you_must_use_LLSINGLETON_macro() which is, as you might suspect, defined by the macro. If you declare an LLSingleton subclass without using LLSINGLETON() or LLSINGLETON_EMPTY_CTOR() in the class body, you can't instantiate the subclass for lack of a you_must_use_LLSINGLETON_macro() implementation -- which will hopefully remind the coder. Trawl through ALL LLSingleton subclass definitions, sprinkling in LLSINGLETON() or LLSINGLETON_EMPTY_CTOR() as appropriate. Remove all explicit constructor declarations, public or private, along with relevant 'friend class LLSingleton' declarations. Where destructors are declared, move them into private section as well. Where the constructor was inline but nontrivial, move out of class body. Fix several LLSingleton abuses revealed by making ctors/dtors private: LLGlobalEconomy was both an LLSingleton and the base class for LLRegionEconomy, a non-LLSingleton. (Therefore every LLRegionEconomy instance contained another instance of the LLGlobalEconomy "singleton.") Extract LLBaseEconomy; LLGlobalEconomy is now a trivial subclass of that. LLRegionEconomy, as you might suspect, now derives from LLBaseEconomy. LLToolGrab, an LLSingleton, was also explicitly instantiated by LLToolCompGun's constructor. Extract LLToolGrabBase, explicitly instantiated, with trivial subclass LLToolGrab, the LLSingleton instance. (WARNING: LLToolGrabBase methods have an unnerving tendency to go after LLToolGrab::getInstance(). I DO NOT KNOW what should be the relationship between the instance in LLToolCompGun and the LLToolGrab singleton instance.) LLGridManager declared a variant constructor accepting (const std::string&), with the comment: // initialize with an explicity grid file for testing. As there is no evidence of this being called from anywhere, delete it. LLChicletBar's constructor accepted an optional (const LLSD&). As the LLSD parameter wasn't used, and as there is no evidence of it being passed from anywhere, delete the parameter. LLViewerWindow::shutdownViews() was checking LLNavigationBar:: instanceExists(), then deleting its getInstance() pointer -- leaving a dangling LLSingleton instance pointer, a land mine if any subsequent code should attempt to reference it. Use deleteSingleton() instead. ~LLAppViewer() was calling LLViewerEventRecorder::instance() and then explicitly calling ~LLViewerEventRecorder() on that instance -- leaving the LLSingleton instance pointer pointing to an allocated-but-destroyed instance. Use deleteSingleton() instead. --- indra/newview/llmutelist.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llmutelist.h') diff --git a/indra/newview/llmutelist.h b/indra/newview/llmutelist.h index 63d1a81ca6..4ceddc97fd 100644 --- a/indra/newview/llmutelist.h +++ b/indra/newview/llmutelist.h @@ -71,6 +71,8 @@ public: class LLMuteList : public LLSingleton { + LLSINGLETON(LLMuteList); + ~LLMuteList(); public: // reasons for auto-unmuting a resident enum EAutoReason @@ -81,8 +83,6 @@ public: AR_COUNT // enum count }; - LLMuteList(); - ~LLMuteList(); void addObserver(LLMuteListObserver* observer); void removeObserver(LLMuteListObserver* observer); -- cgit v1.2.3 From d23b6e442e0a4d3a8badb51efd7611e23d138b26 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Wed, 15 Mar 2017 12:08:30 +0200 Subject: MAINT-7168 Avatar rendering settings adjustments --- indra/newview/llmutelist.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'indra/newview/llmutelist.h') diff --git a/indra/newview/llmutelist.h b/indra/newview/llmutelist.h index 4ceddc97fd..9ab978353b 100644 --- a/indra/newview/llmutelist.h +++ b/indra/newview/llmutelist.h @@ -175,5 +175,25 @@ public: virtual void onChangeDetailed(const LLMute& ) { } }; +class LLRenderMuteList : public LLSingleton +{ + LLSINGLETON(LLRenderMuteList); +public: + bool loadFromFile(); + bool saveToFile(); + S32 getSavedVisualMuteSetting(const LLUUID& agent_id); + void saveVisualMuteSetting(const LLUUID& agent_id, S32 setting); + + void addObserver(LLMuteListObserver* observer); + void removeObserver(LLMuteListObserver* observer); + + std::map sVisuallyMuteSettingsMap; + +private: + void notifyObservers(); + typedef std::set observer_set_t; + observer_set_t mObservers; +}; + #endif //LL_MUTELIST_H -- cgit v1.2.3 From bb3380b2207ea1413536320782d07cb27bc3a47c Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Wed, 10 May 2017 15:41:16 +0300 Subject: MAINT-7359 improve new Avatar Render Settings window --- indra/newview/llmutelist.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/newview/llmutelist.h') diff --git a/indra/newview/llmutelist.h b/indra/newview/llmutelist.h index 9ab978353b..f2fcf3dbb3 100644 --- a/indra/newview/llmutelist.h +++ b/indra/newview/llmutelist.h @@ -184,10 +184,13 @@ public: S32 getSavedVisualMuteSetting(const LLUUID& agent_id); void saveVisualMuteSetting(const LLUUID& agent_id, S32 setting); + S32 getVisualMuteDate(const LLUUID& agent_id); + void addObserver(LLMuteListObserver* observer); void removeObserver(LLMuteListObserver* observer); std::map sVisuallyMuteSettingsMap; + std::map sVisuallyMuteDateMap; private: void notifyObservers(); -- cgit v1.2.3