From 3ae5306e56e17bb87e1fcdae5e7c366e6412acda Mon Sep 17 00:00:00 2001 From: Tobias Fella Date: Sat, 4 Jun 2022 01:37:58 +0200 Subject: [PATCH] Improve gammarayability of EntriesModel & FeedsModel This makes both models return a reasonable value for Qt::DisplayRole, allowing gammaray to show something in the model explorer --- src/models/entriesmodel.cpp | 1 + src/models/feedsmodel.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/models/entriesmodel.cpp b/src/models/entriesmodel.cpp index 231f5536..933bcb90 100644 --- a/src/models/entriesmodel.cpp +++ b/src/models/entriesmodel.cpp @@ -34,6 +34,7 @@ QVariant EntriesModel::data(const QModelIndex &index, int role) const switch (role) { case EpisodeModel::Roles::EntryRole: return QVariant::fromValue(DataManager::instance().getEntry(m_feed, index.row())); + case Qt::DisplayRole: case EpisodeModel::Roles::IdRole: return QVariant::fromValue(DataManager::instance().getIdList(m_feed)[index.row()]); default: diff --git a/src/models/feedsmodel.cpp b/src/models/feedsmodel.cpp index a36bbd5d..4b95cb41 100644 --- a/src/models/feedsmodel.cpp +++ b/src/models/feedsmodel.cpp @@ -67,6 +67,7 @@ QVariant FeedsModel::data(const QModelIndex &index, int role) const switch (role) { case FeedRole: return QVariant::fromValue(DataManager::instance().getFeed(index.row())); + case Qt::DisplayRole: case UrlRole: return QVariant::fromValue(DataManager::instance().getFeed(index.row())->url()); case TitleRole: