From dbc7bd3c30f8fa68561655287fc2246ec0a98bdf Mon Sep 17 00:00:00 2001 From: Bhushan Shah Date: Mon, 11 May 2020 11:22:27 +0530 Subject: [PATCH] libnotificationmanager: fix the checkIndex after moving around functions Fix in the f2e34dbbd3 got partially reverted by introduction of AbstractNotificationsModel in 2357e6f2e134. --- libnotificationmanager/abstractnotificationsmodel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libnotificationmanager/abstractnotificationsmodel.cpp b/libnotificationmanager/abstractnotificationsmodel.cpp index 6d5cffbc6..cac8ec597 100644 --- a/libnotificationmanager/abstractnotificationsmodel.cpp +++ b/libnotificationmanager/abstractnotificationsmodel.cpp @@ -197,7 +197,7 @@ void AbstractNotificationsModel::setLastRead(const QDateTime &lastRead) QVariant AbstractNotificationsModel::data(const QModelIndex &index, int role) const { - if (!checkIndex(index)) { + if (!checkIndex(index, QAbstractItemModel::CheckIndexOption::IndexIsValid)) { return QVariant(); } @@ -267,7 +267,7 @@ QVariant AbstractNotificationsModel::data(const QModelIndex &index, int role) co bool AbstractNotificationsModel::setData(const QModelIndex &index, const QVariant &value, int role) { - if (!checkIndex(index)) { + if (!checkIndex(index, QAbstractItemModel::CheckIndexOption::IndexIsValid)) { return false; }