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
This commit is contained in:
Tobias Fella 2022-06-04 01:37:58 +02:00
parent cc480fa01a
commit 3ae5306e56
2 changed files with 2 additions and 0 deletions

View File

@ -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:

View File

@ -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: