summaryrefslogtreecommitdiff
path: root/indra/newview/llnamelistctrl.cpp
diff options
context:
space:
mode:
authorBaker Linden <baker@lindenlab.com>2013-09-09 17:29:33 -0700
committerBaker Linden <baker@lindenlab.com>2013-09-09 17:29:33 -0700
commitbf34eccf9c68f204c41d3daea791e50e87d868db (patch)
tree08116a79df27202548789da5d6c56c93a68f9f59 /indra/newview/llnamelistctrl.cpp
parent1299f6d63fbe313329e6e5ced7be797e2a23d6a7 (diff)
- 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.
Diffstat (limited to 'indra/newview/llnamelistctrl.cpp')
-rwxr-xr-xindra/newview/llnamelistctrl.cpp58
1 files changed, 57 insertions, 1 deletions
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();
}