summaryrefslogtreecommitdiff
path: root/board.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'board.cpp')
-rw-r--r--board.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/board.cpp b/board.cpp
index da469dc..26908b7 100644
--- a/board.cpp
+++ b/board.cpp
@@ -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;
}