From bf34eccf9c68f204c41d3daea791e50e87d868db Mon Sep 17 00:00:00 2001 From: Baker Linden Date: Mon, 9 Sep 2013 17:29:33 -0700 Subject: - Start of code cleanup - Added refresh button to ban list panel - Added an additional signal to LLNameListCtrl to indicate when the entire name cache is complete. --- indra/newview/llnamelistctrl.cpp | 58 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 57 insertions(+), 1 deletion(-) (limited to 'indra/newview/llnamelistctrl.cpp') diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp index 7f396b7b7e..ed684004f0 100755 --- a/indra/newview/llnamelistctrl.cpp +++ b/indra/newview/llnamelistctrl.cpp @@ -65,7 +65,8 @@ LLNameListCtrl::LLNameListCtrl(const LLNameListCtrl::Params& p) mNameColumn(p.name_column.column_name), mAllowCallingCardDrop(p.allow_calling_card_drop), mShortNames(p.short_names), - mAvatarNameCacheConnection() + mAvatarNameCacheConnection(), + mPendingLookupsRemaining(0) {} // public @@ -79,6 +80,12 @@ LLScrollListItem* LLNameListCtrl::addNameItem(const LLUUID& agent_id, EAddPositi item.enabled = enabled; item.target = INDIVIDUAL; + ////////////////////////////////////////////////////////////////////////// + // BAKER - FIX NameListCtrl + //mPendingLookupsRemaining--; + ////////////////////////////////////////////////////////////////////////// + + return addNameItemRow(item, pos, suffix); } @@ -275,6 +282,12 @@ void LLNameListCtrl::addGroupNameItem(LLNameListCtrl::NameItem& item, EAddPositi LLScrollListItem* LLNameListCtrl::addNameItem(LLNameListCtrl::NameItem& item, EAddPosition pos) { item.target = INDIVIDUAL; + + ////////////////////////////////////////////////////////////////////////// + // BAKER - FIX NameListCtrl + //mPendingLookupsRemaining--; + ////////////////////////////////////////////////////////////////////////// + return addNameItemRow(item, pos); } @@ -284,6 +297,12 @@ LLScrollListItem* LLNameListCtrl::addElement(const LLSD& element, EAddPosition p LLParamSDParser parser; parser.readSD(element, item_params); item_params.userdata = userdata; + + ////////////////////////////////////////////////////////////////////////// + // BAKER - FIX NameListCtrl + //mPendingLookupsRemaining--; + ////////////////////////////////////////////////////////////////////////// + return addNameItemRow(item_params, pos); } @@ -335,6 +354,20 @@ LLScrollListItem* LLNameListCtrl::addNameItemRow( mAvatarNameCacheConnection.disconnect(); } mAvatarNameCacheConnection = LLAvatarNameCache::get(id,boost::bind(&LLNameListCtrl::onAvatarNameCache,this, _1, _2, item->getHandle())); + + ////////////////////////////////////////////////////////////////////////// + // BAKER - FIX NameListCtrl + if(mPendingLookupsRemaining <= 0) + { + // We might get into a state where mPendingLookupsRemaining might + // go negative. So just reset it right now and figure out if it's + // possible later :) + mPendingLookupsRemaining = 0; + mNameListCompleteSignal(false); + } + mPendingLookupsRemaining++; + ////////////////////////////////////////////////////////////////////////// + } break; } @@ -386,6 +419,12 @@ void LLNameListCtrl::removeNameItem(const LLUUID& agent_id) { selectNthItem(idx); // not sure whether this is needed, taken from previous implementation deleteSingleItem(idx); + + ////////////////////////////////////////////////////////////////////////// + // BAKER - FIX NameListCtrl + mPendingLookupsRemaining--; + ////////////////////////////////////////////////////////////////////////// + } } @@ -412,6 +451,23 @@ void LLNameListCtrl::onAvatarNameCache(const LLUUID& agent_id, } } + ////////////////////////////////////////////////////////////////////////// + // BAKER - FIX NameListCtrl + //if (mPendingLookupsRemaining <= 0) + { + // We might get into a state where mPendingLookupsRemaining might + // go negative. So just reset it right now and figure out if it's + // possible later :) + //mPendingLookupsRemaining = 0; + + mNameListCompleteSignal(true); + } + //else + { + // mPendingLookupsRemaining--; + } + ////////////////////////////////////////////////////////////////////////// + dirtyColumns(); } -- cgit v1.2.3 From 34f561db55868185f0a946009f41f4f212366484 Mon Sep 17 00:00:00 2001 From: Baker Linden Date: Fri, 13 Sep 2013 17:20:04 -0700 Subject: - Added ban date to ban list ui - Code cleanup --- indra/newview/llnamelistctrl.cpp | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) (limited to 'indra/newview/llnamelistctrl.cpp') diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp index ed684004f0..141f893945 100755 --- a/indra/newview/llnamelistctrl.cpp +++ b/indra/newview/llnamelistctrl.cpp @@ -73,19 +73,11 @@ LLNameListCtrl::LLNameListCtrl(const LLNameListCtrl::Params& p) LLScrollListItem* LLNameListCtrl::addNameItem(const LLUUID& agent_id, EAddPosition pos, BOOL enabled, const std::string& suffix) { - //llinfos << "LLNameListCtrl::addNameItem " << agent_id << llendl; - NameItem item; item.value = agent_id; item.enabled = enabled; item.target = INDIVIDUAL; - ////////////////////////////////////////////////////////////////////////// - // BAKER - FIX NameListCtrl - //mPendingLookupsRemaining--; - ////////////////////////////////////////////////////////////////////////// - - return addNameItemRow(item, pos, suffix); } @@ -282,12 +274,6 @@ void LLNameListCtrl::addGroupNameItem(LLNameListCtrl::NameItem& item, EAddPositi LLScrollListItem* LLNameListCtrl::addNameItem(LLNameListCtrl::NameItem& item, EAddPosition pos) { item.target = INDIVIDUAL; - - ////////////////////////////////////////////////////////////////////////// - // BAKER - FIX NameListCtrl - //mPendingLookupsRemaining--; - ////////////////////////////////////////////////////////////////////////// - return addNameItemRow(item, pos); } @@ -297,12 +283,6 @@ LLScrollListItem* LLNameListCtrl::addElement(const LLSD& element, EAddPosition p LLParamSDParser parser; parser.readSD(element, item_params); item_params.userdata = userdata; - - ////////////////////////////////////////////////////////////////////////// - // BAKER - FIX NameListCtrl - //mPendingLookupsRemaining--; - ////////////////////////////////////////////////////////////////////////// - return addNameItemRow(item_params, pos); } @@ -355,10 +335,9 @@ LLScrollListItem* LLNameListCtrl::addNameItemRow( } mAvatarNameCacheConnection = LLAvatarNameCache::get(id,boost::bind(&LLNameListCtrl::onAvatarNameCache,this, _1, _2, item->getHandle())); - ////////////////////////////////////////////////////////////////////////// - // BAKER - FIX NameListCtrl if(mPendingLookupsRemaining <= 0) { + // BAKER TODO: // We might get into a state where mPendingLookupsRemaining might // go negative. So just reset it right now and figure out if it's // possible later :) @@ -366,8 +345,6 @@ LLScrollListItem* LLNameListCtrl::addNameItemRow( mNameListCompleteSignal(false); } mPendingLookupsRemaining++; - ////////////////////////////////////////////////////////////////////////// - } break; } @@ -420,11 +397,7 @@ void LLNameListCtrl::removeNameItem(const LLUUID& agent_id) selectNthItem(idx); // not sure whether this is needed, taken from previous implementation deleteSingleItem(idx); - ////////////////////////////////////////////////////////////////////////// - // BAKER - FIX NameListCtrl mPendingLookupsRemaining--; - ////////////////////////////////////////////////////////////////////////// - } } -- cgit v1.2.3 From 316bf51482c17b1a03567d37488067af9c412493 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Tue, 21 Jan 2014 15:11:10 +0100 Subject: MAINT-3187: Name list controls do not properly resolve avatar names --- indra/newview/llnamelistctrl.cpp | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) (limited to 'indra/newview/llnamelistctrl.cpp') 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 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) { -- cgit v1.2.3 From 3b5b6e35c4f1d5412349766deff7bf573ac1a301 Mon Sep 17 00:00:00 2001 From: maksymsproductengine Date: Sat, 12 Jul 2014 02:51:27 +0300 Subject: fixing merge conficts --- indra/newview/llnamelistctrl.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/newview/llnamelistctrl.cpp') diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp index c0bf763437..54e4c6c1da 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), mPendingLookupsRemaining(0) {} @@ -337,6 +336,8 @@ LLScrollListItem* LLNameListCtrl::addNameItemRow( it->second.disconnect(); } mAvatarNameCacheConnections.erase(it); + } + mAvatarNameCacheConnections[id] = LLAvatarNameCache::get(id,boost::bind(&LLNameListCtrl::onAvatarNameCache,this, _1, _2, suffix, item->getHandle())); if(mPendingLookupsRemaining <= 0) { -- cgit v1.2.3