Skip to content
Snippets Groups Projects
Commit 0e91dae9 authored by Konstantinos Sideris's avatar Konstantinos Sideris
Browse files

Erase items using the key

parent 936e215a
No related branches found
No related tags found
No related merge requests found
......@@ -20,7 +20,7 @@ public:
void clear() { communities_.clear(); }
void addCommunity(QSharedPointer<Community> community, const QString &id);
void removeCommunity(const QString &id);
void removeCommunity(const QString &id) { communities_.erase(id); };
signals:
void communityChanged(const QString &id);
......
......@@ -39,7 +39,7 @@ AvatarProvider::updateAvatar(const QString &uid, const QImage &img)
for (const auto callback : callbacks)
callback(img);
toBeResolved_.erase(toBeResolved_.find(uid));
toBeResolved_.erase(uid);
}
auto avatarData = avatars_[uid];
......
......@@ -761,8 +761,9 @@ ChatPage::addRoom(const QString &room_id)
void
ChatPage::removeRoom(const QString &room_id)
{
roomStates_.erase(roomStates_.find(room_id));
roomSettings_.erase(roomSettings_.find(room_id));
roomStates_.erase(room_id);
roomSettings_.erase(room_id);
try {
cache_->removeRoom(room_id);
cache_->removeInvite(room_id);
......
......@@ -100,12 +100,6 @@ CommunitiesList::addCommunity(QSharedPointer<Community> community, const QString
&CommunitiesList::highlightSelectedCommunity);
}
void
CommunitiesList::removeCommunity(const QString &community_id)
{
communities_.erase(communities_.find(community_id));
}
void
CommunitiesList::updateCommunityAvatar(const QString &community_id, const QPixmap &img)
{
......
......@@ -123,7 +123,7 @@ RoomList::updateAvatar(const QString &room_id, const QString &url)
void
RoomList::removeRoom(const QString &room_id, bool reset)
{
rooms_.erase(rooms_.find(room_id));
rooms_.erase(room_id);
if (rooms_.empty() || !reset)
return;
......
......@@ -157,7 +157,7 @@ RoomState::update(const RoomState &state)
}
if (membershipState == mtx::events::state::Membership::Leave)
this->memberships.erase(this->memberships.find(it->first));
this->memberships.erase(it->first);
else
this->memberships.emplace(it->first, it->second);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment