From 6d239f7cfae65e6c8354d9f94061e81e82112a44 Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 27 Apr 2010 11:56:13 -0700 Subject: Convert profile panel to new avatar name cache --- indra/newview/llpanelprofileview.cpp | 25 ++++++++----------------- indra/newview/llpanelprofileview.h | 10 ++++++---- 2 files changed, 14 insertions(+), 21 deletions(-) diff --git a/indra/newview/llpanelprofileview.cpp b/indra/newview/llpanelprofileview.cpp index 5688c6960b..526db2a192 100644 --- a/indra/newview/llpanelprofileview.cpp +++ b/indra/newview/llpanelprofileview.cpp @@ -108,8 +108,10 @@ void LLPanelProfileView::onOpen(const LLSD& key) } // Update the avatar name. - gCacheName->get(getAvatarId(), false, - boost::bind(&LLPanelProfileView::onNameCache, this, _1, _2, _3)); +// gCacheName->get(getAvatarId(), false, +// boost::bind(&LLPanelProfileView::onNameCache, this, _1, _2, _3)); + LLAvatarNameCache::get(getAvatarId(), + boost::bind(&LLPanelProfileView::onAvatarNameCache, this, _1, _2)); updateOnlineStatus(); @@ -199,22 +201,11 @@ void LLPanelProfileView::processOnlineStatus(bool online) mStatusText->setValue(status); } -void LLPanelProfileView::onNameCache(const LLUUID& id, const std::string& full_name, bool is_group) +void LLPanelProfileView::onAvatarNameCache(const LLUUID& agent_id, + const LLAvatarName& av_name) { - llassert(getAvatarId() == id); - // IDEVO - LLAvatarName av_name; - if (LLAvatarNameCache::useDisplayNames() - && LLAvatarNameCache::get(id, &av_name)) - { - getChild("user_name")->setValue( av_name.mDisplayName ); - getChild("user_slid")->setValue( av_name.mSLID ); - } - else - { - getChild("user_name")->setValue(full_name); - getChild("user_slid")->setValue(""); - } + getChild("user_name")->setValue( av_name.mDisplayName ); + getChild("user_slid")->setValue( av_name.mSLID ); } // EOF diff --git a/indra/newview/llpanelprofileview.h b/indra/newview/llpanelprofileview.h index 2b67be12e5..dedb617c27 100644 --- a/indra/newview/llpanelprofileview.h +++ b/indra/newview/llpanelprofileview.h @@ -39,6 +39,7 @@ #include "llagent.h" #include "lltooldraganddrop.h" +class LLAvatarName; class LLPanelProfile; class LLPanelProfileTab; class LLTextBox; @@ -99,10 +100,11 @@ protected: private: // LLCacheName will call this function when avatar name is loaded from server. // This is required to display names that have not been cached yet. - void onNameCache( - const LLUUID& id, - const std::string& full_name, - bool is_group); +// void onNameCache( +// const LLUUID& id, +// const std::string& full_name, +// bool is_group); + void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name); LLTextBox* mStatusText; AvatarStatusObserver* mAvatarStatusObserver; -- cgit v1.2.3