From c6f60740cc4ca2db17b415e77008cbc5c347f9d7 Mon Sep 17 00:00:00 2001 From: "Javier S. Pedro" Date: Wed, 1 May 2013 01:36:12 +0200 Subject: standarize root forum id to 0 (violating spec) --- fetchforumsaction.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'fetchforumsaction.cpp') diff --git a/fetchforumsaction.cpp b/fetchforumsaction.cpp index 814ae02..1111957 100644 --- a/fetchforumsaction.cpp +++ b/fetchforumsaction.cpp @@ -56,6 +56,15 @@ void FetchForumsAction::handleFinishedCall() continue; } + if (forum_id < 0) { + qWarning() << "Negative forum_id in" << map; + continue; + } + if (parent_id < 0) { + // Assume this is a root forum + parent_id = 0; + } + query.bindValue(":forum_id", forum_id); query.bindValue(":parent_id", parent_id); query.bindValue(":forum_name", decodeForumText(map["forum_name"])); -- cgit v1.2.3