|
|
|
|
@ -29,7 +29,6 @@ using namespace NotificationManager; |
|
|
|
|
|
|
|
|
|
AbstractNotificationsModel::Private::Private(AbstractNotificationsModel *q) |
|
|
|
|
: q(q) |
|
|
|
|
, inhibited(false) |
|
|
|
|
, lastRead(QDateTime::currentDateTimeUtc()) |
|
|
|
|
{ |
|
|
|
|
pendingRemovalTimer.setSingleShot(true); |
|
|
|
|
@ -71,10 +70,10 @@ void AbstractNotificationsModel::Private::onNotificationAdded(const Notification |
|
|
|
|
q->endRemoveRows(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
setupNotificationTimeout(notification); |
|
|
|
|
|
|
|
|
|
q->beginInsertRows(QModelIndex(), notifications.count(), notifications.count()); |
|
|
|
|
notifications.append(std::move(notification)); |
|
|
|
|
// Timeout must be set after the item appends to the vector
|
|
|
|
|
setupNotificationTimeout(notification); |
|
|
|
|
q->endInsertRows(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -163,12 +162,6 @@ void AbstractNotificationsModel::Private::setupNotificationTimeout(const Notific |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Don't show the notification popup after switching DND mode off.
|
|
|
|
|
if (inhibited) { |
|
|
|
|
q->expire(notification.id()); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
QTimer *timer = notificationTimeouts.value(notification.id()); |
|
|
|
|
if (!timer) { |
|
|
|
|
timer = new QTimer(); |
|
|
|
|
@ -436,11 +429,6 @@ void AbstractNotificationsModel::stopTimeout(uint notificationId) |
|
|
|
|
delete d->notificationTimeouts.take(notificationId); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void AbstractNotificationsModel::setInhibited(bool inhibited) |
|
|
|
|
{ |
|
|
|
|
d->inhibited = inhibited; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void AbstractNotificationsModel::clear(Notifications::ClearFlags flags) |
|
|
|
|
{ |
|
|
|
|
if (d->notifications.isEmpty()) { |
|
|
|
|
|