summaryrefslogtreecommitdiff
path: root/forummodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'forummodel.cpp')
-rw-r--r--forummodel.cpp9
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";