diff options
author | Javier S. Pedro <maemo@javispedro.com> | 2013-04-07 03:13:14 +0200 |
---|---|---|
committer | Javier S. Pedro <maemo@javispedro.com> | 2013-04-07 03:13:14 +0200 |
commit | 9e67c13e587ccf10084144fea033beda316faed5 (patch) | |
tree | 33170309064aaf182d14e95e1d8121a8041180b3 /board.cpp | |
parent | 1a66f6ee4f3806e2a18af718654e7281c7dd1066 (diff) | |
download | tapasboard-9e67c13e587ccf10084144fea033beda316faed5.tar.gz tapasboard-9e67c13e587ccf10084144fea033beda316faed5.zip |
add support for reading announcements & stickies
Diffstat (limited to 'board.cpp')
-rw-r--r-- | board.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -293,10 +293,10 @@ void Board::notifyForumChanged(int forumId) emit forumChanged(forumId); } -void Board::notifyForumTopicsChanged(int forumId, int start, int end) +void Board::notifyForumTopicsChanged(int forumId, TopicType type, int start, int end) { - qDebug() << "ForumTopics changed" << forumId << start << end; - emit forumTopicsChanged(forumId, start, end); + qDebug() << "ForumTopics changed" << forumId << type << start << end; + emit forumTopicsChanged(forumId, type, start, end); } void Board::notifyForumTopicChanged(int forumId, int topicId) @@ -415,7 +415,7 @@ bool Board::initializeDb() return false; } - if (!q.exec("CREATE TABLE IF NOT EXISTS forums (forum_id INTEGER PRIMARY KEY, forum_name TEXT, description TEXT, parent_id INT, logo_url TEXT, new_post BOOL, is_protected BOOL, is_subscribed BOOL, can_subscribe BOOL, url TEXT, sub_only BOOL, position INT)")) { + if (!q.exec("CREATE TABLE IF NOT EXISTS forums (forum_id INTEGER PRIMARY KEY, forum_name TEXT, description TEXT, parent_id INTEGER, logo_url TEXT, new_post BOOL, is_protected BOOL, is_subscribed BOOL, can_subscribe BOOL, url TEXT, sub_only BOOL, position INT)")) { qWarning() << "Could not create forums table:" << q.lastError().text(); return false; } @@ -428,7 +428,7 @@ bool Board::initializeDb() return false; } - if (!q.exec("CREATE TABLE IF NOT EXISTS topics (forum_id INTEGER, topic_id INTEGER PRIMARY KEY, topic_title TEXT, topic_author_id INTEGER, topic_author_name TEXT, is_subscribed BOOL, is_closed BOOL, icon_url TEXT, last_reply_time TEXT, reply_number INT, new_post BOOL, position INT, last_update_time TEXT)")) { + if (!q.exec("CREATE TABLE IF NOT EXISTS topics (forum_id INTEGER, topic_id INTEGER PRIMARY KEY, topic_type INT, topic_title TEXT, topic_author_id INTEGER, topic_author_name TEXT, is_subscribed BOOL, is_closed BOOL, icon_url TEXT, last_reply_time TEXT, reply_number INT, new_post BOOL, position INT, last_update_time TEXT)")) { qWarning() << "Could not create topics table:" << q.lastError().text(); return false; } @@ -440,7 +440,7 @@ bool Board::initializeDb() qWarning() << "Could not create topics_time index:" << q.lastError().text(); return false; } - if (!q.exec("CREATE INDEX IF NOT EXISTS topics_order ON topics (forum_id, position ASC)")) { + if (!q.exec("CREATE INDEX IF NOT EXISTS topics_order ON topics (forum_id, topic_type DESC, position ASC)")) { qWarning() << "Could not create topics_order index:" << q.lastError().text(); return false; } |