summaryrefslogtreecommitdiff
path: root/indra/newview/llavatarlist.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llavatarlist.cpp')
-rw-r--r--indra/newview/llavatarlist.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp
index 7b2dc02864..8609ba8b1c 100644
--- a/indra/newview/llavatarlist.cpp
+++ b/indra/newview/llavatarlist.cpp
@@ -239,11 +239,46 @@ void LLAvatarList::refresh()
bool dirty = add_limit_exceeded || (have_filter && !have_names);
setDirty(dirty);
+ // Refreshed all items, lets send refresh_complete signal.
+ if(!dirty)
+ {
+ std::vector<LLSD> cur_values;
+ getValues(cur_values);
+ mRefreshCompleteSignal(this, LLSD((S32)cur_values.size()));
+ }
+
// Commit if we've added/removed items.
if (modified)
onCommit();
}
+bool LLAvatarList::filterHasMatches()
+{
+ uuid_vector_t values = getIDs();
+
+ for (uuid_vector_t::const_iterator it=values.begin(); it != values.end(); it++)
+ {
+ std::string name;
+ const LLUUID& buddy_id = *it;
+ BOOL have_name = gCacheName->getFullName(buddy_id, name);
+
+ // If name has not been loaded yet we consider it as a match.
+ // When the name will be loaded the filter will be applied again(in refresh()).
+
+ if (have_name && !findInsensitive(name, mNameFilter))
+ {
+ continue;
+ }
+
+ return true;
+ }
+ return false;
+}
+
+boost::signals2::connection LLAvatarList::setRefreshCompleteCallback(const commit_signal_t::slot_type& cb)
+{
+ return mRefreshCompleteSignal.connect(cb);
+}
void LLAvatarList::addNewItem(const LLUUID& id, const std::string& name, BOOL is_online, EAddPosition pos)
{