summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFriedrich W. H. Kossebau <kossebau@kde.org>2016-08-31 12:40:32 (GMT)
committerFriedrich W. H. Kossebau <kossebau@kde.org>2016-08-31 12:40:32 (GMT)
commita14cab5883010d9e251de26e96cbe079550369fe (patch)
treebc77f50f9c923a88faea9ff82267a8689edbbf0b
parent4901ab6fd295dfa379d4adf24de7c1efd86a139a (diff)
gpx reader: Use QStringLiteral for creating QString objects from raw strings
-rw-r--r--src/plugins/runner/gpx/GpxRunner.cpp2
-rw-r--r--src/plugins/runner/gpx/handlers/GPXgpxTagHandler.cpp20
-rw-r--r--src/plugins/runner/gpx/handlers/GPXhrTagHandler.cpp4
-rw-r--r--src/plugins/runner/gpx/handlers/GPXlinkTagHandler.cpp2
-rw-r--r--src/plugins/runner/gpx/handlers/GPXrteTagHandler.cpp2
-rw-r--r--src/plugins/runner/gpx/handlers/GPXtrkTagHandler.cpp2
-rw-r--r--src/plugins/runner/gpx/handlers/GPXurlTagHandler.cpp2
-rw-r--r--src/plugins/runner/gpx/handlers/GPXurlnameTagHandler.cpp4
-rw-r--r--src/plugins/runner/gpx/handlers/GPXwptTagHandler.cpp4
9 files changed, 21 insertions, 21 deletions
diff --git a/src/plugins/runner/gpx/GpxRunner.cpp b/src/plugins/runner/gpx/GpxRunner.cpp
index bc03b44..3815fde 100644
--- a/src/plugins/runner/gpx/GpxRunner.cpp
+++ b/src/plugins/runner/gpx/GpxRunner.cpp
@@ -31,7 +31,7 @@ GeoDataDocument *GpxRunner::parseFile(const QString &fileName, DocumentRole role
{
QFile file( fileName );
if ( !file.exists() ) {
- error = QString("File %1 does not exist").arg(fileName);
+ error = QStringLiteral("File %1 does not exist").arg(fileName);
mDebug() << error;
return nullptr;
}
diff --git a/src/plugins/runner/gpx/handlers/GPXgpxTagHandler.cpp b/src/plugins/runner/gpx/handlers/GPXgpxTagHandler.cpp
index eb96c69..392456e 100644
--- a/src/plugins/runner/gpx/handlers/GPXgpxTagHandler.cpp
+++ b/src/plugins/runner/gpx/handlers/GPXgpxTagHandler.cpp
@@ -50,11 +50,11 @@ GeoNode* GPXgpxTagHandler::parse(GeoParser& parser) const
lineStyle.setColor( transparentRed );
lineStyle.setWidth( 4 );
style->setLineStyle(lineStyle);
- style->setId("track");
+ style->setId(QStringLiteral("track"));
GeoDataStyleMap styleMap;
- styleMap.setId("map-track");
- styleMap.insert("normal", QLatin1Char('#') + style->id());
+ styleMap.setId(QStringLiteral("map-track"));
+ styleMap.insert(QStringLiteral("normal"), QLatin1Char('#') + style->id());
doc->addStyleMap(styleMap);
doc->addStyle(style);
@@ -66,19 +66,19 @@ GeoNode* GPXgpxTagHandler::parse(GeoParser& parser) const
routeLineStyle.setColor( skyBlue );
routeLineStyle.setWidth( 5 );
routestyle->setLineStyle(routeLineStyle);
- routestyle->setId("route");
+ routestyle->setId(QStringLiteral("route"));
GeoDataStyleMap routeStyleMap;
- routeStyleMap.setId("map-route");
- routeStyleMap.insert("normal", QLatin1Char('#') + routestyle->id());
+ routeStyleMap.setId(QStringLiteral("map-route"));
+ routeStyleMap.insert(QStringLiteral("normal"), QLatin1Char('#') + routestyle->id());
doc->addStyleMap(routeStyleMap);
doc->addStyle(routestyle);
// create a default style for waypoint icons
GeoDataStyle::Ptr waypointStyle(new GeoDataStyle);
- waypointStyle->setId("waypoint");
+ waypointStyle->setId(QStringLiteral("waypoint"));
GeoDataIconStyle iconStyle;
- iconStyle.setIconPath(MarbleDirs::path("bitmaps/flag.png"));
+ iconStyle.setIconPath(MarbleDirs::path(QStringLiteral("bitmaps/flag.png")));
iconStyle.setHotSpot(QPointF(0.12,0.03), GeoDataHotSpot::Fraction, GeoDataHotSpot::Fraction);
waypointStyle->setIconStyle(iconStyle);
@@ -87,8 +87,8 @@ GeoNode* GPXgpxTagHandler::parse(GeoParser& parser) const
waypointStyle->setLabelStyle(waypointLabelStyle);
GeoDataStyleMap waypointStyleMap;
- waypointStyleMap.setId("map-waypoint");
- waypointStyleMap.insert("normal", QLatin1Char('#') + waypointStyle->id());
+ waypointStyleMap.setId(QStringLiteral("map-waypoint"));
+ waypointStyleMap.insert(QStringLiteral("normal"), QLatin1Char('#') + waypointStyle->id());
doc->addStyleMap(waypointStyleMap);
doc->addStyle(waypointStyle);
diff --git a/src/plugins/runner/gpx/handlers/GPXhrTagHandler.cpp b/src/plugins/runner/gpx/handlers/GPXhrTagHandler.cpp
index 27ab530..28d7108 100644
--- a/src/plugins/runner/gpx/handlers/GPXhrTagHandler.cpp
+++ b/src/plugins/runner/gpx/handlers/GPXhrTagHandler.cpp
@@ -34,11 +34,11 @@ GeoNode* GPXhrTagHandler::parse(GeoParser& parser) const
if ( parentItem.is<GeoDataTrack>() )
{
GeoDataSimpleArrayData* arrayData = parentItem.nodeAs<GeoDataTrack>()
- ->extendedData().simpleArrayData( "heartrate" );
+ ->extendedData().simpleArrayData(QStringLiteral("heartrate"));
if (!arrayData) {
arrayData = new GeoDataSimpleArrayData();
QString name = parser.attribute( "name" ).trimmed();
- parentItem.nodeAs<GeoDataTrack>()->extendedData().setSimpleArrayData( "heartrate", arrayData );
+ parentItem.nodeAs<GeoDataTrack>()->extendedData().setSimpleArrayData(QStringLiteral("heartrate"), arrayData);
}
QVariant value( parser.readElementText().toInt() );
arrayData->append( value );
diff --git a/src/plugins/runner/gpx/handlers/GPXlinkTagHandler.cpp b/src/plugins/runner/gpx/handlers/GPXlinkTagHandler.cpp
index 5d917d3..bcc29e6 100644
--- a/src/plugins/runner/gpx/handlers/GPXlinkTagHandler.cpp
+++ b/src/plugins/runner/gpx/handlers/GPXlinkTagHandler.cpp
@@ -47,7 +47,7 @@ GeoNode* GPXlinkTagHandler::parse(GeoParser& parser) const
text = parser.readElementText();
}
- QString link = QString("Link: <a href=\"%1\">%2</a>")
+ const QString link = QStringLiteral("Link: <a href=\"%1\">%2</a>")
.arg(href).arg(text);
QString desc = placemark->description();
diff --git a/src/plugins/runner/gpx/handlers/GPXrteTagHandler.cpp b/src/plugins/runner/gpx/handlers/GPXrteTagHandler.cpp
index 0e326a2..5ab5c89 100644
--- a/src/plugins/runner/gpx/handlers/GPXrteTagHandler.cpp
+++ b/src/plugins/runner/gpx/handlers/GPXrteTagHandler.cpp
@@ -48,7 +48,7 @@ GeoNode* GPXrteTagHandler::parse(GeoParser& parser) const
doc->append(placemark);
GeoDataLineString *linestring = new GeoDataLineString;
placemark->setGeometry(linestring);
- placemark->setStyleUrl("#map-route");
+ placemark->setStyleUrl(QStringLiteral("#map-route"));
return placemark;
}
diff --git a/src/plugins/runner/gpx/handlers/GPXtrkTagHandler.cpp b/src/plugins/runner/gpx/handlers/GPXtrkTagHandler.cpp
index a771e8d..85718e1 100644
--- a/src/plugins/runner/gpx/handlers/GPXtrkTagHandler.cpp
+++ b/src/plugins/runner/gpx/handlers/GPXtrkTagHandler.cpp
@@ -45,7 +45,7 @@ GeoNode* GPXtrkTagHandler::parse(GeoParser& parser) const
doc->append(placemark);
GeoDataMultiGeometry *multigeometry = new GeoDataMultiGeometry;
placemark->setGeometry(multigeometry);
- placemark->setStyleUrl("#map-track");
+ placemark->setStyleUrl(QStringLiteral("#map-track"));
return placemark;
}
diff --git a/src/plugins/runner/gpx/handlers/GPXurlTagHandler.cpp b/src/plugins/runner/gpx/handlers/GPXurlTagHandler.cpp
index 7ca34d9..1388177 100644
--- a/src/plugins/runner/gpx/handlers/GPXurlTagHandler.cpp
+++ b/src/plugins/runner/gpx/handlers/GPXurlTagHandler.cpp
@@ -42,7 +42,7 @@ GeoNode* GPXurlTagHandler::parse(GeoParser& parser) const
QString url = parser.readElementText().trimmed();
GeoDataExtendedData extendedData = placemark->extendedData();
- extendedData.addValue(GeoDataData("url", url));
+ extendedData.addValue(GeoDataData(QStringLiteral("url"), url));
placemark->setExtendedData(extendedData);
}
diff --git a/src/plugins/runner/gpx/handlers/GPXurlnameTagHandler.cpp b/src/plugins/runner/gpx/handlers/GPXurlnameTagHandler.cpp
index 590e63f..1b38387 100644
--- a/src/plugins/runner/gpx/handlers/GPXurlnameTagHandler.cpp
+++ b/src/plugins/runner/gpx/handlers/GPXurlnameTagHandler.cpp
@@ -40,8 +40,8 @@ GeoNode* GPXurlnameTagHandler::parse(GeoParser& parser) const
// extendedData.addValue(GeoDataData("urlname", text));
// placemark->setExtendedData(extendedData);
- QString link = QString("<br/>Link: <a href=\"%1\">%2</a>")
- .arg(placemark->extendedData().value("url").value().toString())
+ const QString link = QStringLiteral("<br/>Link: <a href=\"%1\">%2</a>")
+ .arg(placemark->extendedData().value(QStringLiteral("url")).value().toString())
.arg(text);
placemark->setDescription(placemark->description().append(link));
placemark->setDescriptionCDATA(true);
diff --git a/src/plugins/runner/gpx/handlers/GPXwptTagHandler.cpp b/src/plugins/runner/gpx/handlers/GPXwptTagHandler.cpp
index 09f7546..e04cada 100644
--- a/src/plugins/runner/gpx/handlers/GPXwptTagHandler.cpp
+++ b/src/plugins/runner/gpx/handlers/GPXwptTagHandler.cpp
@@ -58,9 +58,9 @@ GeoNode* GPXwptTagHandler::parse(GeoParser& parser) const
lon = tmp.toString().toFloat();
}
placemark->setCoordinate( lon, lat, 0, GeoDataCoordinates::Degree );
- placemark->setRole("Waypoint");
+ placemark->setRole(QStringLiteral("Waypoint"));
- placemark->setStyle(doc->style("waypoint"));
+ placemark->setStyle(doc->style(QStringLiteral("waypoint")));
doc->append(placemark);
return placemark;