diff --git a/src/customemojimodel.cpp b/src/customemojimodel.cpp
index 8eca35ff1..c8a767d3a 100644
--- a/src/customemojimodel.cpp
+++ b/src/customemojimodel.cpp
@@ -88,7 +88,7 @@ void CustomEmojiModel::setConnection(Connection *it)
QString CustomEmojiModel::preprocessText(const QString &it)
{
auto cp = it;
- for (const auto &emoji : qAsConst(d->emojies)) {
+ for (const auto &emoji : std::as_const(d->emojies)) {
cp.replace(
emoji.regexp,
QStringLiteral(R"(
)").arg(emoji.url, emoji.name));
@@ -99,7 +99,7 @@ QString CustomEmojiModel::preprocessText(const QString &it)
QVariantList CustomEmojiModel::filterModel(const QString &filter)
{
QVariantList results;
- for (const auto &emoji : qAsConst(d->emojies)) {
+ for (const auto &emoji : std::as_const(d->emojies)) {
if (results.length() >= 10)
break;
if (!emoji.name.contains(filter, Qt::CaseInsensitive))
diff --git a/src/roomlistmodel.cpp b/src/roomlistmodel.cpp
index 4ba9b22c9..b441be5bc 100644
--- a/src/roomlistmodel.cpp
+++ b/src/roomlistmodel.cpp
@@ -92,7 +92,7 @@ void RoomListModel::setConnection(Connection *connection)
m_connection = connection;
- for (NeoChatRoom *room : qAsConst(m_rooms)) {
+ for (NeoChatRoom *room : std::as_const(m_rooms)) {
room->disconnect(this);
}
@@ -103,7 +103,7 @@ void RoomListModel::setConnection(Connection *connection)
connect(connection, &Connection::aboutToDeleteRoom, this, &RoomListModel::deleteRoom);
connect(connection, &Connection::directChatsListChanged, this, [this, connection](Quotient::DirectChatsMap additions, Quotient::DirectChatsMap removals) {
auto refreshRooms = [this, &connection](Quotient::DirectChatsMap rooms) {
- for (const QString &roomID : qAsConst(rooms)) {
+ for (const QString &roomID : std::as_const(rooms)) {
auto room = connection->room(roomID);
if (room) {
refresh(static_cast(room));
@@ -249,7 +249,7 @@ void RoomListModel::handleNotifications()
void RoomListModel::refreshNotificationCount()
{
int count = 0;
- for (auto room : qAsConst(m_rooms)) {
+ for (auto room : std::as_const(m_rooms)) {
count += room->notificationCount();
}
if (m_notificationCount == count) {
@@ -489,7 +489,7 @@ bool RoomListModel::categoryVisible(int category) const
NeoChatRoom *RoomListModel::roomByAliasOrId(const QString &aliasOrId)
{
- for (const auto &room : qAsConst(m_rooms)) {
+ for (const auto &room : std::as_const(m_rooms)) {
if (room->aliases().contains(aliasOrId) || room->id() == aliasOrId) {
return room;
}
diff --git a/src/userlistmodel.cpp b/src/userlistmodel.cpp
index 363c3177f..b5ec604d0 100644
--- a/src/userlistmodel.cpp
+++ b/src/userlistmodel.cpp
@@ -32,7 +32,7 @@ void UserListModel::setRoom(Quotient::Room *room)
if (m_currentRoom) {
m_currentRoom->disconnect(this);
// m_currentRoom->connection()->disconnect(this);
- for (User *user : qAsConst(m_users)) {
+ for (User *user : std::as_const(m_users)) {
user->disconnect(this);
}
m_users.clear();
@@ -47,7 +47,7 @@ void UserListModel::setRoom(Quotient::Room *room)
m_users = m_currentRoom->users();
std::sort(m_users.begin(), m_users.end(), room->memberSorter());
}
- for (User *user : qAsConst(m_users)) {
+ for (User *user : std::as_const(m_users)) {
#ifdef QUOTIENT_07
connect(user, &User::defaultAvatarChanged, this, [this, user]() {
avatarChanged(user, m_currentRoom);