examples: remove some unneeded QStringRef::toString() calls
- when appending to another string - when just comparing - when just calling toInt() Change-Id: I6960784569b83bfd3e3640a8c04f2f909c293449 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
parent
f497dea730
commit
25d1bbb849
@ -270,19 +270,18 @@ private:
|
||||
inFlightStatus |= className == "FlightDetailHeaderStatus";
|
||||
inFlightMap |= className == "flightMap";
|
||||
if (xml.name() == "td" && !className.isEmpty()) {
|
||||
QString cn = className.toString();
|
||||
if (cn.contains("fieldTitle")) {
|
||||
if (className.contains("fieldTitle")) {
|
||||
inFieldName = true;
|
||||
fieldNames += QString();
|
||||
fieldValues += QString();
|
||||
}
|
||||
if (cn.contains("fieldValue"))
|
||||
if (className.contains("fieldValue"))
|
||||
inFieldValue = true;
|
||||
}
|
||||
if (xml.name() == "img" && inFlightMap) {
|
||||
QString src = xml.attributes().value("src").toString();
|
||||
src.prepend("http://mobile.flightview.com/");
|
||||
QUrl url = QUrl::fromPercentEncoding(src.toLatin1());
|
||||
const QByteArray encoded
|
||||
= ("http://mobile.flightview.com/" % xml.attributes().value("src")).toLatin1();
|
||||
QUrl url = QUrl::fromPercentEncoding(encoded);
|
||||
mapReplies.append(m_manager.get(QNetworkRequest(url)));
|
||||
}
|
||||
}
|
||||
|
@ -111,14 +111,15 @@ GraphicsScene::GraphicsScene(int x, int y, int width, int height, Mode mode)
|
||||
if (reader.name() == "submarine") {
|
||||
SubmarineDescription desc;
|
||||
desc.name = reader.attributes().value("name").toString();
|
||||
desc.points = reader.attributes().value("points").toString().toInt();
|
||||
desc.type = reader.attributes().value("type").toString().toInt();
|
||||
desc.points = reader.attributes().value("points").toInt();
|
||||
desc.type = reader.attributes().value("type").toInt();
|
||||
submarinesData.append(desc);
|
||||
} else if (reader.name() == "level") {
|
||||
currentLevel.id = reader.attributes().value("id").toString().toInt();
|
||||
currentLevel.id = reader.attributes().value("id").toInt();
|
||||
currentLevel.name = reader.attributes().value("name").toString();
|
||||
} else if (reader.name() == "subinstance") {
|
||||
currentLevel.submarines.append(qMakePair(reader.attributes().value("type").toString().toInt(), reader.attributes().value("nb").toString().toInt()));
|
||||
currentLevel.submarines.append(qMakePair(reader.attributes().value("type").toInt(),
|
||||
reader.attributes().value("nb").toInt()));
|
||||
}
|
||||
} else if (reader.tokenType() == QXmlStreamReader::EndElement) {
|
||||
if (reader.name() == "level") {
|
||||
|
@ -231,9 +231,9 @@ void RSSListing::parseXml()
|
||||
|
||||
} else if (xml.isCharacters() && !xml.isWhitespace()) {
|
||||
if (currentTag == "title")
|
||||
titleString += xml.text().toString();
|
||||
titleString += xml.text();
|
||||
else if (currentTag == "link")
|
||||
linkString += xml.text().toString();
|
||||
linkString += xml.text();
|
||||
}
|
||||
}
|
||||
if (xml.error() && xml.error() != QXmlStreamReader::PrematureEndOfDocumentError) {
|
||||
|
Loading…
Reference in New Issue
Block a user