diff options
author | Lionel Chauvin <megabigbug@yahoo.fr> | 2010-10-09 17:56:56 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2010-10-30 11:38:06 +0200 |
commit | ad9792b051c393e344cbf5ac833dc69f50cfea1c (patch) | |
tree | 7f0fb1a95eeec46a3e18f8ef0648dc315f652862 /src/opensearch/suggestionparser.cpp | |
parent | add an xml parser to the opensearch engine. (diff) | |
download | rekonq-ad9792b051c393e344cbf5ac833dc69f50cfea1c.tar.xz |
add image field to opensearch
Diffstat (limited to 'src/opensearch/suggestionparser.cpp')
-rw-r--r-- | src/opensearch/suggestionparser.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/opensearch/suggestionparser.cpp b/src/opensearch/suggestionparser.cpp index 56cd2c8e..01581bf9 100644 --- a/src/opensearch/suggestionparser.cpp +++ b/src/opensearch/suggestionparser.cpp @@ -36,7 +36,7 @@ #include<QByteArray> #include<QStringList> -ResponseList SuggestionParser::parse(const QByteArray &resp) +ResponseList SuggestionParser::parse(const QByteArray &) { return ResponseList(); } @@ -70,6 +70,7 @@ ResponseList XMLParser::parse(const QByteArray &resp) { QString title; QString url; + QString image; QString description; while (!m_reader.isEndElement() && !m_reader.atEnd()) @@ -77,11 +78,12 @@ ResponseList XMLParser::parse(const QByteArray &resp) m_reader.readNext(); if (m_reader.name() == QL1S("Text")) title = m_reader.readElementText(); - if (m_reader.name() == QL1S("Url")) url = m_reader.readElementText(); + if (m_reader.name() == QL1S("Url")) url = m_reader.readElementText(); + if (m_reader.name() == QL1S("Image")) image = m_reader.readElementText(); if (m_reader.name() == QL1S("Description")) description = m_reader.readElementText(); } - rlist << Response(url, title, description); + rlist << Response(url, title, image, description); } } @@ -129,4 +131,4 @@ ResponseList JSONParser::parse(const QByteArray &resp) } return rlist; -}
\ No newline at end of file +} |