Commit 9c43b440 authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Use QStringLiteral with more namedItem(QString) methods

parent 5afd12d1
......@@ -1161,7 +1161,7 @@ void MarblePart::repairNode( QDomNode node, const QString &child )
{
int const size = node.namedItem( child ).toElement().text().size();
if ( size > 1024 ) {
QString const theme = node.namedItem( "name" ).toElement().text();
QString const theme = node.namedItem(QStringLiteral("name")).toElement().text();
mDebug() << "Removing GHNS field " << child << " of map theme " << theme << ": Size " << size << " exceeds maximum size (see bug 319542).";
node.removeChild( node.namedItem( child ) );
}
......
......@@ -466,7 +466,7 @@ void NewstuffModelPrivate::readValue( const QDomNode &node, const QString &key,
} else {
for ( int i=0; i<matches.size(); ++i ) {
if ( matches.at( i ).attributes().contains(QStringLiteral("lang")) &&
matches.at( i ).attributes().namedItem( "lang").toAttr().value() == QLatin1String("en")) {
matches.at( i ).attributes().namedItem(QStringLiteral("lang")).toAttr().value() == QLatin1String("en")) {
*target = T(matches.at( i ).toElement().text());
return;
}
......@@ -931,7 +931,7 @@ void NewstuffModelPrivate::processQueue()
NewstuffItem NewstuffModelPrivate::importNode(const QDomNode &node)
{
NewstuffItem item;
item.m_category = node.attributes().namedItem( "category" ).toAttr().value();
item.m_category = node.attributes().namedItem(QStringLiteral("category")).toAttr().value();
readValue<QString>( node, "name", &item.m_name );
readValue<QString>( node, "author", &item.m_author );
readValue<QString>( node, "licence", &item.m_license );
......
......@@ -219,8 +219,8 @@ GeoDataDocument* MapQuestRunner::parse( const QByteArray &content ) const
if ( shapePoints.size() == 1 ) {
QDomNodeList geometry = shapePoints.at( 0 ).toElement().elementsByTagName( "latLng" );
for ( int i=0; i<geometry.size(); ++i ) {
double const lat = geometry.item( i ).namedItem( "lat" ).toElement().text().toDouble();
double const lon = geometry.item( i ).namedItem( "lng" ).toElement().text().toDouble();
double const lat = geometry.item(i).namedItem(QStringLiteral("lat")).toElement().text().toDouble();
double const lon = geometry.item(i).namedItem(QStringLiteral("lng")).toElement().text().toDouble();
GeoDataCoordinates const position( lon, lat, 0.0, GeoDataCoordinates::Degree );
routeWaypoints->append( position );
}
......
......@@ -116,11 +116,11 @@ void OsmNominatimRunner::handleResult( QNetworkReply* reply )
for (int i=0; i<places.size(); ++i) {
QDomNode place = places.at(i);
QDomNamedNodeMap attributes = place.attributes();
QString lon = attributes.namedItem("lon").nodeValue();
QString lat = attributes.namedItem("lat").nodeValue();
QString desc = attributes.namedItem("display_name").nodeValue();
QString key = attributes.namedItem("class").nodeValue();
QString value = attributes.namedItem("type").nodeValue();
QString lon = attributes.namedItem(QStringLiteral("lon")).nodeValue();
QString lat = attributes.namedItem(QStringLiteral("lat")).nodeValue();
QString desc = attributes.namedItem(QStringLiteral("display_name")).nodeValue();
QString key = attributes.namedItem(QStringLiteral("class")).nodeValue();
QString value = attributes.namedItem(QStringLiteral("type")).nodeValue();
OsmPlacemarkData data;
......
......@@ -215,7 +215,7 @@ GeoDataDocument* OpenRouteServiceRunner::parse( const QByteArray &content ) cons
for (int i=0 ; i < errors.length(); ++i ) {
QDomNode node = errors.item( i );
QString errorMessage = node.attributes().namedItem( "message" ).nodeValue();
QString errorMessage = node.attributes().namedItem(QStringLiteral("message")).nodeValue();
QRegExp regexp = QRegExp( "^(.*) Please Check your Position: (-?[0-9]+.[0-9]+) (-?[0-9]+.[0-9]+) !" );
if ( regexp.indexIn( errorMessage ) == 0 ) {
if ( regexp.capturedTexts().size() == 4 ) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment