combineActivityLists();
}
+void ActivityListModel::clearNotifications() {
+ qCInfo(lcActivity) << "Clear the notifications";
+ _notificationLists.clear();
+ combineActivityLists();
+}
+
void ActivityListModel::removeActivityFromActivityList(int row) {
Activity activity = _finalList.at(row);
removeActivityFromActivityList(activity);
ActivityList activityList() { return _finalList; }
ActivityList errorsList() { return _notificationErrorsLists; }
void addNotificationToActivityList(Activity activity);
+ void clearNotifications();
void addErrorToActivityList(Activity activity);
void addSyncFileItemToActivityList(Activity activity);
void removeActivityFromActivityList(int row);
// collected.
void ActivityWidget::slotBuildNotificationDisplay(const ActivityList &list)
{
- QString listAccountName;
-
// Whether a new notification was added to the list
bool newNotificationShown = false;
+ _model->clearNotifications();
+
foreach (auto activity, list) {
if (_blacklistedNotifications.contains(activity)) {
qCInfo(lcActivity) << "Activity in blacklist, skip";
continue;
}
- // remember the list account name for the strayCat handling below.
- listAccountName = activity._accName;
-
// handle gui logs. In order to NOT annoy the user with every fetching of the
// notifications the notification id is stored in a Set. Only if an id
// is not in the set, it qualifies for guiLog.
emit guiLog(activity._subject, activity._accName);
}
}
-
- _model->addNotificationToActivityList(activity);
}
+
+ _model->addNotificationToActivityList(activity);
}
// restart the gui log timer now that we show a new notification
- if(newNotificationShown)
+ if(newNotificationShown) {
_guiLogTimer.start();
+ }
}
void ActivityWidget::slotSendNotificationRequest(const QString &accountName, const QString &link, const QByteArray &verb, int row)