From e0883b72dccadade30a85d0cb3222a4dee063d7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Liru=20F=C3=A6rs?= Date: Thu, 10 Oct 2019 02:43:02 -0400 Subject: [PATCH] All Name UI now uses the user's NameSystem selection instead of legacy --- indra/newview/llnameui.cpp | 18 ++++++++++++++++-- indra/newview/llnameui.h | 9 ++++++++- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/indra/newview/llnameui.cpp b/indra/newview/llnameui.cpp index 8a05d0d2c..30687fb6b 100644 --- a/indra/newview/llnameui.cpp +++ b/indra/newview/llnameui.cpp @@ -33,7 +33,9 @@ #include "llviewerprecompiledheaders.h" #include "llnameui.h" + #include "llagentdata.h" +#include "llavatarnamecache.h" #include "lltrans.h" #include "rlvhandler.h" @@ -45,13 +47,23 @@ LLNameUI::LLNameUI(const std::string& loading, bool rlv_sensitive, const LLUUID& : mNameID(id), mRLVSensitive(rlv_sensitive), mIsGroup(is_group), mAllowInteract(false) , mInitialValue(!loading.empty() ? loading : LLTrans::getString("LoadingData")) { - sInstances.insert(this); + if (mIsGroup) sInstances.insert(this); } void LLNameUI::setNameID(const LLUUID& name_id, bool is_group) { mNameID = name_id; + mConnection.disconnect(); + + if (mIsGroup != is_group) + { + if (is_group) + sInstances.insert(this); + else + sInstances.erase(this); + } mIsGroup = is_group; + if (mAllowInteract = mNameID.notNull()) setNameText(); else @@ -69,7 +81,9 @@ void LLNameUI::setNameText() } else { - got_name = gCacheName->getFullName(mNameID, name); + got_name = LLAvatarNameCache::getNSName(mNameID, name); + if (!got_name) + mConnection = LLAvatarNameCache::get(mNameID, boost::bind(&LLNameUI::setNameText, this)); } if (!mIsGroup && got_name && mRLVSensitive) // Filter if needed diff --git a/indra/newview/llnameui.h b/indra/newview/llnameui.h index bda80a368..459bfbcef 100644 --- a/indra/newview/llnameui.h +++ b/indra/newview/llnameui.h @@ -39,7 +39,13 @@ struct LLNameUI : public LFIDBearer { LLNameUI(const std::string& loading = LLStringUtil::null, bool rlv_sensitive = false, const LLUUID& id = LLUUID::null, bool is_group = false); - virtual ~LLNameUI() { sInstances.erase(this); } + virtual ~LLNameUI() + { + if (mIsGroup) + sInstances.erase(this); + else + mConnection.disconnect(); + } LLUUID getStringUUIDSelectedItem() const override final { return mNameID; } uuid_vec_t getSelectedIDs() const override final { return { mNameID }; } @@ -65,6 +71,7 @@ struct LLNameUI : public LFIDBearer private: static std::set sInstances; + boost::signals2::connection mConnection; protected: LLUUID mNameID;