mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-24 13:25:52 +03:00
Do not display dismissed notifications
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
parent
ae7ad8fb4f
commit
86251ff2e3
3 changed files with 13 additions and 8 deletions
|
@ -233,6 +233,12 @@ void ActivityListModel::addNotificationToActivityList(Activity activity) {
|
|||
combineActivityLists();
|
||||
}
|
||||
|
||||
void ActivityListModel::clearNotifications() {
|
||||
qCInfo(lcActivity) << "Clear the notifications";
|
||||
_notificationLists.clear();
|
||||
combineActivityLists();
|
||||
}
|
||||
|
||||
void ActivityListModel::removeActivityFromActivityList(int row) {
|
||||
Activity activity = _finalList.at(row);
|
||||
removeActivityFromActivityList(activity);
|
||||
|
|
|
@ -49,6 +49,7 @@ public:
|
|||
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);
|
||||
|
|
|
@ -430,20 +430,17 @@ void ActivityWidget::slotOpenFile(QModelIndex indx)
|
|||
// 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.
|
||||
|
@ -468,14 +465,15 @@ void ActivityWidget::slotBuildNotificationDisplay(const ActivityList &list)
|
|||
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)
|
||||
|
|
Loading…
Reference in a new issue