diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llconversationlog.cpp | 38 | ||||
-rw-r--r-- | indra/newview/llconversationlog.h | 9 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_landmarks.xml | 4 |
3 files changed, 37 insertions, 14 deletions
diff --git a/indra/newview/llconversationlog.cpp b/indra/newview/llconversationlog.cpp index df9350407d..137b97326c 100644 --- a/indra/newview/llconversationlog.cpp +++ b/indra/newview/llconversationlog.cpp @@ -140,6 +140,31 @@ void LLConversation::setListenIMFloaterOpened() } } /************************************************************************/ +/* LLConversationLogFriendObserver implementation */ +/************************************************************************/ + +// Note : An LLSingleton like LLConversationLog cannot be an LLFriendObserver +// at the same time. +// This is because avatar observers are deleted by the observed object which +// conflicts with the way LLSingleton are deleted. + +class LLConversationLogFriendObserver : public LLFriendObserver +{ +public: + LLConversationLogFriendObserver() {} + virtual ~LLConversationLogFriendObserver() {} + virtual void changed(U32 mask); +}; + +void LLConversationLogFriendObserver::changed(U32 mask) +{ + if (mask & (LLFriendObserver::ADD | LLFriendObserver::REMOVE)) + { + LLConversationLog::instance().notifyObservers(); + } +} + +/************************************************************************/ /* LLConversationLog implementation */ /************************************************************************/ @@ -148,7 +173,9 @@ LLConversationLog::LLConversationLog() loadFromFile(getFileName()); LLIMMgr::instance().addSessionObserver(this); - LLAvatarTracker::instance().addObserver(this); + + mFriendObserver = new LLConversationLogFriendObserver; + LLAvatarTracker::instance().addObserver(mFriendObserver); } void LLConversationLog::logConversation(const LLConversation& conversation) { @@ -204,15 +231,6 @@ void LLConversationLog::sessionAdded(const LLUUID& session_id, const std::string } } -// LLFriendObserver -void LLConversationLog::changed(U32 mask) -{ - if (mask & (LLFriendObserver::ADD | LLFriendObserver::REMOVE)) - { - notifyObservers(); - } -} - void LLConversationLog::cache() { saveToFile(getFileName()); diff --git a/indra/newview/llconversationlog.h b/indra/newview/llconversationlog.h index 18865bb80e..a7457d55e3 100644 --- a/indra/newview/llconversationlog.h +++ b/indra/newview/llconversationlog.h @@ -99,7 +99,7 @@ private: * To distinguish two conversations with the same sessionID it's also needed to compare their creation date. */ -class LLConversationLog : public LLSingleton<LLConversationLog>, LLIMSessionObserver, LLFriendObserver +class LLConversationLog : public LLSingleton<LLConversationLog>, LLIMSessionObserver { friend class LLSingleton<LLConversationLog>; public: @@ -126,8 +126,8 @@ public: virtual void sessionRemoved(const LLUUID& session_id){} // Stub virtual void sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id){} // Stub - // LLFriendObserver trigger - virtual void changed(U32 mask); + // Triggered by LLFriendObserver change + void notifyObservers(); /** * public method which is called on viewer exit to save conversation log @@ -137,7 +137,6 @@ public: private: LLConversationLog(); - void notifyObservers(); /** * constructs file name in which conversations log will be saved @@ -152,6 +151,8 @@ private: typedef std::vector<LLConversation> conversations_vec_t; std::vector<LLConversation> mConversations; std::set<LLConversationLogObserver*> mObservers; + + LLFriendObserver* mFriendObserver; // Observer of the LLAvatarTracker instance }; class LLConversationLogObserver diff --git a/indra/newview/skins/default/xui/en/panel_landmarks.xml b/indra/newview/skins/default/xui/en/panel_landmarks.xml index 39805637a0..ebd4c6a805 100644 --- a/indra/newview/skins/default/xui/en/panel_landmarks.xml +++ b/indra/newview/skins/default/xui/en/panel_landmarks.xml @@ -35,6 +35,7 @@ left="0" mouse_opaque="true" name="favorites_list" + scroll.hide_scrollbar="true" start_folder.name="Favorites" width="307"/> </accordion_tab> @@ -51,6 +52,7 @@ left="0" mouse_opaque="true" name="landmarks_list" + scroll.hide_scrollbar="true" start_folder.name="Landmarks" width="307"/> </accordion_tab> @@ -67,6 +69,7 @@ left="0" mouse_opaque="true" name="my_inventory_list" + scroll.hide_scrollbar="true" start_folder.name="My Inventory" width="307"/> </accordion_tab> @@ -83,6 +86,7 @@ left="0" mouse_opaque="true" name="library_list" + scroll.hide_scrollbar="true" start_folder.name="LIBRARY" width="313"/> </accordion_tab> |