Changeset View
Changeset View
Standalone View
Standalone View
libnotificationmanager/notificationsmodel.cpp
Show First 20 Lines • Show All 102 Lines • ▼ Show 20 Line(s) | 85 | { | |||
---|---|---|---|---|---|
103 | q->endInsertRows(); | 103 | q->endInsertRows(); | ||
104 | } | 104 | } | ||
105 | 105 | | |||
106 | void NotificationsModel::Private::onNotificationReplaced(uint replacedId, const Notification ¬ification) | 106 | void NotificationsModel::Private::onNotificationReplaced(uint replacedId, const Notification ¬ification) | ||
107 | { | 107 | { | ||
108 | const int row = rowOfNotification(replacedId); | 108 | const int row = rowOfNotification(replacedId); | ||
109 | 109 | | |||
110 | if (row == -1) { | 110 | if (row == -1) { | ||
111 | qCWarning(NOTIFICATIONMANAGER) << "Trying to replace notification with id" << replacedId << "which doesn't exist, creating a new one. This is an application bug!"; | ||||
112 | onNotificationAdded(notification); | ||||
111 | return; | 113 | return; | ||
112 | } | 114 | } | ||
113 | 115 | | |||
114 | setupNotificationTimeout(notification); | 116 | setupNotificationTimeout(notification); | ||
115 | 117 | | |||
116 | notifications[row] = notification; | 118 | notifications[row] = notification; | ||
117 | const QModelIndex idx = q->index(row, 0); | 119 | const QModelIndex idx = q->index(row, 0); | ||
118 | emit q->dataChanged(idx, idx); | 120 | emit q->dataChanged(idx, idx); | ||
▲ Show 20 Lines • Show All 357 Lines • Show Last 20 Lines |