diff --git a/src/gui/tray/activitylistmodel.cpp b/src/gui/tray/activitylistmodel.cpp index b6eb2fa0e3a50..a1cc5d207123e 100644 --- a/src/gui/tray/activitylistmodel.cpp +++ b/src/gui/tray/activitylistmodel.cpp @@ -668,16 +668,14 @@ void ActivityListModel::removeActivityFromActivityList(const Activity &activity) qCInfo(lcActivity) << "Activity/Notification/Error successfully dismissed: " << activity._subject; qCInfo(lcActivity) << "Trying to remove Activity/Notification/Error from view... "; - { - const auto index = _finalList.indexOf(activity); - if (index != -1) { - qCInfo(lcActivity) << "Activity/Notification/Error successfully removed from the list."; - qCInfo(lcActivity) << "Updating Activity/Notification/Error view."; - - beginRemoveRows({}, index, index); - _finalList.removeAt(index); - endRemoveRows(); - } + const auto index = _finalList.indexOf(activity); + if (index != -1) { + qCInfo(lcActivity) << "Activity/Notification/Error successfully removed from the list."; + qCInfo(lcActivity) << "Updating Activity/Notification/Error view."; + + beginRemoveRows({}, index, index); + _finalList.removeAt(index); + endRemoveRows(); } if (activity._type != Activity::ActivityType && @@ -957,9 +955,7 @@ void ActivityListModel::slotRefreshActivityInitial() void ActivityListModel::slotRemoveAccount() { - { - _finalList.clear(); - } + _finalList.clear(); _activityLists.clear(); _presentedActivities.clear(); setAndRefreshCurrentlyFetching(false);