diff options
author | Steve Bennetts <steve@lindenlab.com> | 2009-11-03 18:19:45 -0800 |
---|---|---|
committer | Steve Bennetts <steve@lindenlab.com> | 2009-11-03 18:19:45 -0800 |
commit | 3e3ef5c53d2e73c0836ef6056d222c4c35b8ac2d (patch) | |
tree | 81c0151e33702653fb5533e9e10ca41cc906fa7a /indra/newview/llavatarlist.cpp | |
parent | ce3dfcee3bec1ad782128ea891e21130911c9984 (diff) | |
parent | de2fe92bb9df5f5f64dff79a4e6df35330c15329 (diff) |
merge from https://hg.aws.productengine.com/secondlife/viewer-2-0/
Diffstat (limited to 'indra/newview/llavatarlist.cpp')
-rw-r--r-- | indra/newview/llavatarlist.cpp | 35 |
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) { |