From b4289e2c552168f9b4e5947c924074a031e0c546 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Mon, 28 Oct 2024 13:04:22 +0100 Subject: [PATCH] Fix building with older libstdc++ We still can't use std::ranges::to() :(( --- client/models/userlistmodel.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/client/models/userlistmodel.cpp b/client/models/userlistmodel.cpp index 46fa3b7b..9542ef93 100644 --- a/client/models/userlistmodel.cpp +++ b/client/models/userlistmodel.cpp @@ -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(); + 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)