summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2018-02-28 12:12:07 +0200
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2018-02-28 12:12:07 +0200
commit12a96aae6d7efa7c567616de8eb3e4f6d879b066 (patch)
treed30062ec058f73c3ef72de27fb1d373376345b21 /src
parentEnable room switcher only in the chat view (#251) (diff)
downloadnheko-12a96aae6d7efa7c567616de8eb3e4f6d879b066.tar.xz
Add some missing references
Diffstat (limited to 'src')
-rw-r--r--src/AvatarProvider.cc2
-rw-r--r--src/Cache.cc6
-rw-r--r--src/ChatPage.cc4
-rw-r--r--src/MatrixClient.cc1
-rw-r--r--src/dialogs/ReadReceipts.cc2
5 files changed, 7 insertions, 8 deletions
diff --git a/src/AvatarProvider.cc b/src/AvatarProvider.cc

index 21253ba7..1c509d0a 100644 --- a/src/AvatarProvider.cc +++ b/src/AvatarProvider.cc
@@ -36,7 +36,7 @@ AvatarProvider::updateAvatar(const QString &uid, const QImage &img) auto callbacks = toBeResolved_[uid]; // Update all the timeline items with the resolved avatar. - for (const auto callback : callbacks) + for (const auto &callback : callbacks) callback(img); toBeResolved_.erase(uid); diff --git a/src/Cache.cc b/src/Cache.cc
index d889f731..8a58b634 100644 --- a/src/Cache.cc +++ b/src/Cache.cc
@@ -482,7 +482,7 @@ Cache::readReceipts(const QString &event_id, const QString &room_id) auto json_response = json::parse(std::string(value.data(), value.size())); auto values = json_response.get<std::map<std::string, uint64_t>>(); - for (auto v : values) + for (const auto &v : values) // timestamp, user_id receipts.emplace(v.second, v.first); } @@ -497,7 +497,7 @@ Cache::readReceipts(const QString &event_id, const QString &room_id) void Cache::updateReadReceipt(const std::string &room_id, const Receipts &receipts) { - for (auto receipt : receipts) { + for (const auto &receipt : receipts) { const auto event_id = receipt.first; auto event_receipts = receipt.second; @@ -528,7 +528,7 @@ Cache::updateReadReceipt(const std::string &room_id, const Receipts &receipts) } // Append the new ones. - for (auto event_receipt : event_receipts) + for (const auto &event_receipt : event_receipts) saved_receipts.emplace(event_receipt.first, event_receipt.second); // Save back the merged (or only the new) receipts. diff --git a/src/ChatPage.cc b/src/ChatPage.cc
index a3ae7428..2ef4cf47 100644 --- a/src/ChatPage.cc +++ b/src/ChatPage.cc
@@ -531,7 +531,7 @@ ChatPage::initialSyncCompleted(const mtx::responses::Sync &response) roomSettings_.emplace(room_id, QSharedPointer<RoomSettings>(new RoomSettings(room_id))); - for (const auto membership : roomState->memberships) { + for (const auto &membership : roomState->memberships) { updateUserDisplayName(membership.second); updateUserAvatarUrl(membership.second); } @@ -791,7 +791,7 @@ ChatPage::updateTypingUsers(const QString &roomid, const std::vector<std::string QSettings settings; QString user_id = settings.value("auth/user_id").toString(); - for (const auto uid : user_ids) { + for (const auto &uid : user_ids) { auto user = QString::fromStdString(uid); if (user == user_id) diff --git a/src/MatrixClient.cc b/src/MatrixClient.cc
index af50e5b9..b5c4900b 100644 --- a/src/MatrixClient.cc +++ b/src/MatrixClient.cc
@@ -410,7 +410,6 @@ MatrixClient::initialSync() noexcept emit initialSyncFailed(); return; } - }); } diff --git a/src/dialogs/ReadReceipts.cc b/src/dialogs/ReadReceipts.cc
index 3615d62e..839871be 100644 --- a/src/dialogs/ReadReceipts.cc +++ b/src/dialogs/ReadReceipts.cc
@@ -102,7 +102,7 @@ ReadReceipts::addUsers(const std::multimap<uint64_t, std::string, std::greater<u // We want to remove any previous items that have been set. userList_->clear(); - for (auto receipt : receipts) { + for (const auto &receipt : receipts) { auto user = new ReceiptItem(this, QString::fromStdString(receipt.second), receipt.first); auto item = new QListWidgetItem(userList_);