Remove explicit QVariant and this->

This commit is contained in:
Tobias Fella 2020-02-29 15:26:40 +01:00
parent 1fc7f9b904
commit 708a873880
No known key found for this signature in database
GPG Key ID: E55EDAB3CA5D9925
2 changed files with 7 additions and 7 deletions

View File

@ -35,12 +35,12 @@ EntryListModel::EntryListModel(QObject *parent)
QVariant EntryListModel::data(const QModelIndex &index, int role) const
{
if (role == Bookmark)
return QVariant(m_entries[index.row()].isBookmark());
return m_entries[index.row()].isBookmark();
if (role == Read)
return QVariant(m_entries[index.row()].isRead());
return m_entries[index.row()].isRead();
if (role == Qt::DisplayRole)
return m_entries[index.row()].title();
return QVariant(index.row());
return QStringLiteral("DEADBEEF");
}
int EntryListModel::rowCount(const QModelIndex &index) const
{

View File

@ -50,14 +50,14 @@ QHash<int, QByteArray> FeedListModel::roleNames() const
QVariant FeedListModel::data(const QModelIndex &index, int role) const
{
if (role == Url)
return QVariant(this->feeds[index.row()].url());
return feeds[index.row()].url();
if (role == Qt::DisplayRole)
return QVariant(this->feeds[index.row()].name());
return QVariant();
return feeds[index.row()].name();
return QStringLiteral("DEADBEEF");
}
int FeedListModel::rowCount(const QModelIndex &index) const
{
return this->feeds.size();
return feeds.size();
}
void FeedListModel::add_feed(QString url)