Buddy search adjustment

This commit is contained in:
Siana Gearz
2012-02-05 15:13:52 +01:00
parent 859e2701f2
commit b03b4db7c7
2 changed files with 10 additions and 7 deletions

View File

@@ -321,18 +321,21 @@ void LLPanelFriends::filterContacts(const std::string& search_name)
refreshNames(LLFriendObserver::ADD);
}
//llinfos << "search_name = " << search_name <<llendl;
std::vector<LLScrollListItem*> vFriends = mFriendsList->getAllData(); // all of it.
for (std::vector<LLScrollListItem*>::iterator itr = vFriends.begin(); itr != vFriends.end(); ++itr)
{
friend_name = utf8str_tolower((*itr)->getColumn(LIST_FRIEND_NAME)->getValue().asString());
BOOL show_entry = (friend_name.find(utf8str_tolower(search_name)) != std::string::npos);
//llinfos << "friend_name = " << friend_name << (show_entry?" (shown)":"") <<llendl;
if (!show_entry)
{
mFriendsList->deleteItems((*itr)->getValue());
}
}
mFriendsList->updateLayout();
refreshUI();
}
else if (search_name == "" && search_name != mLastContactSearch) refreshNames(LLFriendObserver::ADD);