Skip to content

Commit

Permalink
Fix building with older libstdc++
Browse files Browse the repository at this point in the history
We still can't use std::ranges::to() :((
  • Loading branch information
KitsuneRal committed Oct 28, 2024
1 parent d6c3298 commit b4289e2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions client/models/userlistmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,11 @@ void UserListModel::filter(const QString& filterString)
QElapsedTimer et; et.start();

beginResetModel();
auto filteredMembers =
// TODO: use std::ranges::to() once it's available from all stdlibs Quotient builds with
auto filteredMembersView =
std::views::filter(m_currentRoom->joinedMembers(),
Quotient::memberMatcher(filterString, Qt::CaseInsensitive))
| std::ranges::to<QList>();
Quotient::memberMatcher(filterString, Qt::CaseInsensitive));
QList filteredMembers(filteredMembersView.begin(), filteredMembersView.end());
std::ranges::sort(filteredMembers, Quotient::MemberSorter());
const auto sortedIds = std::views::transform(filteredMembers, &RoomMember::id);
#if QT_VERSION >= QT_VERSION_CHECK(6, 6, 0)
Expand Down

0 comments on commit b4289e2

Please sign in to comment.