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) { switch (role) {
case EpisodeModel::Roles::EntryRole: case EpisodeModel::Roles::EntryRole:
return QVariant::fromValue(DataManager::instance().getEntry(m_feed, index.row())); return QVariant::fromValue(DataManager::instance().getEntry(m_feed, index.row()));
case Qt::DisplayRole:
case EpisodeModel::Roles::IdRole: case EpisodeModel::Roles::IdRole:
return QVariant::fromValue(DataManager::instance().getIdList(m_feed)[index.row()]); return QVariant::fromValue(DataManager::instance().getIdList(m_feed)[index.row()]);
default: default:

View File

@ -67,6 +67,7 @@ QVariant FeedsModel::data(const QModelIndex &index, int role) const
switch (role) { switch (role) {
case FeedRole: case FeedRole:
return QVariant::fromValue(DataManager::instance().getFeed(index.row())); return QVariant::fromValue(DataManager::instance().getFeed(index.row()));
case Qt::DisplayRole:
case UrlRole: case UrlRole:
return QVariant::fromValue(DataManager::instance().getFeed(index.row())->url()); return QVariant::fromValue(DataManager::instance().getFeed(index.row())->url());
case TitleRole: case TitleRole: