summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFriedrich W. H. Kossebau <kossebau@kde.org>2016-09-02 15:30:06 (GMT)
committerFriedrich W. H. Kossebau <kossebau@kde.org>2016-09-02 15:30:06 (GMT)
commit9c43b4403851b16829ce32533f9aa4be7ae99438 (patch)
tree3a948c923ed61088328cef897ce511c3134c693e
parent5afd12d10b9b4d6ad9c279346429814f64b9eb32 (diff)
Use QStringLiteral with more namedItem(QString) methods
-rw-r--r--src/apps/marble-kde/marble_part.cpp2
-rw-r--r--src/lib/marble/NewstuffModel.cpp4
-rw-r--r--src/plugins/runner/mapquest/MapQuestRunner.cpp4
-rw-r--r--src/plugins/runner/nominatim-search/OsmNominatimSearchRunner.cpp10
-rw-r--r--src/plugins/runner/openrouteservice/OpenRouteServiceRunner.cpp2
5 files changed, 11 insertions, 11 deletions
diff --git a/src/apps/marble-kde/marble_part.cpp b/src/apps/marble-kde/marble_part.cpp
index fead748..755c836 100644
--- a/src/apps/marble-kde/marble_part.cpp
+++ b/src/apps/marble-kde/marble_part.cpp
@@ -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 ) );
}
diff --git a/src/lib/marble/NewstuffModel.cpp b/src/lib/marble/NewstuffModel.cpp
index 59736eb..74d20ed 100644
--- a/src/lib/marble/NewstuffModel.cpp
+++ b/src/lib/marble/NewstuffModel.cpp
@@ -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 );
diff --git a/src/plugins/runner/mapquest/MapQuestRunner.cpp b/src/plugins/runner/mapquest/MapQuestRunner.cpp
index cf4f751..df7621d 100644
--- a/src/plugins/runner/mapquest/MapQuestRunner.cpp
+++ b/src/plugins/runner/mapquest/MapQuestRunner.cpp
@@ -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 );
}
diff --git a/src/plugins/runner/nominatim-search/OsmNominatimSearchRunner.cpp b/src/plugins/runner/nominatim-search/OsmNominatimSearchRunner.cpp
index 3f89c7f..4a84080 100644
--- a/src/plugins/runner/nominatim-search/OsmNominatimSearchRunner.cpp
+++ b/src/plugins/runner/nominatim-search/OsmNominatimSearchRunner.cpp
@@ -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;
diff --git a/src/plugins/runner/openrouteservice/OpenRouteServiceRunner.cpp b/src/plugins/runner/openrouteservice/OpenRouteServiceRunner.cpp
index 068a383..fe38de1 100644
--- a/src/plugins/runner/openrouteservice/OpenRouteServiceRunner.cpp
+++ b/src/plugins/runner/openrouteservice/OpenRouteServiceRunner.cpp
@@ -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 ) {