summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2014-01-24 15:00:52 -0500
committerOz Linden <oz@lindenlab.com>2014-01-24 15:00:52 -0500
commitd8cc2476b3a6b0971a1d385588412870e81a2917 (patch)
treea8a5be623c0e595df13d12a008d366e7f70ee9fb /indra
parentc241bb2af865370475308198ce6421900c92e345 (diff)
parent316bf51482c17b1a03567d37488067af9c412493 (diff)
merge changes for MAINT-3187
Diffstat (limited to 'indra')
-rwxr-xr-xindra/newview/llnamelistctrl.cpp33
-rwxr-xr-xindra/newview/llnamelistctrl.h13
2 files changed, 34 insertions, 12 deletions
diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp
index 7ddd04fed0..3b5a69fd3a 100755
--- a/indra/newview/llnamelistctrl.cpp
+++ b/indra/newview/llnamelistctrl.cpp
@@ -64,8 +64,7 @@ LLNameListCtrl::LLNameListCtrl(const LLNameListCtrl::Params& p)
mNameColumnIndex(p.name_column.column_index),
mNameColumn(p.name_column.column_name),
mAllowCallingCardDrop(p.allow_calling_card_drop),
- mShortNames(p.short_names),
- mAvatarNameCacheConnection()
+ mShortNames(p.short_names)
{}
// public
@@ -328,13 +327,16 @@ LLScrollListItem* LLNameListCtrl::addNameItemRow(
else
{
// ...schedule a callback
- // This is not correct and will likely lead to partially populated lists in cases where avatar names are not cached.
- // *TODO : Change this to have 2 callbacks : one callback per list item and one for the whole list.
- if (mAvatarNameCacheConnection.connected())
+ avatar_name_cache_connection_map_t::iterator it = mAvatarNameCacheConnections.find(id);
+ if (it != mAvatarNameCacheConnections.end())
{
- mAvatarNameCacheConnection.disconnect();
+ if (it->second.connected())
+ {
+ it->second.disconnect();
+ }
+ mAvatarNameCacheConnections.erase(it);
}
- mAvatarNameCacheConnection = LLAvatarNameCache::get(id,boost::bind(&LLNameListCtrl::onAvatarNameCache,this, _1, _2, item->getHandle()));
+ mAvatarNameCacheConnections[id] = LLAvatarNameCache::get(id,boost::bind(&LLNameListCtrl::onAvatarNameCache,this, _1, _2, suffix, item->getHandle()));
}
break;
}
@@ -391,9 +393,18 @@ void LLNameListCtrl::removeNameItem(const LLUUID& agent_id)
void LLNameListCtrl::onAvatarNameCache(const LLUUID& agent_id,
const LLAvatarName& av_name,
+ std::string suffix,
LLHandle<LLNameListItem> item)
{
- mAvatarNameCacheConnection.disconnect();
+ avatar_name_cache_connection_map_t::iterator it = mAvatarNameCacheConnections.find(agent_id);
+ if (it != mAvatarNameCacheConnections.end())
+ {
+ if (it->second.connected())
+ {
+ it->second.disconnect();
+ }
+ mAvatarNameCacheConnections.erase(it);
+ }
std::string name;
if (mShortNames)
@@ -401,6 +412,12 @@ void LLNameListCtrl::onAvatarNameCache(const LLUUID& agent_id,
else
name = av_name.getCompleteName();
+ // Append optional suffix.
+ if (!suffix.empty())
+ {
+ name.append(suffix);
+ }
+
LLNameListItem* list_item = item.get();
if (list_item && list_item->getUUID() == agent_id)
{
diff --git a/indra/newview/llnamelistctrl.h b/indra/newview/llnamelistctrl.h
index 92e82b672d..4ed260d847 100755
--- a/indra/newview/llnamelistctrl.h
+++ b/indra/newview/llnamelistctrl.h
@@ -114,10 +114,14 @@ protected:
LLNameListCtrl(const Params&);
virtual ~LLNameListCtrl()
{
- if (mAvatarNameCacheConnection.connected())
+ for (avatar_name_cache_connection_map_t::iterator it = mAvatarNameCacheConnections.begin(); it != mAvatarNameCacheConnections.end(); ++it)
{
- mAvatarNameCacheConnection.disconnect();
+ if (it->second.connected())
+ {
+ it->second.disconnect();
+ }
}
+ mAvatarNameCacheConnections.clear();
}
friend class LLUICtrlFactory;
public:
@@ -155,14 +159,15 @@ public:
/*virtual*/ void mouseOverHighlightNthItem( S32 index );
private:
void showInspector(const LLUUID& avatar_id, bool is_group);
- void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name, LLHandle<LLNameListItem> item);
+ void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name, std::string suffix, LLHandle<LLNameListItem> item);
private:
S32 mNameColumnIndex;
std::string mNameColumn;
BOOL mAllowCallingCardDrop;
bool mShortNames; // display name only, no SLID
- boost::signals2::connection mAvatarNameCacheConnection;
+ typedef std::map<LLUUID, boost::signals2::connection> avatar_name_cache_connection_map_t;
+ avatar_name_cache_connection_map_t mAvatarNameCacheConnections;
};