From c8a016a1e9ce90623ed19ac6cf7b526dcf1e6ae0 Mon Sep 17 00:00:00 2001 From: ziree Date: Fri, 13 May 2011 16:27:40 +0200 Subject: [PATCH] Better sorting of friends list. In case this is not good enough (very laggy DN lookups might delay the sort for a longer time) we will need a timer. Addresses FIRE-833 --- indra/newview/fscontactsfloater.cpp | 7 ++++++- indra/newview/fscontactsfloater.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/indra/newview/fscontactsfloater.cpp b/indra/newview/fscontactsfloater.cpp index e41b83f256..c5533d85bd 100644 --- a/indra/newview/fscontactsfloater.cpp +++ b/indra/newview/fscontactsfloater.cpp @@ -110,8 +110,8 @@ BOOL FSFloaterContacts::postBuild() mFriendList->setShowIcons("FriendsListShowIcons"); mFriendList->showPermissions(TRUE); mFriendList->setComparator(&STATUS_COMPARATOR); - mFriendList->sort(); + mFriendList->setRefreshCompleteCallback(boost::bind(&FSFloaterContacts::onFriendListRefreshComplete, this)); mFriendList->setItemDoubleClickCallback(boost::bind(&FSFloaterContacts::onAvatarListDoubleClicked, this, _1)); mFriendList->setReturnCallback(boost::bind(&FSFloaterContacts::onImButtonClicked, this)); @@ -165,6 +165,11 @@ void FSFloaterContacts::onOpen(const LLSD& key) } } +// as soon as the avatar list widget tells us all names are loaded, do another sort on the list -Zi +void FSFloaterContacts::onFriendListRefreshComplete() +{ + mFriendList->sort(); +} // // Friend actions diff --git a/indra/newview/fscontactsfloater.h b/indra/newview/fscontactsfloater.h index 0fa0a01335..14584ae0a7 100644 --- a/indra/newview/fscontactsfloater.h +++ b/indra/newview/fscontactsfloater.h @@ -67,6 +67,7 @@ private: bool isItemsFreeOfFriends(const uuid_vec_t& uuids); // misc callbacks + void onFriendListRefreshComplete(); static void onAvatarPicked(const uuid_vec_t& ids, const std::vector names); // friend buttons