summaryrefslogtreecommitdiff
path: root/fetchforumsaction.cpp
diff options
context:
space:
mode:
authorJavier S. Pedro <maemo@javispedro.com>2013-04-04 20:58:57 +0200
committerJavier S. Pedro <maemo@javispedro.com>2013-04-04 20:58:57 +0200
commitf690c7dde14a6f9c5fbf04ed94170c7648591cb6 (patch)
tree6e63dac978af3864622d0a9f85dac07f24318930 /fetchforumsaction.cpp
parent256e7837ce8cb30b0c0a8c73306abdffa80365a6 (diff)
downloadtapasboard-f690c7dde14a6f9c5fbf04ed94170c7648591cb6.tar.gz
tapasboard-f690c7dde14a6f9c5fbf04ed94170c7648591cb6.zip
store post position in database, create invisible items for unfetched
Diffstat (limited to 'fetchforumsaction.cpp')
-rw-r--r--fetchforumsaction.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/fetchforumsaction.cpp b/fetchforumsaction.cpp
index c3b77cd..8bbe23b 100644
--- a/fetchforumsaction.cpp
+++ b/fetchforumsaction.cpp
@@ -39,8 +39,8 @@ void FetchForumsAction::handleFinishedCall()
handleDatabaseError("truncating forums table", db.lastError());
}
QSqlQuery query(db);
- query.prepare("INSERT INTO forums (forum_id, forum_name, description, parent_id, logo_url, new_post, is_protected, is_subscribed, can_subscribe, url, sub_only, sort_index)"
- "VALUES (:forum_id, :forum_name, :description, :parent_id, :logo_url, :new_post, :is_protected, :is_subscribed, :can_subscribe, :url, :sub_only, :sort_index)");
+ query.prepare("INSERT INTO forums (forum_id, forum_name, description, parent_id, logo_url, new_post, is_protected, is_subscribed, can_subscribe, url, sub_only, position)"
+ "VALUES (:forum_id, :forum_name, :description, :parent_id, :logo_url, :new_post, :is_protected, :is_subscribed, :can_subscribe, :url, :sub_only, :position)");
foreach (const QVariant& list_element, list) {
QVariantMap map = list_element.toMap();
@@ -67,7 +67,7 @@ void FetchForumsAction::handleFinishedCall()
query.bindValue(":can_subscribe", map["can_subscribed"].toBool() ? 1 : 0);
query.bindValue(":url", map["url"].toString());
query.bindValue(":sub_only", map["sub_only"].toBool() ? 1 : 0);
- query.bindValue(":sort_index", map["sort_index"]);
+ query.bindValue(":position", map["position"]);
if (!query.exec()) {
qWarning() << "Failed to store forum info for:" << forum_id;
@@ -95,7 +95,7 @@ QList<QVariantMap> FetchForumsAction::flattenForumList(const QVariantList &list,
QList<QVariantMap> flattened;
foreach (const QVariant& list_element, list) {
QVariantMap map = list_element.toMap();
- map["sort_index"] = (*order)++;
+ map["position"] = (*order)++;
QVariantMap::iterator child_key = map.find("child");
if (child_key != map.end()) {
// There are children, so flatten them too.