From c80206c8b5aa2aebf0fbb5f58b3f2c528fc1558e Mon Sep 17 00:00:00 2001 From: alex-z Date: Mon, 17 Jul 2023 10:09:52 +0200 Subject: [PATCH] Fix review comments I. Signed-off-by: alex-z --- src/gui/tray/activitylistmodel.cpp | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) 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);