diff --git a/indra/newview/llnamebox.cpp b/indra/newview/llnamebox.cpp index 28a465a57..ca2c398cf 100644 --- a/indra/newview/llnamebox.cpp +++ b/indra/newview/llnamebox.cpp @@ -86,7 +86,9 @@ void LLNameBox::initFromXML(LLXMLNodePtr node, LLView* parent) node->getAttributeString("initial_value", mInitialValue); setText(mInitialValue); node->getAttribute_bool("rlv_sensitive", mRLVSensitive); - node->getAttribute_bool("is_group", mIsGroup); + bool is_group; + node->getAttribute_bool("is_group", is_group); + setIsGroup(is_group); } // static diff --git a/indra/newview/llnameui.cpp b/indra/newview/llnameui.cpp index bd31a11da..10e113a04 100644 --- a/indra/newview/llnameui.cpp +++ b/indra/newview/llnameui.cpp @@ -47,10 +47,21 @@ std::set LLNameUI::sInstances; LLNameUI::LLNameUI(const std::string& loading, bool rlv_sensitive, const LLUUID& id, bool is_group) -: mNameID(id), mRLVSensitive(rlv_sensitive), mIsGroup(is_group), mAllowInteract(false) +: mNameID(id), mRLVSensitive(rlv_sensitive), mIsGroup(!is_group), mAllowInteract(false) , mInitialValue(!loading.empty() ? loading : LLTrans::getString("LoadingData")) { - if (mIsGroup) sInstances.insert(this); + setIsGroup(is_group); +} + +void LLNameUI::setIsGroup(bool is_group) +{ + if (mIsGroup != is_group) + { + if (mIsGroup = is_group) + sInstances.insert(this); + else + sInstances.erase(this); + } } void LLNameUI::setNameID(const LLUUID& name_id, bool is_group) @@ -58,14 +69,7 @@ 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; + setIsGroup(is_group); if (mAllowInteract = mNameID.notNull()) { @@ -139,4 +143,4 @@ void LLNameUI::showProfile() LLGroupActions::show(mNameID); else LLAvatarActions::showProfile(mNameID); -} \ No newline at end of file +} diff --git a/indra/newview/llnameui.h b/indra/newview/llnameui.h index 3d392675c..4bf53ae46 100644 --- a/indra/newview/llnameui.h +++ b/indra/newview/llnameui.h @@ -51,6 +51,7 @@ struct LLNameUI : public LFIDBearer uuid_vec_t getSelectedIDs() const override final { return { mNameID }; } S32 getNumSelected() const override final { return 1; } + void setIsGroup(bool is_group); void setNameID(const LLUUID& name_id, bool is_group); void setNameText(); // Sets the name to whatever the name cache has at the moment void refresh(const LLUUID& id, const std::string& full_name, bool is_group); @@ -84,4 +85,4 @@ protected: bool mIsGroup; bool mAllowInteract; std::string mInitialValue; -}; \ No newline at end of file +};