diff options
author | Javier S. Pedro <maemo@javispedro.com> | 2013-04-01 20:46:39 +0200 |
---|---|---|
committer | Javier S. Pedro <maemo@javispedro.com> | 2013-04-01 20:46:39 +0200 |
commit | a6e64fbf9404b201b04fbd1ab4b959a18d8f83a9 (patch) | |
tree | 6b97b6ac14716dbe51cb105819abde3e36ffd465 /forummodel.cpp | |
parent | 5ef8b38e55c1883224fe1f01f47aba45b7b42666 (diff) | |
download | tapasboard-a6e64fbf9404b201b04fbd1ab4b959a18d8f83a9.tar.gz tapasboard-a6e64fbf9404b201b04fbd1ab4b959a18d8f83a9.zip |
add support for actually reading topics
Diffstat (limited to 'forummodel.cpp')
-rw-r--r-- | forummodel.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/forummodel.cpp b/forummodel.cpp index 43cb0bd..c66d3a8 100644 --- a/forummodel.cpp +++ b/forummodel.cpp @@ -13,10 +13,7 @@ ForumModel::ForumModel(QObject *parent) : QHash<int, QByteArray> roles = roleNames(); roles[TitleRole] = QByteArray("title"); roles[IconRole] = QByteArray("icon"); - //roles[DescriptionRole] = QByteArray("subtitle"); - //roles[ForumIdRole] = QByteArray("forumId"); - //roles[ParentIdRole] = QByteArray("parentId"); - //roles[CategoryRole] = QByteArray("category"); + roles[TopicIdRole] = QByteArray("topicId"); setRoleNames(roles); } @@ -84,6 +81,9 @@ QVariant ForumModel::data(const QModelIndex &index, int role) const case TitleRole: return _data[row].title; break; + case TopicIdRole: + return _data[row].topic_id; + break; } return QVariant(); @@ -266,6 +266,7 @@ void ForumModel::update() if (!last.isValid() || last.secsTo(QDateTime::currentDateTime()) > FORUM_TOP_TLL) { // Outdated or empty, refresh. + qDebug() << "Fetching topics because the top are old"; _board->enqueueAction(new FetchTopicsAction(_forumId, 0, FORUM_PAGE_SIZE - 1, _board)); } else { qDebug() << "Topics not outdated"; |