mirror of https://github.com/KDE/kasts.git
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:
parent
cc480fa01a
commit
3ae5306e56
|
@ -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:
|
||||||
|
|
|
@ -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:
|
||||||
|
|
Loading…
Reference in New Issue