summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFriedrich W. H. Kossebau <kossebau@kde.org>2016-09-02 15:25:50 (GMT)
committerFriedrich W. H. Kossebau <kossebau@kde.org>2016-09-02 15:25:50 (GMT)
commit5afd12d10b9b4d6ad9c279346429814f64b9eb32 (patch)
tree9fe2dfe892bd0b0b92076b24df9ef67285a20d66
parent5ab8e573f1d5613437d62aa63efa294529900df2 (diff)
Use QStringLiteral with more contains(QString) methods
-rw-r--r--src/lib/marble/NewstuffModel.cpp2
-rw-r--r--src/lib/marble/layers/GeometryLayer.cpp2
-rw-r--r--src/lib/marble/routing/AlternativeRoutesModel.cpp2
-rw-r--r--src/lib/marble/routing/RouteRequest.cpp2
-rw-r--r--src/lib/marble/routing/RoutingInputWidget.cpp5
-rw-r--r--src/lib/marble/routing/RoutingManager.cpp4
-rw-r--r--src/lib/marble/routing/instructions/RoutingInstruction.cpp9
7 files changed, 13 insertions, 13 deletions
diff --git a/src/lib/marble/NewstuffModel.cpp b/src/lib/marble/NewstuffModel.cpp
index f08efdf..59736eb 100644
--- a/src/lib/marble/NewstuffModel.cpp
+++ b/src/lib/marble/NewstuffModel.cpp
@@ -465,7 +465,7 @@ void NewstuffModelPrivate::readValue( const QDomNode &node, const QString &key,
*target = T(matches.at( 0 ).toElement().text());
} else {
for ( int i=0; i<matches.size(); ++i ) {
- if ( matches.at( i ).attributes().contains( "lang" ) &&
+ if ( matches.at( i ).attributes().contains(QStringLiteral("lang")) &&
matches.at( i ).attributes().namedItem( "lang").toAttr().value() == QLatin1String("en")) {
*target = T(matches.at( i ).toElement().text());
return;
diff --git a/src/lib/marble/layers/GeometryLayer.cpp b/src/lib/marble/layers/GeometryLayer.cpp
index b11ab1d..feedca9 100644
--- a/src/lib/marble/layers/GeometryLayer.cpp
+++ b/src/lib/marble/layers/GeometryLayer.cpp
@@ -469,7 +469,7 @@ void GeometryLayer::handleHighlight( qreal lon, qreal lat, GeoDataCoordinates::U
bool isHighlight = false;
foreach ( const GeoDataStyleMap &styleMap, doc->styleMaps() ) {
- if ( styleMap.contains( QString("highlight") ) ) {
+ if (styleMap.contains(QStringLiteral("highlight"))) {
isHighlight = true;
break;
}
diff --git a/src/lib/marble/routing/AlternativeRoutesModel.cpp b/src/lib/marble/routing/AlternativeRoutesModel.cpp
index 4d05f25..145e70a 100644
--- a/src/lib/marble/routing/AlternativeRoutesModel.cpp
+++ b/src/lib/marble/routing/AlternativeRoutesModel.cpp
@@ -260,7 +260,7 @@ qreal AlternativeRoutesModel::Private::instructionScore( const GeoDataDocument*
if ( !blacklist.contains( placemark->name() ) ) {
hasInstructions = true;
- if ( placemark->extendedData().contains( "turnType" ) ) {
+ if (placemark->extendedData().contains(QStringLiteral("turnType"))) {
return 1.0;
}
}
diff --git a/src/lib/marble/routing/RouteRequest.cpp b/src/lib/marble/routing/RouteRequest.cpp
index 35df8a8..de2c85f 100644
--- a/src/lib/marble/routing/RouteRequest.cpp
+++ b/src/lib/marble/routing/RouteRequest.cpp
@@ -317,7 +317,7 @@ bool RouteRequest::visited( int index ) const
{
bool visited = false;
if ( index >= 0 && index < d->m_route.size() ) {
- if ( d->m_route[index].extendedData().contains( "routingVisited" ) ) {
+ if (d->m_route[index].extendedData().contains(QStringLiteral("routingVisited"))) {
visited = d->m_route[index].extendedData().value(QStringLiteral("routingVisited")).value().toBool();
}
}
diff --git a/src/lib/marble/routing/RoutingInputWidget.cpp b/src/lib/marble/routing/RoutingInputWidget.cpp
index 1bd3b98..05977d9 100644
--- a/src/lib/marble/routing/RoutingInputWidget.cpp
+++ b/src/lib/marble/routing/RoutingInputWidget.cpp
@@ -108,12 +108,11 @@ void RoutingInputWidgetPrivate::updateDescription()
{
GeoDataPlacemark const placemark = (*m_route)[m_index];
GeoDataExtendedData const address = placemark.extendedData();
- if ( address.contains( "road" ) && address.contains( "city" ) )
- {
+ if (address.contains(QStringLiteral("road")) && address.contains(QStringLiteral("city"))) {
QString const road = address.value(QStringLiteral("road")).value().toString();
QString const city = address.value(QStringLiteral("city")).value().toString();
- if ( address.contains( "house_number" ) ) {
+ if (address.contains(QStringLiteral("house_number"))) {
QString const houseNumber = address.value(QStringLiteral("house_number")).value().toString();
QString const name = QObject::tr("%1 %2, %3", "An address with parameters %1=house number, %2=road, %3=city");
m_lineEdit->setText( name.arg( houseNumber ).arg( road ).arg( city ) );
diff --git a/src/lib/marble/routing/RoutingManager.cpp b/src/lib/marble/routing/RoutingManager.cpp
index b7226fa..6415478 100644
--- a/src/lib/marble/routing/RoutingManager.cpp
+++ b/src/lib/marble/routing/RoutingManager.cpp
@@ -408,7 +408,7 @@ void RoutingManagerPrivate::importPlacemark( RouteSegment &outline, QVector<Rout
maneuver.setInstructionText( placemark->name() );
maneuver.setPosition( lineString->at( 0 ) );
- if ( placemark->extendedData().contains( "turnType" ) ) {
+ if (placemark->extendedData().contains(QStringLiteral("turnType"))) {
QVariant turnType = placemark->extendedData().value(QStringLiteral("turnType")).value();
// The enum value is converted to/from an int in the QVariant
// because only a limited set of data types can be serialized with QVariant's
@@ -416,7 +416,7 @@ void RoutingManagerPrivate::importPlacemark( RouteSegment &outline, QVector<Rout
maneuver.setDirection( Maneuver::Direction( turnType.toInt() ) );
}
- if ( placemark->extendedData().contains( "roadName" ) ) {
+ if (placemark->extendedData().contains(QStringLiteral("roadName"))) {
QVariant roadName = placemark->extendedData().value(QStringLiteral("roadName")).value();
maneuver.setRoadName( roadName.toString() );
}
diff --git a/src/lib/marble/routing/instructions/RoutingInstruction.cpp b/src/lib/marble/routing/instructions/RoutingInstruction.cpp
index ef56130..8602c08 100644
--- a/src/lib/marble/routing/instructions/RoutingInstruction.cpp
+++ b/src/lib/marble/routing/instructions/RoutingInstruction.cpp
@@ -353,7 +353,7 @@ QString RoutingInstruction::instructionText() const
{
QString text = nextRoadInstruction();
text += QLatin1Char(' ') + nextDistanceInstruction();
- if ( QCoreApplication::instance()->arguments().contains( "--remaining-duration" ) ) {
+ if (QCoreApplication::instance()->arguments().contains(QStringLiteral("--remaining-duration"))) {
text += QLatin1Char(' ') + totalDurationRemaining();
}
return text;
@@ -470,7 +470,7 @@ QTextStream& operator<<( QTextStream& stream, const RoutingInstruction &i )
return stream;
}
- if ( QCoreApplication::instance()->arguments().contains( "--dense" ) ) {
+ if (QCoreApplication::instance()->arguments().contains(QStringLiteral("--dense"))) {
QVector<RoutingWaypoint> points = i.points();
int maxElement = points.size() - ( i.successor() ? 1 : 0 );
for ( int j = 0; j < maxElement; ++j ) {
@@ -490,7 +490,7 @@ QTextStream& operator<<( QTextStream& stream, const RoutingInstruction &i )
return stream;
}
- if ( QCoreApplication::instance()->arguments().contains( "--csv" ) ) {
+ if (QCoreApplication::instance()->arguments().contains(QStringLiteral("--csv"))) {
stream << i.points().first().point().lat() << ',';
stream << i.points().first().point().lon() << ',';
} else {
@@ -509,7 +509,8 @@ QTextStream& operator<<( QTextStream& stream, const RoutingInstruction &i )
stream << i.instructionText();
- if ( QCoreApplication::instance()->arguments().contains( "--csv" ) && QCoreApplication::instance()->arguments().contains( "--intersection-points" ) ) {
+ if (QCoreApplication::instance()->arguments().contains(QStringLiteral("--csv")) &&
+ QCoreApplication::instance()->arguments().contains(QStringLiteral("--intersection-points"))) {
foreach( const RoutingPoint &point, i.intersectionPoints() ) {
stream << ',' << point.lat() << ',' << point.lon();
}