Keep a set of all the tags from the posts stored

This allows later on to get post-specific tags.
This commit is contained in:
Luca Beltrame 2015-02-20 23:35:13 +01:00
parent f6aa593ee5
commit 942d1ffd1e
2 changed files with 10 additions and 0 deletions

View file

@ -57,6 +57,7 @@ void DanbooruPostModel::addPost(Danbooru::DanbooruPost *post)
beginInsertRows(QModelIndex(), m_items.size(), m_items.size());
m_items.append(post);
m_postTags.unite(post->tags());
endInsertRows();
}
@ -147,5 +148,11 @@ QHash< int, QByteArray > DanbooruPostModel::roleNames() const
return roles;
}
QStringList DanbooruPostModel::postTags() const
{
return m_postTags.toList();
}
};