diff --git a/libnotificationmanager/jobsmodel.cpp b/libnotificationmanager/jobsmodel.cpp --- a/libnotificationmanager/jobsmodel.cpp +++ b/libnotificationmanager/jobsmodel.cpp @@ -93,7 +93,7 @@ QVariant JobsModel::data(const QModelIndex &index, int role) const { - if (!checkIndex(index)) { + if (!checkIndex(index, QAbstractItemModel::CheckIndexOption::IndexIsValid)) { return QVariant(); } @@ -150,7 +150,7 @@ bool JobsModel::setData(const QModelIndex &index, const QVariant &value, int role) { - if (!checkIndex(index)) { + if (!checkIndex(index, QAbstractItemModel::CheckIndexOption::IndexIsValid)) { return false; } @@ -184,35 +184,35 @@ void JobsModel::close(const QModelIndex &idx) { - if (checkIndex(idx)) { + if (checkIndex(idx, QAbstractItemModel::CheckIndexOption::IndexIsValid)) { d->removeAt(idx.row()); } } void JobsModel::expire(const QModelIndex &idx) { - if (checkIndex(idx)) { + if (checkIndex(idx, QAbstractItemModel::CheckIndexOption::IndexIsValid)) { d->m_jobViews.at(idx.row())->setExpired(true); } } void JobsModel::suspend(const QModelIndex &idx) { - if (checkIndex(idx)) { + if (checkIndex(idx, QAbstractItemModel::CheckIndexOption::IndexIsValid)) { d->m_jobViews.at(idx.row())->suspend(); } } void JobsModel::resume(const QModelIndex &idx) { - if (checkIndex(idx)) { + if (checkIndex(idx, QAbstractItemModel::CheckIndexOption::IndexIsValid)) { d->m_jobViews.at(idx.row())->resume(); } } void JobsModel::kill(const QModelIndex &idx) { - if (checkIndex(idx)) { + if (checkIndex(idx, QAbstractItemModel::CheckIndexOption::IndexIsValid)) { d->m_jobViews.at(idx.row())->kill(); } } diff --git a/libnotificationmanager/notificationsmodel.cpp b/libnotificationmanager/notificationsmodel.cpp --- a/libnotificationmanager/notificationsmodel.cpp +++ b/libnotificationmanager/notificationsmodel.cpp @@ -254,7 +254,7 @@ QVariant NotificationsModel::data(const QModelIndex &index, int role) const { - if (!checkIndex(index)) { + if (!checkIndex(index, QAbstractItemModel::CheckIndexOption::IndexIsValid)) { return QVariant(); } @@ -324,7 +324,7 @@ bool NotificationsModel::setData(const QModelIndex &index, const QVariant &value, int role) { - if (!checkIndex(index)) { + if (!checkIndex(index, QAbstractItemModel::CheckIndexOption::IndexIsValid)) { return false; }