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.cpp36
1 files changed, 14 insertions, 22 deletions
diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp
index c7a5691d70..dfb213716c 100644
--- a/indra/newview/llavatarlist.cpp
+++ b/indra/newview/llavatarlist.cpp
@@ -34,6 +34,7 @@
// common
#include "lltrans.h"
+#include "llcommonutils.h"
#include "llavatarlist.h"
#include "llagentdata.h" // for comparator
@@ -113,7 +114,7 @@ LLAvatarList::Params::Params()
}
LLAvatarList::LLAvatarList(const Params& p)
-: LLFlatListView(p)
+: LLFlatListViewEx(p)
, mIgnoreOnlineStatus(p.ignore_online_status)
, mShowLastInteractionTime(p.show_last_interaction_time)
, mContextMenu(NULL)
@@ -154,7 +155,7 @@ void LLAvatarList::draw()
// *NOTE dzaporozhan
// Call refresh() after draw() to avoid flickering of avatar list items.
- LLFlatListView::draw();
+ LLFlatListViewEx::draw();
if (mDirty)
refresh();
@@ -171,14 +172,20 @@ void LLAvatarList::clear()
{
getIDs().clear();
setDirty(true);
- LLFlatListView::clear();
+ LLFlatListViewEx::clear();
}
void LLAvatarList::setNameFilter(const std::string& filter)
{
- if (mNameFilter != filter)
+ std::string filter_upper = filter;
+ LLStringUtil::toUpper(filter_upper);
+ if (mNameFilter != filter_upper)
{
- mNameFilter = filter;
+ mNameFilter = filter_upper;
+
+ // update message for empty state here instead of refresh() to avoid blinking when switch
+ // between tabs.
+ updateNoItemsMessage(filter);
setDirty();
}
}
@@ -360,7 +367,7 @@ S32 LLAvatarList::notifyParent(const LLSD& info)
sort();
return 1;
}
- return LLFlatListView::notifyParent(info);
+ return LLFlatListViewEx::notifyParent(info);
}
void LLAvatarList::addNewItem(const LLUUID& id, const std::string& name, BOOL is_online, EAddPosition pos)
@@ -400,7 +407,6 @@ void LLAvatarList::computeDifference(
uuid_vec_t& vremoved)
{
uuid_vec_t vcur;
- uuid_vec_t vnew = vnew_unsorted;
// Convert LLSDs to LLUUIDs.
{
@@ -411,21 +417,7 @@ void LLAvatarList::computeDifference(
vcur.push_back(vcur_values[i].asUUID());
}
- std::sort(vcur.begin(), vcur.end());
- std::sort(vnew.begin(), vnew.end());
-
- uuid_vec_t::iterator it;
- size_t maxsize = llmax(vcur.size(), vnew.size());
- vadded.resize(maxsize);
- vremoved.resize(maxsize);
-
- // what to remove
- it = set_difference(vcur.begin(), vcur.end(), vnew.begin(), vnew.end(), vremoved.begin());
- vremoved.erase(it, vremoved.end());
-
- // what to add
- it = set_difference(vnew.begin(), vnew.end(), vcur.begin(), vcur.end(), vadded.begin());
- vadded.erase(it, vadded.end());
+ LLCommonUtils::computeDifference(vnew_unsorted, vcur, vadded, vremoved);
}
// Refresh shown time of our last interaction with all listed avatars.