diff --git a/src/gui/tray/activitylistmodel.cpp b/src/gui/tray/activitylistmodel.cpp index 05999258a3ea7..9da43924d68b9 100644 --- a/src/gui/tray/activitylistmodel.cpp +++ b/src/gui/tray/activitylistmodel.cpp @@ -440,7 +440,6 @@ void ActivityListModel::startFetchJob() void ActivityListModel::setFinalList(const ActivityList &finalList) { - QMutexLocker locker(&_finalListMutex); _finalList = finalList; emit allConflictsChanged(); @@ -669,17 +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... "; - { - QMutexLocker locker(&_finalListMutex); - 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 && @@ -696,14 +692,12 @@ void ActivityListModel::removeActivityFromActivityList(const Activity &activity) void ActivityListModel::checkAndRemoveSeenActivities(const OCC::ActivityList &newActivities) { ActivityList activitiesToRemove; - { - QMutexLocker locker(&_finalListMutex); - for (const auto &activity : _finalList) { - if (activity._objectType == QStringLiteral("chat") && !newActivities.contains(activity)) { - activitiesToRemove.push_back(activity); - } + for (const auto &activity : _finalList) { + if (activity._objectType == QStringLiteral("chat") && !newActivities.contains(activity)) { + activitiesToRemove.push_back(activity); } } + for (const auto &toRemove : activitiesToRemove) { removeActivityFromActivityList(toRemove); } @@ -960,10 +954,7 @@ void ActivityListModel::slotRefreshActivityInitial() void ActivityListModel::slotRemoveAccount() { - { - QMutexLocker locker(&_finalListMutex); - _finalList.clear(); - } + _finalList.clear(); _activityLists.clear(); _presentedActivities.clear(); setAndRefreshCurrentlyFetching(false); diff --git a/src/gui/tray/activitylistmodel.h b/src/gui/tray/activitylistmodel.h index dd3b5fc2dd2f4..72716aa4d4283 100644 --- a/src/gui/tray/activitylistmodel.h +++ b/src/gui/tray/activitylistmodel.h @@ -191,7 +191,6 @@ private slots: ActivityList _listOfIgnoredFiles; ActivityList _notificationErrorsLists; ActivityList _finalList; - QMutex _finalListMutex; QSet _presentedActivities; diff --git a/src/gui/tray/usermodel.cpp b/src/gui/tray/usermodel.cpp index 3c29f577ffdad..e9a5ed73ae433 100644 --- a/src/gui/tray/usermodel.cpp +++ b/src/gui/tray/usermodel.cpp @@ -245,7 +245,6 @@ void User::slotBuildNotificationDisplay(const ActivityList &list) void User::slotNotificationFetchFinished() { - QMutexLocker locker(&_isNotificationFetchRunningMutex); _isNotificationFetchRunning = false; } @@ -451,7 +450,6 @@ void User::slotRefreshNotifications() // start a server notification handler if no notification requests // are running if (_notificationRequestsRunning == 0) { - QMutexLocker locker(&_isNotificationFetchRunningMutex); if (_isNotificationFetchRunning) { qCDebug(lcActivity) << "Notification fetch is already running."; return; diff --git a/src/gui/tray/usermodel.h b/src/gui/tray/usermodel.h index 6e099e058afd3..bfeaff46d2487 100644 --- a/src/gui/tray/usermodel.h +++ b/src/gui/tray/usermodel.h @@ -188,7 +188,6 @@ private slots: int _lastChatNotificationsReceivedCount = 0; - QMutex _isNotificationFetchRunningMutex; bool _isNotificationFetchRunning = false; };