|
|
|
@ -365,17 +365,22 @@ bool AbstractNotificationsModel::setData(const QModelIndex &index, const QVarian |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Notification ¬ification = d->notifications[index.row()]; |
|
|
|
Notification ¬ification = d->notifications[index.row()]; |
|
|
|
|
|
|
|
bool dirty = false; |
|
|
|
|
|
|
|
|
|
|
|
switch (role) { |
|
|
|
switch (role) { |
|
|
|
case Notifications::ReadRole: |
|
|
|
case Notifications::ReadRole: |
|
|
|
if (value.toBool() != notification.read()) { |
|
|
|
if (value.toBool() != notification.read()) { |
|
|
|
notification.setRead(value.toBool()); |
|
|
|
notification.setRead(value.toBool()); |
|
|
|
return true; |
|
|
|
dirty = true; |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return false; |
|
|
|
if (dirty) { |
|
|
|
|
|
|
|
Q_EMIT dataChanged(index, index, {role}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return dirty; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int AbstractNotificationsModel::rowCount(const QModelIndex &parent) const |
|
|
|
int AbstractNotificationsModel::rowCount(const QModelIndex &parent) const |
|
|
|
|