summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFriedrich W. H. Kossebau <kossebau@kde.org>2016-08-26 01:05:55 (GMT)
committerFriedrich W. H. Kossebau <kossebau@kde.org>2016-08-26 01:05:55 (GMT)
commitb154432d567f9917d4a86159ebddf3abc9378057 (patch)
treebcc781db1f46fcf91b614a408ba254ddef2261bc
parentbf0f04500555c4ad33116a582fb84150cd53c19c (diff)
QString::replace operates on the object itself, no need to reassign to object
-rw-r--r--src/lib/marble/GeoUriParser.cpp2
-rw-r--r--src/lib/marble/MarblePlacemarkModel_P.h4
-rw-r--r--src/lib/marble/MarbleWidgetPopupMenu.cpp12
-rw-r--r--src/lib/marble/geodata/handlers/kml/KmlCoordinatesTagHandler.cpp2
-rw-r--r--tools/iau2kml/iau2kml.cpp4
5 files changed, 12 insertions, 12 deletions
diff --git a/src/lib/marble/GeoUriParser.cpp b/src/lib/marble/GeoUriParser.cpp
index 74678a8..5dd0814 100644
--- a/src/lib/marble/GeoUriParser.cpp
+++ b/src/lib/marble/GeoUriParser.cpp
@@ -105,7 +105,7 @@ bool GeoUriParser::parse()
}
}
if ( m_geoUri.startsWith(QLatin1String("worldwind://goto/")) ) {
- m_geoUri = m_geoUri.replace("goto/", "goto/?");
+ m_geoUri.replace(QStringLiteral("goto/"), QStringLiteral("goto/?"));
QUrl worldwindUrl( m_geoUri );
double lat = queryValue(worldwindUrl, "lat", "latitude").toDouble();
diff --git a/src/lib/marble/MarblePlacemarkModel_P.h b/src/lib/marble/MarblePlacemarkModel_P.h
index c49bb4c..323c7d3 100644
--- a/src/lib/marble/MarblePlacemarkModel_P.h
+++ b/src/lib/marble/MarblePlacemarkModel_P.h
@@ -27,8 +27,8 @@ namespace GeoString
QString result;
result = accentString.normalized( QString::NormalizationForm_D ).remove( combiningDiacriticalMarks );
- result = result.replace(QChar(0x00F8), QLatin1Char('o'));
- result = result.replace(QChar(0x0142), QLatin1Char('l'));
+ result.replace(QChar(0x00F8), QLatin1Char('o'));
+ result.replace(QChar(0x0142), QLatin1Char('l'));
return result;
}
}
diff --git a/src/lib/marble/MarbleWidgetPopupMenu.cpp b/src/lib/marble/MarbleWidgetPopupMenu.cpp
index 42e131f..74ebfac 100644
--- a/src/lib/marble/MarbleWidgetPopupMenu.cpp
+++ b/src/lib/marble/MarbleWidgetPopupMenu.cpp
@@ -191,7 +191,7 @@ void MarbleWidgetPopupMenu::Private::setupDialogOsm( PopupLayer *popup, const Ge
QString description = descriptionFile.readAll();
OsmPlacemarkData data = placemark->osmData();
if (!data.containsTagKey("addr:street") && !data.containsTagKey("addr:housenumber")){
- description = description.replace("<br> %postcode%", "%postcode%");
+ description.replace(QStringLiteral("<br> %postcode%"), QStringLiteral("%postcode%"));
}
TemplateDocument doc(description);
@@ -710,12 +710,12 @@ void MarbleWidgetPopupMenu::slotInfoDialog()
QString content = placemark->style()->balloonStyle().text();
if (content.length() > 0) {
- content = content.replace("$[name]", placemark->name(), Qt::CaseInsensitive);
- content = content.replace("$[description]", placemark->description(), Qt::CaseInsensitive);
- content = content.replace("$[address]", placemark->address(), Qt::CaseInsensitive);
+ content.replace(QStringLiteral("$[name]"), placemark->name(), Qt::CaseInsensitive);
+ content.replace(QStringLiteral("$[description]"), placemark->description(), Qt::CaseInsensitive);
+ content.replace(QStringLiteral("$[address]"), placemark->address(), Qt::CaseInsensitive);
// @TODO: implement the line calculation, so that snippet().maxLines actually has effect.
- content = content.replace("$[snippet]", placemark->snippet().text(), Qt::CaseInsensitive);
- content = content.replace("$[id]", placemark->id(), Qt::CaseInsensitive);
+ content.replace(QStringLiteral("$[snippet]"), placemark->snippet().text(), Qt::CaseInsensitive);
+ content.replace(QStringLiteral("$[id]"), placemark->id(), Qt::CaseInsensitive);
QString const basePath = placemark->resolvePath(".");
QUrl const baseUrl = (basePath != QLatin1String(".")) ? QUrl::fromLocalFile(basePath + QLatin1Char('/')) : QUrl();
popup->setContent(content, baseUrl );
diff --git a/src/lib/marble/geodata/handlers/kml/KmlCoordinatesTagHandler.cpp b/src/lib/marble/geodata/handlers/kml/KmlCoordinatesTagHandler.cpp
index 4115afe..02afe35 100644
--- a/src/lib/marble/geodata/handlers/kml/KmlCoordinatesTagHandler.cpp
+++ b/src/lib/marble/geodata/handlers/kml/KmlCoordinatesTagHandler.cpp
@@ -175,7 +175,7 @@ GeoNode* KmlcoordinatesTagHandler::parse( GeoParser& parser ) const
if( parentItem.represents( kmlTag_Track ) ) {
QString input = parser.readElementText().trimmed();
if ( !kmlStrictSpecs ) {
- input = input.replace(QRegExp(QStringLiteral("\\s*,\\s*")), QStringLiteral(","));
+ input.replace(QRegExp(QStringLiteral("\\s*,\\s*")), QStringLiteral(","));
}
const QStringList coordinates = input.split(QLatin1Char(' '));
diff --git a/tools/iau2kml/iau2kml.cpp b/tools/iau2kml/iau2kml.cpp
index fe93a09..ba8a6fb 100644
--- a/tools/iau2kml/iau2kml.cpp
+++ b/tools/iau2kml/iau2kml.cpp
@@ -94,8 +94,8 @@ int main(int argc, char *argv[])
if ( !rawline.startsWith(QLatin1String( "\"V\"|\"V\"|\"" ) ) ) {
continue;
}
- rawline = rawline.replace( "\"|", "|" );
- rawline = rawline.replace( "|\"", "|" );
+ rawline.replace(QStringLiteral("\"|"), QStringLiteral("|"));
+ rawline.replace(QStringLiteral("|\""), QStringLiteral("|"));
if (rawline.startsWith(QLatin1Char('\"')) && rawline.endsWith(QLatin1Char('\"'))) {
rawline = rawline.left( rawline.length() - 1 );
rawline = rawline.right( rawline.length() - 2 );