diff --git a/libnotificationmanager/jobsmodel.cpp b/libnotificationmanager/jobsmodel.cpp --- a/libnotificationmanager/jobsmodel.cpp +++ b/libnotificationmanager/jobsmodel.cpp @@ -92,7 +92,7 @@ QVariant JobsModel::data(const QModelIndex &index, int role) const { - if (!checkIndex(index)) { + if (!checkIndex(index, QAbstractItemModel::CheckIndexOption::IndexIsValid)) { return QVariant(); } @@ -149,7 +149,7 @@ bool JobsModel::setData(const QModelIndex &index, const QVariant &value, int role) { - if (!checkIndex(index)) { + if (!checkIndex(index, QAbstractItemModel::CheckIndexOption::IndexIsValid)) { return false; } @@ -178,35 +178,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 @@ -253,7 +253,7 @@ QVariant NotificationsModel::data(const QModelIndex &index, int role) const { - if (!checkIndex(index)) { + if (!checkIndex(index, QAbstractItemModel::CheckIndexOption::IndexIsValid)) { return QVariant(); } @@ -323,7 +323,7 @@ bool NotificationsModel::setData(const QModelIndex &index, const QVariant &value, int role) { - if (!checkIndex(index)) { + if (!checkIndex(index, QAbstractItemModel::CheckIndexOption::IndexIsValid)) { return false; }