Beispiel #1
0
void BuddyModel::setFilterByName(const QString &filter)
{
    m_filterByName = filter;
    emit filterByNameChanged(filter);

    //TODO write more fast algorythm
    clear();
    foreach (auto buddy, m_roster.data()->findChildren<Vreen::Buddy*>())
        addFriend(buddy);
}
Beispiel #2
0
void BuddyModel::setFilterByName(const QString &filter)
{
    m_filterByName = filter;
    emit filterByNameChanged(filter);

    Vreen::BuddyList list;
    foreach (auto buddy, m_roster->buddies()) {
        if (checkContact(buddy)) {
            auto it = qLowerBound(list.begin(), list.end(), buddy, m_buddyComparator);
            list.insert(it, buddy);
        }
    }
    setBuddies(list);
}