[Notifications] Emit dataChanged in setData call

Ensures the role is properly signalled to have changed.

CCBUG: 429862
wilder-5.22
Kai Uwe Broulik 5 years ago
parent c3e629df25
commit d840c5dca2
  1. 9
      libnotificationmanager/abstractnotificationsmodel.cpp

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

Loading…
Cancel
Save