diff options
author | axis <qt-info@nokia.com> | 2009-08-19 09:24:04 (GMT) |
---|---|---|
committer | axis <qt-info@nokia.com> | 2009-08-19 09:24:04 (GMT) |
commit | 2d1b49bd21b788ba3e35fc5c41bf3aab42cbda65 (patch) | |
tree | 24dae3a4532870d61282841f6bb186cb008ab747 /examples/network | |
parent | b3a3652abbf1cb4ebba6c6257ecf47f8dc022d93 (diff) | |
parent | 20d2b7312456435e5e1a98dba7c2cc96b44fe83c (diff) | |
download | Qt-2d1b49bd21b788ba3e35fc5c41bf3aab42cbda65.zip Qt-2d1b49bd21b788ba3e35fc5c41bf3aab42cbda65.tar.gz Qt-2d1b49bd21b788ba3e35fc5c41bf3aab42cbda65.tar.bz2 |
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt
Conflicts:
tests/auto/auto.pro
Diffstat (limited to 'examples/network')
-rw-r--r-- | examples/network/googlesuggest/googlesuggest.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/examples/network/googlesuggest/googlesuggest.cpp b/examples/network/googlesuggest/googlesuggest.cpp index ada0edf..4142511 100644 --- a/examples/network/googlesuggest/googlesuggest.cpp +++ b/examples/network/googlesuggest/googlesuggest.cpp @@ -134,7 +134,6 @@ bool GSuggestCompletion::eventFilter(QObject *obj, QEvent *ev) void GSuggestCompletion::showCompletion(const QStringList &choices, const QStringList &hits) { - if (choices.isEmpty() || choices.count() != hits.count()) return; @@ -204,16 +203,16 @@ void GSuggestCompletion::handleNetworkData(QNetworkReply *networkReply) QXmlStreamReader xml(response); while (!xml.atEnd()) { xml.readNext(); - if (xml.tokenType() == QXmlStreamReader::StartElement) + if (xml.isStartElement()) { if (xml.name() == "suggestion") { QStringRef str = xml.attributes().value("data"); choices << str.toString(); } - if (xml.tokenType() == QXmlStreamReader::StartElement) - if (xml.name() == "num_queries") { + else if (xml.name() == "num_queries") { QStringRef str = xml.attributes().value("int"); hits << str.toString(); } + } } showCompletion(choices, hits); |