diff options
Diffstat (limited to 'indra/newview/llnamelistctrl.cpp')
-rwxr-xr-x | indra/newview/llnamelistctrl.cpp | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp index b2a3a9f645..91866e5ca2 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) { |