From 0ea0b980848d69aee1f9aee9cc360abc61dc1eec Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 16 Sep 2019 20:32:25 +0300 Subject: DRTVWR-493 LLLogChat to singleton --- indra/newview/lllogchat.h | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to 'indra/newview/lllogchat.h') diff --git a/indra/newview/lllogchat.h b/indra/newview/lllogchat.h index fcbd38a044..b71a34ae0a 100644 --- a/indra/newview/lllogchat.h +++ b/indra/newview/lllogchat.h @@ -79,8 +79,10 @@ public: static void deleteHistory(); }; -class LLLogChat +class LLLogChat : public LLSingleton { + LLSINGLETON(LLLogChat); + ~LLLogChat(); public: // status values for callback function enum ELogLineType { @@ -107,7 +109,7 @@ public: static void loadChatHistory(const std::string& file_name, std::list& messages, const LLSD& load_params = LLSD()); typedef boost::signals2::signal save_history_signal_t; - static boost::signals2::connection setSaveHistorySignal(const save_history_signal_t::slot_type& cb); + boost::signals2::connection setSaveHistorySignal(const save_history_signal_t::slot_type& cb); static bool moveTranscripts(const std::string currentDirectory, const std::string newDirectory, @@ -123,21 +125,23 @@ public: static bool isAdHocTranscriptExist(std::string file_name); static bool isTranscriptFileFound(std::string fullname); - static bool historyThreadsFinished(LLUUID session_id); - static LLLoadHistoryThread* getLoadHistoryThread(LLUUID session_id); - static LLDeleteHistoryThread* getDeleteHistoryThread(LLUUID session_id); - static bool addLoadHistoryThread(LLUUID& session_id, LLLoadHistoryThread* lthread); - static bool addDeleteHistoryThread(LLUUID& session_id, LLDeleteHistoryThread* dthread); - static void cleanupHistoryThreads(); + bool historyThreadsFinished(LLUUID session_id); + LLLoadHistoryThread* getLoadHistoryThread(LLUUID session_id); + LLDeleteHistoryThread* getDeleteHistoryThread(LLUUID session_id); + bool addLoadHistoryThread(LLUUID& session_id, LLLoadHistoryThread* lthread); + bool addDeleteHistoryThread(LLUUID& session_id, LLDeleteHistoryThread* dthread); + void cleanupHistoryThreads(); private: static std::string cleanFileName(std::string filename); - static save_history_signal_t * sSaveHistorySignal; - static std::map sLoadHistoryThreads; - static std::map sDeleteHistoryThreads; - static LLMutex* sHistoryThreadsMutex; - static LLMutex* historyThreadsMutex(); + LLMutex* historyThreadsMutex(); + void triggerHistorySignal(); + + save_history_signal_t * mSaveHistorySignal; + std::map mLoadHistoryThreads; + std::map mDeleteHistoryThreads; + LLMutex* mHistoryThreadsMutex; }; /** -- cgit v1.2.3