From 960cf2995ea44e91bd2b982d06ef157c3409a2f4 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Tue, 28 Dec 2021 18:44:26 +0100 Subject: [PATCH] Fixup clang-tidy suggestion --- src/timeline/Permissions.cpp | 2 +- src/timeline/TimelineModel.cpp | 10 +++++----- src/timeline/TimelineModel.h | 5 +++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/timeline/Permissions.cpp b/src/timeline/Permissions.cpp index 4e45f2e2..95d1105a 100644 --- a/src/timeline/Permissions.cpp +++ b/src/timeline/Permissions.cpp @@ -10,7 +10,7 @@ Permissions::Permissions(QString roomId, QObject *parent) : QObject(parent) - , roomId_(roomId) + , roomId_(std::move(roomId)) { invalidate(); } diff --git a/src/timeline/TimelineModel.cpp b/src/timeline/TimelineModel.cpp index 075267d8..217cd4c8 100644 --- a/src/timeline/TimelineModel.cpp +++ b/src/timeline/TimelineModel.cpp @@ -330,17 +330,17 @@ qml_mtx_events::fromRoomEventType(qml_mtx_events::EventType t) }; } -TimelineModel::TimelineModel(TimelineViewManager *manager, const QString &room_id, QObject *parent) +TimelineModel::TimelineModel(TimelineViewManager *manager, QString room_id, QObject *parent) : QAbstractListModel(parent) - , events(room_id.toStdString(), this) - , room_id_(room_id) + , room_id_(std::move(room_id)) + , events(room_id_.toStdString(), this) , manager_(manager) - , permissions_{room_id} + , permissions_{room_id_} { lastMessage_.timestamp = 0; if (auto create = - cache::client()->getStateEvent(room_id.toStdString())) + cache::client()->getStateEvent(room_id_.toStdString())) this->isSpace_ = create->content.type == mtx::events::state::room_type::space; this->isEncrypted_ = cache::isRoomEncrypted(room_id_.toStdString()); diff --git a/src/timeline/TimelineModel.h b/src/timeline/TimelineModel.h index bbc1e5ef..aa94ffa7 100644 --- a/src/timeline/TimelineModel.h +++ b/src/timeline/TimelineModel.h @@ -189,7 +189,7 @@ class TimelineModel : public QAbstractListModel public: explicit TimelineModel(TimelineViewManager *manager, - const QString &room_id, + QString room_id, QObject *parent = nullptr); enum Roles @@ -421,11 +421,12 @@ private: void setPaginationInProgress(const bool paginationInProgress); + QString room_id_; + QSet read; mutable EventStore events; - QString room_id_; QString currentId, currentReadId; QString reply_, edit_;