void Widget::onFriendUsernameLoaded(int friendId, const QString& username) { Friend* f = FriendList::findFriend(friendId); if (!f) return; f->setName(username); }
void Widget::onFriendUsernameChanged(int friendId, const QString& username) { Friend* f = FriendList::findFriend(friendId); if (!f) return; QString str = username; str.replace('\n', ' '); str.remove('\r'); str.remove(QChar((char)0)); // null terminator... f->setName(str); }