From 0409a81e36342d4e6db7879c694c7ed25a1404d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Liru=20F=C3=A6rs?= Date: Thu, 10 Oct 2019 02:48:30 -0400 Subject: [PATCH] Renable old feature: Display complete names on profiles --- indra/newview/llnameui.cpp | 6 ++++-- indra/newview/llnameui.h | 3 +++ indra/newview/llpanelavatar.cpp | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/indra/newview/llnameui.cpp b/indra/newview/llnameui.cpp index 30687fb6b..15dcc5c91 100644 --- a/indra/newview/llnameui.cpp +++ b/indra/newview/llnameui.cpp @@ -81,8 +81,10 @@ void LLNameUI::setNameText() } else { - got_name = LLAvatarNameCache::getNSName(mNameID, name); - if (!got_name) + LLAvatarName av_name; + if (got_name = LLAvatarNameCache::get(mNameID, &av_name)) + name = mShowCompleteName ? av_name.getCompleteName() : av_name.getNSName(); + else mConnection = LLAvatarNameCache::get(mNameID, boost::bind(&LLNameUI::setNameText, this)); } diff --git a/indra/newview/llnameui.h b/indra/newview/llnameui.h index 459bfbcef..1fecd668f 100644 --- a/indra/newview/llnameui.h +++ b/indra/newview/llnameui.h @@ -56,6 +56,8 @@ struct LLNameUI : public LFIDBearer void refresh(const LLUUID& id, const std::string& full_name, bool is_group); static void refreshAll(const LLUUID& id, const std::string& full_name, bool is_group); + void setShowCompleteName(bool show) { mShowCompleteName = show; } + virtual void setText(const std::string& text) = 0; // Take either UUID or a map of "id" to UUID and "group" to boolean @@ -72,6 +74,7 @@ struct LLNameUI : public LFIDBearer private: static std::set sInstances; boost::signals2::connection mConnection; + bool mShowCompleteName = false; protected: LLUUID mNameID; diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index 6692cdb64..9e4986a47 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -1280,6 +1280,7 @@ void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id) if (LLDropTarget* drop_target = findChild("drop_target_rect")) drop_target->setEntityID(mAvatarID); + dnname->setShowCompleteName(gSavedSettings.getBOOL("SinguCompleteNameProfiles")); if (auto key_edit = getChildView("avatar_key")) key_edit->setValue(mAvatarID.asString());