summaryrefslogtreecommitdiff
path: root/src/opensearch/suggestionparser.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2010-11-07 22:31:43 +0100
committerAndrea Diamantini <adjam7@gmail.com>2010-11-07 22:31:43 +0100
commit23fdf29c98c402e96e7cb14eecba30671bc72d64 (patch)
tree2732854f3ded89546f86ce479654c569549a9ba4 /src/opensearch/suggestionparser.cpp
parentFirst bunch of fixes for the suggestions. (diff)
downloadrekonq-23fdf29c98c402e96e7cb14eecba30671bc72d64.tar.xz
Let suggestions work also without search engines ones.
Diffstat (limited to 'src/opensearch/suggestionparser.cpp')
-rw-r--r--src/opensearch/suggestionparser.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/opensearch/suggestionparser.cpp b/src/opensearch/suggestionparser.cpp
index 98bb8a69..4ed13e16 100644
--- a/src/opensearch/suggestionparser.cpp
+++ b/src/opensearch/suggestionparser.cpp
@@ -55,7 +55,8 @@ ResponseList XMLParser::parse(const QByteArray &resp)
{
m_reader.readNext();
- if (m_reader.isStartDocument()) continue;
+ if (m_reader.isStartDocument())
+ continue;
if (m_reader.isStartElement() && m_reader.name() == QL1S("Item"))
{
@@ -105,6 +106,7 @@ ResponseList JSONParser::parse(const QByteArray &resp)
if (response.isEmpty())
{
+ kDebug() << "RESPONSE IS EMPTY";
return ResponseList();
}
@@ -112,12 +114,14 @@ ResponseList JSONParser::parse(const QByteArray &resp)
|| !response.endsWith(QL1C(']'))
)
{
+ kDebug() << "RESPONSE is NOT well FORMED";
return ResponseList();
}
// Evaluate the JSON response using QtScript.
if (!m_reader.canEvaluate(response))
{
+ kDebug() << "m_reader cannot evaluate the response";
return ResponseList();
}
@@ -125,6 +129,7 @@ ResponseList JSONParser::parse(const QByteArray &resp)
if (!responseParts.property(1).isArray())
{
+ kDebug() << "RESPONSE is not an array";
return ResponseList();
}