aboutsummaryrefslogtreecommitdiff
path: root/lib/room.cpp
diff options
context:
space:
mode:
authorAlexey Rusakov <Kitsune-Ral@users.sf.net>2021-06-12 20:57:54 +0200
committerAlexey Rusakov <Kitsune-Ral@users.sf.net>2021-06-13 14:06:14 +0200
commit84d6295f859ee600d7aa3860767030bdc78914ba (patch)
tree6dcb24b962396b3371bcf657ce5a618319f47ef6 /lib/room.cpp
parentff171e91877048f132955abaa617a26c63632bdf (diff)
downloadlibquotient-84d6295f859ee600d7aa3860767030bdc78914ba.tar.gz
libquotient-84d6295f859ee600d7aa3860767030bdc78914ba.zip
uri.cpp, room.*: Get rid of QStringRefs
Diffstat (limited to 'lib/room.cpp')
-rw-r--r--lib/room.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/room.cpp b/lib/room.cpp
index abaf50b7..c314fc72 100644
--- a/lib/room.cpp
+++ b/lib/room.cpp
@@ -2962,12 +2962,16 @@ bool MemberSorter::operator()(User* u1, User* u2) const
return operator()(u1, room->disambiguatedMemberName(u2->id()));
}
-bool MemberSorter::operator()(User* u1, const QString& u2name) const
+bool MemberSorter::operator()(User* u1, QStringView u2name) const
{
auto n1 = room->disambiguatedMemberName(u1->id());
if (n1.startsWith('@'))
n1.remove(0, 1);
- auto n2 = u2name.midRef(u2name.startsWith('@') ? 1 : 0);
+ const auto n2 = u2name.mid(u2name.startsWith('@') ? 1 : 0)
+#if QT_VERSION_MAJOR < 6
+ .toString() // Qt 5 doesn't have QStringView::localeAwareCompare
+#endif
+ ;
return n1.localeAwareCompare(n2) < 0;
}