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

QString::replace operates on the object itself, no need to reassign to object

parent bf0f0450
......@@ -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();
......
......@@ -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;
}
}
......
......@@ -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 );
......
......@@ -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(' '));
......
......@@ -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 );
......
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