summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFriedrich W. H. Kossebau <kossebau@kde.org>2016-08-25 14:18:43 (GMT)
committerFriedrich W. H. Kossebau <kossebau@kde.org>2016-08-25 14:18:43 (GMT)
commit676288ab8749a2966eb3d487ec76ce58ff8b6f2d (patch)
tree23ea0b5bacf49fb7d0bd156992213b649e920ec4
parent598dc83ea6c51ad172088e150c7bfd538aedcb9e (diff)
Use QLatin1Char with simple chars
-rw-r--r--examples/cpp/marble-game/gamemain.cpp2
-rw-r--r--src/apps/marble-qt/qtmain.cpp2
-rw-r--r--src/lib/marble/AbstractDataPluginModel.cpp2
-rw-r--r--src/lib/marble/DiscCache.cpp2
-rw-r--r--src/lib/marble/FileStorageWatcher.cpp4
-rw-r--r--src/lib/marble/GeoGraphicsScene.cpp4
-rw-r--r--src/lib/marble/MapThemeManager.cpp6
-rw-r--r--src/lib/marble/MapViewWidget.cpp4
-rw-r--r--src/lib/marble/MapWizard.cpp6
-rw-r--r--src/lib/marble/MarbleAbstractPresenter.cpp2
-rw-r--r--src/lib/marble/MarbleLegendBrowser.cpp2
-rw-r--r--src/lib/marble/MarbleLocale.cpp4
-rw-r--r--src/lib/marble/MarblePlacemarkModel_P.h4
-rw-r--r--src/lib/marble/MarbleWidgetPopupMenu.cpp2
-rw-r--r--src/lib/marble/MergedLayerDecorator.cpp4
-rw-r--r--src/lib/marble/NewstuffModel.cpp6
-rw-r--r--src/lib/marble/PlacemarkEditHeader.cpp2
-rw-r--r--src/lib/marble/ServerLayout.cpp4
-rw-r--r--src/lib/marble/TextureColorizer.cpp6
-rw-r--r--src/lib/marble/TileCreator.cpp50
-rw-r--r--src/lib/marble/TileLoader.cpp4
-rw-r--r--src/lib/marble/TourItemDelegate.cpp2
-rw-r--r--src/lib/marble/TourWidget.cpp10
-rw-r--r--src/lib/marble/cloudsync/BookmarkSyncManager.cpp2
-rw-r--r--src/lib/marble/cloudsync/OwncloudSyncBackend.cpp2
-rw-r--r--src/lib/marble/cloudsync/RouteSyncManager.cpp4
-rw-r--r--src/lib/marble/declarative/OfflineDataModel.cpp4
-rw-r--r--src/lib/marble/declarative/Placemark.cpp2
-rw-r--r--src/lib/marble/geodata/data/GeoDataCoordinates.cpp32
-rw-r--r--src/lib/marble/geodata/data/GeoDataFeature.cpp4
-rw-r--r--src/lib/marble/geodata/handlers/dgml/DgmlBrushTagHandler.cpp2
-rw-r--r--src/lib/marble/geodata/handlers/kml/KmlRoleTagHandler.cpp2
-rw-r--r--src/lib/marble/geodata/scene/GeoSceneTileDataset.cpp6
-rw-r--r--src/lib/marble/geodata/writers/dgml/DgmlTextureTagWriter.cpp2
-rw-r--r--src/lib/marble/geodata/writers/kml/KmlColorStyleTagWriter.cpp2
-rw-r--r--src/lib/marble/geodata/writers/kml/KmlListStyleTagWriter.cpp2
-rw-r--r--src/lib/marble/layers/FpsLayer.cpp2
-rw-r--r--src/lib/marble/osm/OsmRelationManagerWidget.cpp2
-rw-r--r--src/lib/marble/osm/OsmTagEditorWidget_p.cpp4
-rw-r--r--src/lib/marble/routing/instructions/RoutingInstruction.cpp2
-rw-r--r--src/lib/marble/routing/instructions/WaypointParser.cpp4
-rw-r--r--src/plugins/positionprovider/flightgear/FlightGearPositionProviderPlugin.cpp10
-rw-r--r--src/plugins/render/aprs/AprsGatherer.cpp2
-rw-r--r--src/plugins/render/measure/MeasureToolPlugin.cpp2
-rw-r--r--src/plugins/render/opencachingcom/OpenCachingComItem.cpp4
-rw-r--r--src/plugins/render/panoramio/PanoramioParser.cpp2
-rw-r--r--src/plugins/render/photo/PhotoPlugin.cpp4
-rw-r--r--src/plugins/render/satellites/SatellitesModel.cpp2
-rw-r--r--src/plugins/render/stars/StarsPlugin.cpp12
-rw-r--r--src/plugins/render/stars/StarsPlugin.h2
-rw-r--r--src/plugins/render/weather/StationListParser.cpp2
-rw-r--r--src/plugins/render/weather/WeatherPlugin.cpp2
-rw-r--r--src/plugins/runner/cyclestreets/CycleStreetsRunner.cpp12
-rw-r--r--src/plugins/runner/gosmore-reversegeocoding/GosmoreReverseGeocodingRunner.cpp6
-rw-r--r--src/plugins/runner/gosmore-routing/GosmoreRoutingRunner.cpp10
-rw-r--r--src/plugins/runner/hostip/HostipRunner.cpp2
-rw-r--r--src/plugins/runner/local-osm-search/OsmDatabase.cpp2
-rw-r--r--src/plugins/runner/log/LogRunner.cpp2
-rw-r--r--src/plugins/runner/monav/MonavConfigWidget.cpp4
-rw-r--r--src/plugins/runner/monav/MonavMapsModel.cpp2
-rw-r--r--src/plugins/runner/nominatim-search/OsmNominatimSearchRunner.cpp6
-rw-r--r--src/plugins/runner/openlocation-code-search/OpenLocationCodeSearchRunner.cpp4
-rw-r--r--src/plugins/runner/openrouteservice/OpenRouteServiceRunner.cpp8
-rw-r--r--src/plugins/runner/routino/RoutinoRunner.cpp6
-rw-r--r--src/plugins/runner/traveling-salesman/TravelingSalesmanRunner.cpp2
-rw-r--r--tools/asc2kml/asc2kml.cpp16
-rw-r--r--tools/constellations2kml/constellations2kml.cpp4
-rw-r--r--tools/dateline/dateline.cpp5
-rw-r--r--tools/dso2kml/dso2kml.cpp2
-rw-r--r--tools/iau2kml/iau2kml.cpp16
-rw-r--r--tools/mbtile-import/mbtile-import.cpp4
-rw-r--r--tools/osm-addresses/OsmParser.cpp4
-rw-r--r--tools/osm-simplify/TagsFilter.cpp2
-rw-r--r--tools/osm-simplify/main.cpp2
-rw-r--r--tools/osm-sisyphus/jobmanager.cpp2
-rw-r--r--tools/pntreplace/svgxmlhandler.cpp6
-rw-r--r--tools/routing-instructions/main.cpp10
-rw-r--r--tools/sentineltile/tileprocessor.cpp6
-rw-r--r--tools/svg2pnt/svgxmlhandler.cpp6
-rw-r--r--tools/tilecreator-srtm2/tccore.cpp4
80 files changed, 206 insertions, 207 deletions
diff --git a/examples/cpp/marble-game/gamemain.cpp b/examples/cpp/marble-game/gamemain.cpp
index 9455ac8..3fc653b 100644
--- a/examples/cpp/marble-game/gamemain.cpp
+++ b/examples/cpp/marble-game/gamemain.cpp
@@ -33,7 +33,7 @@ int main(int argc, char *argv[])
app.setOrganizationDomain( "kde.org" );
// Widget translation
- QString lang = QLocale::system().name().section('_', 0, 0);
+ QString lang = QLocale::system().name().section(QLatin1Char('_'), 0, 0);
QTranslator translator;
translator.load(QLatin1String("marble-") + lang, MarbleDirs::path(QStringLiteral("lang")));
app.installTranslator(&translator);
diff --git a/src/apps/marble-qt/qtmain.cpp b/src/apps/marble-qt/qtmain.cpp
index ba84cf0..47d05e5 100644
--- a/src/apps/marble-qt/qtmain.cpp
+++ b/src/apps/marble-qt/qtmain.cpp
@@ -46,7 +46,7 @@ int main(int argc, char *argv[])
app.setOrganizationDomain( "kde.org" );
// Widget translation
- QString lang = QLocale::system().name().section('_', 0, 0);
+ QString lang = QLocale::system().name().section(QLatin1Char('_'), 0, 0);
QTranslator translator;
translator.load(QLatin1String("marble-") + lang, MarbleDirs::path(QStringLiteral("lang")));
app.installTranslator(&translator);
diff --git a/src/lib/marble/AbstractDataPluginModel.cpp b/src/lib/marble/AbstractDataPluginModel.cpp
index d9b75b3..315dee0 100644
--- a/src/lib/marble/AbstractDataPluginModel.cpp
+++ b/src/lib/marble/AbstractDataPluginModel.cpp
@@ -49,7 +49,7 @@ const int timeBetweenDownloads = 1500;
const qreal boxComparisonFactor = 16.0;
// Separator to separate the id of the item from the file type
-const char fileIdSeparator = '_';
+const QChar fileIdSeparator = QLatin1Char('_');
class FavoritesModel;
diff --git a/src/lib/marble/DiscCache.cpp b/src/lib/marble/DiscCache.cpp
index f011078..e7e90a1 100644
--- a/src/lib/marble/DiscCache.cpp
+++ b/src/lib/marble/DiscCache.cpp
@@ -167,7 +167,7 @@ void DiscCache::setCacheLimit( quint64 n )
QString DiscCache::keyToFileName( const QString &key ) const
{
QString fileName( key );
- fileName.replace( '/', '_' );
+ fileName.replace(QLatin1Char('/'), QLatin1Char('_'));
return m_CacheDirectory + QLatin1Char('/') + fileName;
}
diff --git a/src/lib/marble/FileStorageWatcher.cpp b/src/lib/marble/FileStorageWatcher.cpp
index 0bd7222..c814655 100644
--- a/src/lib/marble/FileStorageWatcher.cpp
+++ b/src/lib/marble/FileStorageWatcher.cpp
@@ -95,7 +95,7 @@ void FileStorageWatcherThread::getCurrentCacheSize()
QDir::Files | QDir::Writable,
QDirIterator::Subdirectories );
- int basePathDepth = basePath.split('/').size();
+ const int basePathDepth = basePath.split(QLatin1Char('/')).size();
while( it.hasNext() && !m_willQuit ) {
it.next();
QFileInfo file = it.fileInfo();
@@ -103,7 +103,7 @@ void FileStorageWatcherThread::getCurrentCacheSize()
// FIXME, when vectortiling I suppose also vector tiles will have
// to be deleted
QString suffix = file.suffix().toLower();
- QStringList path = file.path().split('/');
+ const QStringList path = file.path().split(QLatin1Char('/'));
// planet/theme/tilelevel should be deeper than 4
if ( ( path.size() > basePathDepth + 3 ) &&
diff --git a/src/lib/marble/GeoGraphicsScene.cpp b/src/lib/marble/GeoGraphicsScene.cpp
index 9d850e9..a245c7a 100644
--- a/src/lib/marble/GeoGraphicsScene.cpp
+++ b/src/lib/marble/GeoGraphicsScene.cpp
@@ -61,7 +61,7 @@ GeoDataStyle::Ptr GeoGraphicsScenePrivate::highlightStyle( const GeoDataDocument
{
// @todo Consider QUrl parsing when external styles are suppported
QString highlightStyleId = styleMap.value("highlight");
- highlightStyleId.remove('#');
+ highlightStyleId.remove(QLatin1Char('#'));
if ( !highlightStyleId.isEmpty() ) {
GeoDataStyle::Ptr highlightStyle(new GeoDataStyle( *document->style(highlightStyleId) ));
return highlightStyle;
@@ -189,7 +189,7 @@ void GeoGraphicsScene::applyHighlight( const QVector< GeoDataPlacemark* > &selec
if ( parent->nodeType() == GeoDataTypes::GeoDataDocumentType ) {
GeoDataDocument *doc = static_cast<GeoDataDocument*>( parent );
QString styleUrl = placemark->styleUrl();
- styleUrl.remove('#');
+ styleUrl.remove(QLatin1Char('#'));
if ( !styleUrl.isEmpty() ) {
GeoDataStyleMap const &styleMap = doc->styleMap( styleUrl );
GeoDataStyle::Ptr style = d->highlightStyle( doc, styleMap );
diff --git a/src/lib/marble/MapThemeManager.cpp b/src/lib/marble/MapThemeManager.cpp
index ae96d0c..512abb6 100644
--- a/src/lib/marble/MapThemeManager.cpp
+++ b/src/lib/marble/MapThemeManager.cpp
@@ -295,7 +295,7 @@ QStringList MapThemeManager::Private::findMapThemes( const QString& basePath )
QStringListIterator it( mapDirs );
while ( it.hasNext() ) {
QString themeDir = it.next() + QLatin1Char('/');
- QString themeDirName = QDir( themeDir ).path().section( '/', -2, -1 );
+ QString themeDirName = QDir(themeDir).path().section(QLatin1Char('/'), -2, -1);
QStringList tmp = QDir( themeDir ).entryList( QStringList( "*.dgml" ),
QDir::Files | QDir::NoSymLinks );
if ( !tmp.isEmpty() ) {
@@ -419,7 +419,7 @@ void MapThemeManager::Private::updateMapThemeModel()
}
foreach ( const QString &mapThemeId, stringlist ) {
- QString celestialBodyId = mapThemeId.section( '/', 0, 0 );
+ const QString celestialBodyId = mapThemeId.section(QLatin1Char('/'), 0, 0);
QString celestialBodyName = PlanetFactory::localizedName( celestialBodyId );
QList<QStandardItem*> matchingItems = m_celestialList.findItems( celestialBodyId, Qt::MatchExactly, 1 );
@@ -464,7 +464,7 @@ void MapThemeManager::Private::fileChanged( const QString& path )
// 2. if the file exists it is changed and we have to replace
// the item with a new one.
- QString mapThemeId = path.section( '/', -3 );
+ const QString mapThemeId = path.section(QLatin1Char('/'), -3);
mDebug() << "mapThemeId:" << mapThemeId;
QList<QStandardItem *> matchingItems = m_mapThemeModel.findItems( mapThemeId,
Qt::MatchFixedString
diff --git a/src/lib/marble/MapViewWidget.cpp b/src/lib/marble/MapViewWidget.cpp
index d8a81e6..10503b0 100644
--- a/src/lib/marble/MapViewWidget.cpp
+++ b/src/lib/marble/MapViewWidget.cpp
@@ -381,8 +381,8 @@ void MapViewWidget::setMapThemeId( const QString &themeId )
if ( themeId == oldThemeId )
return;
- const QString oldCelestialBodyId = oldThemeId.section( '/', 0, 0 );
- const QString celestialBodyId = themeId.section( '/', 0, 0 );
+ const QString oldCelestialBodyId = oldThemeId.section(QLatin1Char('/'), 0, 0);
+ const QString celestialBodyId = themeId.section(QLatin1Char('/'), 0, 0);
// select celestialBodyId in GUI
if ( celestialBodyId != oldCelestialBodyId ) {
diff --git a/src/lib/marble/MapWizard.cpp b/src/lib/marble/MapWizard.cpp
index a03a171..af7dbdc 100644
--- a/src/lib/marble/MapWizard.cpp
+++ b/src/lib/marble/MapWizard.cpp
@@ -274,7 +274,7 @@ void MapWizard::parseServerCapabilities( QNetworkReply* reply )
QDomElement format = xml.documentElement().firstChildElement( "Capability" ).firstChildElement( "Request" )
.firstChildElement( "GetMap" ).firstChildElement( "Format" );
- d->format = format.text().right( format.text().length() - format.text().indexOf( '/' ) - 1 ).toLower();
+ d->format = format.text().right(format.text().length() - format.text().indexOf(QLatin1Char('/')) - 1).toLower();
if (d->format == QLatin1String("jpeg")) {
d->format = "jpg";
@@ -349,7 +349,7 @@ bool MapWizard::createFiles( const GeoSceneDocument* document )
{
// Source image
QFile sourceImage( d->sourceImage );
- d->format = d->sourceImage.right( d->sourceImage.length() - d->sourceImage.lastIndexOf( '.' ) - 1 ).toLower();
+ d->format = d->sourceImage.right(d->sourceImage.length() - d->sourceImage.lastIndexOf(QLatin1Char('.')) - 1).toLower();
sourceImage.copy( QString( "%1/%2/%2.%3" ).arg( maps.absolutePath() )
.arg( document->head()->theme() )
.arg( d->format ) );
@@ -809,7 +809,7 @@ GeoSceneDocument* MapWizard::createDocument()
else if( d->mapProviderType == MapWizardPrivate::StaticImageMap )
{
QString image = d->uiWidget.lineEditSource->text();
- d->format = image.right( image.length() - image.lastIndexOf( '.' ) - 1 ).toLower();
+ d->format = image.right(image.length() - image.lastIndexOf(QLatin1Char('.')) - 1).toLower();
texture->setFileFormat( d->format.toUpper() );
texture->setInstallMap(document->head()->theme() + QLatin1Char('.') + d->format);
texture->setServerLayout( new MarbleServerLayout( texture ) );
diff --git a/src/lib/marble/MarbleAbstractPresenter.cpp b/src/lib/marble/MarbleAbstractPresenter.cpp
index 4823394..40b8d1a 100644
--- a/src/lib/marble/MarbleAbstractPresenter.cpp
+++ b/src/lib/marble/MarbleAbstractPresenter.cpp
@@ -106,7 +106,7 @@ namespace Marble
convertedDistance, unit);
QString unitString = locale->unitAbbreviation(unit);
- return QString("%L1 %2").arg(convertedDistance, 8, 'f', 1, QChar(' '))
+ return QString("%L1 %2").arg(convertedDistance, 8, 'f', 1, QLatin1Char(' '))
.arg(unitString);
}
diff --git a/src/lib/marble/MarbleLegendBrowser.cpp b/src/lib/marble/MarbleLegendBrowser.cpp
index dc89632..853033f 100644
--- a/src/lib/marble/MarbleLegendBrowser.cpp
+++ b/src/lib/marble/MarbleLegendBrowser.cpp
@@ -246,7 +246,7 @@ void MarbleLegendBrowser::translateHtml( QString & html )
rx.setMinimal( true );
s.replace( rx, "\n" );
s.replace( QRegExp( "\\s*\n\\s*" ), "\n" );
- QStringList words = s.split( '\n', QString::SkipEmptyParts );
+ const QStringList words = s.split(QLatin1Char('\n'), QString::SkipEmptyParts);
QStringList::const_iterator i = words.constBegin();
QStringList::const_iterator const end = words.constEnd();
diff --git a/src/lib/marble/MarbleLocale.cpp b/src/lib/marble/MarbleLocale.cpp
index c00c90c..daa0fd8 100644
--- a/src/lib/marble/MarbleLocale.cpp
+++ b/src/lib/marble/MarbleLocale.cpp
@@ -148,7 +148,7 @@ QString MarbleLocale::languageCode()
const QString lang = QLocale::system().name();
QString code;
- int index = lang.indexOf ( '_' );
+ int index = lang.indexOf(QLatin1Char('_'));
if (lang == QLatin1String("C")) {
code = "en";
}
@@ -156,7 +156,7 @@ QString MarbleLocale::languageCode()
code = lang.left ( index );
}
else {
- index = lang.indexOf ( '@' );
+ index = lang.indexOf(QLatin1Char('@'));
if ( index != -1 )
code = lang.left ( index );
else
diff --git a/src/lib/marble/MarblePlacemarkModel_P.h b/src/lib/marble/MarblePlacemarkModel_P.h
index 923671a..c49bb4c 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),'o');
- result = result.replace(QChar(0x0142),'l');
+ result = result.replace(QChar(0x00F8), QLatin1Char('o'));
+ result = result.replace(QChar(0x0142), QLatin1Char('l'));
return result;
}
}
diff --git a/src/lib/marble/MarbleWidgetPopupMenu.cpp b/src/lib/marble/MarbleWidgetPopupMenu.cpp
index c1e9db9..42e131f 100644
--- a/src/lib/marble/MarbleWidgetPopupMenu.cpp
+++ b/src/lib/marble/MarbleWidgetPopupMenu.cpp
@@ -401,7 +401,7 @@ void MarbleWidgetPopupMenu::Private::setupDialogCity( PopupLayer *popup, const G
// There is an issue about UTC.
// It's possible to variants (e.g.):
// +1.0 and -1.0, but dst does not have + an the start
- if(dst.startsWith('-')) {
+ if (dst.startsWith(QLatin1Char('-'))) {
doc["timezone"] = dst;
} else {
doc["timezone"] = QLatin1Char('+') + dst;
diff --git a/src/lib/marble/MergedLayerDecorator.cpp b/src/lib/marble/MergedLayerDecorator.cpp
index d2cd059..3755e7c 100644
--- a/src/lib/marble/MergedLayerDecorator.cpp
+++ b/src/lib/marble/MergedLayerDecorator.cpp
@@ -504,8 +504,8 @@ void MergedLayerDecorator::Private::paintSunShading( QImage *tileImage, const Ti
void MergedLayerDecorator::Private::paintTileId( QImage *tileImage, const TileId &id ) const
{
QString filename = QString( "%1_%2.jpg" )
- .arg( id.x(), tileDigits, 10, QChar('0') )
- .arg( id.y(), tileDigits, 10, QChar('0') );
+ .arg(id.x(), tileDigits, 10, QLatin1Char('0'))
+ .arg(id.y(), tileDigits, 10, QLatin1Char('0'));
QPainter painter( tileImage );
diff --git a/src/lib/marble/NewstuffModel.cpp b/src/lib/marble/NewstuffModel.cpp
index 52775ee..29ef69d 100644
--- a/src/lib/marble/NewstuffModel.cpp
+++ b/src/lib/marble/NewstuffModel.cpp
@@ -426,7 +426,7 @@ void NewstuffModelPrivate::uninstall( int index )
QStringList directories;
QStringList const files = m_items[index].installedFiles();
foreach( const QString &file, files ) {
- if ( file.endsWith( '/' ) ) {
+ if (file.endsWith(QLatin1Char('/'))) {
directories << file;
} else {
QFile::remove( file );
@@ -607,7 +607,7 @@ QString NewstuffModel::targetDirectory() const
void NewstuffModel::setRegistryFile( const QString &filename, IdTag idTag )
{
QString registryFile = filename;
- if ( registryFile.startsWith( '~' ) && registryFile.length() > 1 ) {
+ if (registryFile.startsWith(QLatin1Char('~')) && registryFile.length() > 1) {
registryFile = QDir::homePath() + registryFile.mid( 1 );
}
@@ -821,7 +821,7 @@ void NewstuffModel::mapUninstalled()
void NewstuffModel::contentsListed( int exitStatus )
{
if ( exitStatus == 0 ) {
- QStringList const files = QString( d->m_unpackProcess->readAllStandardOutput() ).split( '\n', QString::SkipEmptyParts );
+ QStringList const files = QString(d->m_unpackProcess->readAllStandardOutput()).split(QLatin1Char('\n'), QString::SkipEmptyParts);
d->updateRegistry(files);
QObject::disconnect( d->m_unpackProcess, SIGNAL(finished(int)),
diff --git a/src/lib/marble/PlacemarkEditHeader.cpp b/src/lib/marble/PlacemarkEditHeader.cpp
index 7406631..7e309a7 100644
--- a/src/lib/marble/PlacemarkEditHeader.cpp
+++ b/src/lib/marble/PlacemarkEditHeader.cpp
@@ -153,7 +153,7 @@ QString PlacemarkEditHeaderPrivate::id() const
QString PlacemarkEditHeaderPrivate::setId( const QString &id, bool isNew )
{
- QString newId = id.toLower().replace( ' ', '_' );
+ QString newId = id.toLower().replace(QLatin1Char(' '), QLatin1Char('_'));
if( newId == m_idString && !isNew ) {
return newId;
}
diff --git a/src/lib/marble/ServerLayout.cpp b/src/lib/marble/ServerLayout.cpp
index 87522bc..91839da 100644
--- a/src/lib/marble/ServerLayout.cpp
+++ b/src/lib/marble/ServerLayout.cpp
@@ -41,8 +41,8 @@ QUrl MarbleServerLayout::downloadUrl( const QUrl &prototypeUrl, const TileId &id
const QString path = QString( "%1/%2/%3/%3_%4.%5" )
.arg( prototypeUrl.path() )
.arg( id.zoomLevel() )
- .arg( id.y(), tileDigits, 10, QChar('0') )
- .arg( id.x(), tileDigits, 10, QChar('0') )
+ .arg(id.y(), tileDigits, 10, QLatin1Char('0'))
+ .arg(id.x(), tileDigits, 10, QLatin1Char('0'))
.arg( m_textureLayer->fileFormat().toLower() );
QUrl url = prototypeUrl;
diff --git a/src/lib/marble/TextureColorizer.cpp b/src/lib/marble/TextureColorizer.cpp
index ca44f52..d7f92e6 100644
--- a/src/lib/marble/TextureColorizer.cpp
+++ b/src/lib/marble/TextureColorizer.cpp
@@ -103,9 +103,9 @@ TextureColorizer::TextureColorizer( const QString &seafile,
while ( !stream.atEnd() ) {
stream >> evalstrg;
- if ( !evalstrg.isEmpty() && evalstrg.contains( '=' ) ) {
- QString colorValue = evalstrg.left( evalstrg.indexOf( '=' ) );
- QString colorPosition = evalstrg.mid( evalstrg.indexOf( '=' ) + 1 );
+ if (!evalstrg.isEmpty() && evalstrg.contains(QLatin1Char('='))) {
+ QString colorValue = evalstrg.left(evalstrg.indexOf(QLatin1Char('=')));
+ QString colorPosition = evalstrg.mid(evalstrg.indexOf(QLatin1Char('=')) + 1);
gradient.setColorAt( colorPosition.toDouble(),
QColor( colorValue ) );
}
diff --git a/src/lib/marble/TileCreator.cpp b/src/lib/marble/TileCreator.cpp
index 8525125..448578d 100644
--- a/src/lib/marble/TileCreator.cpp
+++ b/src/lib/marble/TileCreator.cpp
@@ -215,7 +215,7 @@ void TileCreator::run()
return;
}
- if ( !d->m_targetDir.endsWith('/') )
+ if (!d->m_targetDir.endsWith(QLatin1Char('/')))
d->m_targetDir += QLatin1Char('/');
mDebug() << "Installing tiles to: " << d->m_targetDir;
@@ -286,7 +286,7 @@ void TileCreator::run()
for ( int n = 0; n < nmax; ++n ) {
QString dirName( d->m_targetDir
- + QString("%1/%2").arg(maxTileLevel).arg( n, tileDigits, 10, QChar('0') ) );
+ + QString("%1/%2").arg(maxTileLevel).arg(n, tileDigits, 10, QLatin1Char('0')));
if ( !QDir( dirName ).exists() )
( QDir::root() ).mkpath( dirName );
}
@@ -300,10 +300,10 @@ void TileCreator::run()
if ( d->m_cancelled )
return;
- tileName = d->m_targetDir + ( QString("%1/%2/%2_%3.%4")
+ tileName = d->m_targetDir + QString("%1/%2/%2_%3.%4")
.arg( maxTileLevel )
- .arg( n, tileDigits, 10, QChar('0') )
- .arg( m, tileDigits, 10, QChar('0') ) )
+ .arg(n, tileDigits, 10, QLatin1Char('0'))
+ .arg(m, tileDigits, 10, QLatin1Char('0'))
.arg( d->m_tileFormat );
if ( QFile::exists( tileName ) && d->m_resume ) {
@@ -375,9 +375,9 @@ void TileCreator::run()
for ( int n = 0; n < nmaxit; ++n ) {
QString dirName( d->m_targetDir
- + ( QString("%1/%2")
+ + QString("%1/%2")
.arg(tileLevel)
- .arg( n, tileDigits, 10, QChar('0') ) ) );
+ .arg(n, tileDigits, 10, QLatin1Char('0')));
// mDebug() << "dirName: " << dirName;
if ( !QDir( dirName ).exists() )
@@ -389,40 +389,40 @@ void TileCreator::run()
if ( d->m_cancelled )
return;
- QString newTileName = d->m_targetDir + ( QString("%1/%2/%2_%3.%4")
+ QString newTileName = d->m_targetDir + QString("%1/%2/%2_%3.%4")
.arg( tileLevel )
- .arg( n, tileDigits, 10, QChar('0') )
- .arg( m, tileDigits, 10, QChar('0') ) )
+ .arg(n, tileDigits, 10, QLatin1Char('0'))
+ .arg(m, tileDigits, 10, QLatin1Char('0'))
.arg( d->m_tileFormat );
if ( QFile::exists( newTileName ) && d->m_resume ) {
//mDebug() << newTileName << "exists already";
} else {
- tileName = d->m_targetDir + ( QString("%1/%2/%2_%3.%4")
+ tileName = d->m_targetDir + QString("%1/%2/%2_%3.%4")
.arg( tileLevel + 1 )
- .arg( 2*n, tileDigits, 10, QChar('0') )
- .arg( 2*m, tileDigits, 10, QChar('0') ) )
+ .arg(2*n, tileDigits, 10, QLatin1Char('0'))
+ .arg(2*m, tileDigits, 10, QLatin1Char('0'))
.arg( d->m_tileFormat );
QImage img_topleft( tileName );
- tileName = d->m_targetDir + ( QString("%1/%2/%2_%3.%4")
+ tileName = d->m_targetDir + QString("%1/%2/%2_%3.%4")
.arg( tileLevel + 1 )
- .arg( 2*n, tileDigits, 10, QChar('0') )
- .arg( 2*m+1, tileDigits, 10, QChar('0') ) )
+ .arg(2*n, tileDigits, 10, QLatin1Char('0'))
+ .arg(2*m+1, tileDigits, 10, QLatin1Char('0'))
.arg( d->m_tileFormat );
QImage img_topright( tileName );
- tileName = d->m_targetDir + ( QString("%1/%2/%2_%3.%4")
+ tileName = d->m_targetDir + QString("%1/%2/%2_%3.%4")
.arg( tileLevel + 1 )
- .arg( 2*n+1, tileDigits, 10, QChar('0') )
- .arg( 2*m, tileDigits, 10, QChar('0') ) )
+ .arg(2*n+1, tileDigits, 10, QLatin1Char('0'))
+ .arg(2*m, tileDigits, 10, QLatin1Char('0'))
.arg( d->m_tileFormat );
QImage img_bottomleft( tileName );
- tileName = d->m_targetDir + ( QString("%1/%2/%2_%3.%4")
+ tileName = d->m_targetDir + QString("%1/%2/%2_%3.%4")
.arg( tileLevel + 1 )
- .arg( 2*n+1, tileDigits, 10, QChar('0') )
- .arg( 2*m+1, tileDigits, 10, QChar('0') ) )
+ .arg(2*n+1, tileDigits, 10, QLatin1Char('0'))
+ .arg(2*m+1, tileDigits, 10, QLatin1Char('0'))
.arg( d->m_tileFormat );
QImage img_bottomright( tileName );
@@ -543,10 +543,10 @@ void TileCreator::run()
savedTilesCount++;
- tileName = d->m_targetDir + ( QString("%1/%2/%2_%3.%4")
+ tileName = d->m_targetDir + QString("%1/%2/%2_%3.%4")
.arg( tileLevel )
- .arg( n, tileDigits, 10, QChar('0') )
- .arg( m, tileDigits, 10, QChar('0') ) )
+ .arg(n, tileDigits, 10, QLatin1Char('0'))
+ .arg(m, tileDigits, 10, QLatin1Char('0'))
.arg( d->m_tileFormat );
QImage tile( tileName );
diff --git a/src/lib/marble/TileLoader.cpp b/src/lib/marble/TileLoader.cpp
index e39fd21..fae63d2 100644
--- a/src/lib/marble/TileLoader.cpp
+++ b/src/lib/marble/TileLoader.cpp
@@ -213,7 +213,7 @@ TileLoader::TileStatus TileLoader::tileStatus( GeoSceneTileDataset const *tileDa
void TileLoader::updateTile( QByteArray const & data, QString const & idStr )
{
- QStringList const components = idStr.split( ':', QString::SkipEmptyParts );
+ QStringList const components = idStr.split(QLatin1Char(':'), QString::SkipEmptyParts);
Q_ASSERT( components.size() == 5 );
QString const origin = components[0];
@@ -235,7 +235,7 @@ void TileLoader::updateTile( QByteArray const & data, QString const & idStr )
void TileLoader::updateTile(const QString &fileName, const QString &idStr)
{
- QStringList const components = idStr.split( ':', QString::SkipEmptyParts );
+ QStringList const components = idStr.split(QLatin1Char(':'), QString::SkipEmptyParts);
Q_ASSERT( components.size() == 5 );
QString const origin = components[0];
diff --git a/src/lib/marble/TourItemDelegate.cpp b/src/lib/marble/TourItemDelegate.cpp
index be517c9..75f6fc5 100644
--- a/src/lib/marble/TourItemDelegate.cpp
+++ b/src/lib/marble/TourItemDelegate.cpp
@@ -140,7 +140,7 @@ void TourItemDelegate::paint( QPainter *painter, const QStyleOptionViewItem &opt
} else if ( object->nodeType() == GeoDataTypes::GeoDataSoundCueType && !m_editingIndices.contains( index ) ) {
GeoDataSoundCue *soundCue = static_cast<GeoDataSoundCue*>( object );
- label.setHtml( soundCue->href().section('/', -1) );
+ label.setHtml(soundCue->href().section(QLatin1Char('/'), -1));
painter->save();
painter->translate( labelRect.topLeft() );
diff --git a/src/lib/marble/TourWidget.cpp b/src/lib/marble/TourWidget.cpp
index fc904ec..953f179 100644
--- a/src/lib/marble/TourWidget.cpp
+++ b/src/lib/marble/TourWidget.cpp
@@ -352,7 +352,7 @@ void TourWidget::handleSliderMove( int value )
d->m_playback.seek( value / 100.0 );
QTime nullTime( 0, 0, 0 );
QTime time = nullTime.addSecs( value / 100.0 );
- d->m_tourUi.m_elapsedTime->setText( QString("%L1:%L2").arg( time.minute(), 2, 10, QChar('0') ).arg( time.second(), 2, 10, QChar('0') ) );
+ d->m_tourUi.m_elapsedTime->setText(QString("%L1:%L2").arg(time.minute(), 2, 10, QLatin1Char('0')).arg(time.second(), 2, 10, QLatin1Char('0')));
}
void TourWidgetPrivate::openFile()
@@ -654,7 +654,7 @@ void TourWidgetPrivate::updateRootIndex()
m_tourUi.m_slider->setMaximum( m_playback.duration() * 100 );
QTime nullTime( 0, 0, 0 );
QTime time = nullTime.addSecs( m_playback.duration() );
- m_tourUi.m_totalTime->setText( QString("%L1:%L2").arg( time.minute(), 2, 10, QChar('0') ).arg( time.second(), 2, 10, QChar('0') ) );
+ m_tourUi.m_totalTime->setText(QString("%L1:%L2").arg(time.minute(), 2, 10, QLatin1Char('0')).arg(time.second(), 2, 10, QLatin1Char('0')));
QObject::connect( &m_playback, SIGNAL(progressChanged(double)),
q, SLOT(handlePlaybackProgress(double)) );
q->stopPlaying();
@@ -731,9 +731,9 @@ void TourWidget::updateDuration()
d->m_tourUi.m_slider->setMaximum( d->m_playback.duration() * 100 );
QTime nullTime( 0, 0, 0 );
QTime totalTime = nullTime.addSecs( d->m_playback.duration() );
- d->m_tourUi.m_totalTime->setText( QString("%L1:%L2").arg( totalTime.minute(), 2, 10, QChar('0') ).arg( totalTime.second(), 2, 10, QChar('0') ) );
+ d->m_tourUi.m_totalTime->setText(QString("%L1:%L2").arg(totalTime.minute(), 2, 10, QLatin1Char('0') ).arg(totalTime.second(), 2, 10, QLatin1Char('0')));
d->m_tourUi.m_slider->setValue( 0 );
- d->m_tourUi.m_elapsedTime->setText( QString("%L1:%L2").arg( 0, 2, 10, QChar('0') ).arg( 0, 2, 10, QChar('0') ) );
+ d->m_tourUi.m_elapsedTime->setText(QString("%L1:%L2").arg(0, 2, 10, QLatin1Char('0')).arg(0, 2, 10, QLatin1Char('0')));
}
void TourWidget::finishAddingItem()
@@ -910,7 +910,7 @@ void TourWidgetPrivate::handlePlaybackProgress(const double position)
m_tourUi.m_slider->setValue( position * 100 );
QTime nullTime( 0, 0, 0 );
QTime time = nullTime.addSecs( position );
- m_tourUi.m_elapsedTime->setText( QString("%L1:%L2").arg( time.minute(), 2, 10, QChar('0') ).arg( time.second(), 2, 10, QChar('0') ) );
+ m_tourUi.m_elapsedTime->setText(QString("%L1:%L2").arg(time.minute(), 2, 10, QLatin1Char('0')).arg(time.second(), 2, 10, QLatin1Char('0')));
}
}
diff --git a/src/lib/marble/cloudsync/BookmarkSyncManager.cpp b/src/lib/marble/cloudsync/BookmarkSyncManager.cpp
index b729b45..2928a55 100644
--- a/src/lib/marble/cloudsync/BookmarkSyncManager.cpp
+++ b/src/lib/marble/cloudsync/BookmarkSyncManager.cpp
@@ -653,7 +653,7 @@ GeoDataDocument* BookmarkSyncManager::Private::constructDocument( const QList<Di
foreach( const DiffItem &item, mergedList ) {
GeoDataPlacemark *placemark = new GeoDataPlacemark( item.m_placemarkA );
- QStringList splitten = item.m_path.split( '/', QString::SkipEmptyParts );
+ QStringList splitten = item.m_path.split(QLatin1Char('/'), QString::SkipEmptyParts);
GeoDataFolder *folder = createFolders( document, splitten );
folder->append( placemark );
}
diff --git a/src/lib/marble/cloudsync/OwncloudSyncBackend.cpp b/src/lib/marble/cloudsync/OwncloudSyncBackend.cpp
index 8eb432f..e7a77f4 100644
--- a/src/lib/marble/cloudsync/OwncloudSyncBackend.cpp
+++ b/src/lib/marble/cloudsync/OwncloudSyncBackend.cpp
@@ -313,7 +313,7 @@ void OwncloudSyncBackend::checkAuthReply()
QString result = d->m_authReply->readAll();
- if ( !result.startsWith('{')) {
+ if (!result.startsWith(QLatin1Char('{'))) {
// not a JSON result
if ( result.contains("http://owncloud.org") ) {
// an owncloud login page was returned, marble app is not installed
diff --git a/src/lib/marble/cloudsync/RouteSyncManager.cpp b/src/lib/marble/cloudsync/RouteSyncManager.cpp
index 14d5f0f..ed81be1 100644
--- a/src/lib/marble/cloudsync/RouteSyncManager.cpp
+++ b/src/lib/marble/cloudsync/RouteSyncManager.cpp
@@ -152,8 +152,8 @@ QVector<RouteItem> RouteSyncManager::cachedRouteList() const
routeName = routeName.left( routeName.length() - 3 );
QString timestamp = routeFilename.left( routeFilename.length() - 4 );
- QString distance = QString('0');
- QString duration = QString('0');
+ QString distance(QLatin1Char('0'));
+ QString duration(QLatin1Char('0'));
QString previewPath = QString( "%0/preview/%1.jpg" ).arg( d->m_cacheDir.absolutePath(), timestamp );
QIcon preview;
diff --git a/src/lib/marble/declarative/OfflineDataModel.cpp b/src/lib/marble/declarative/OfflineDataModel.cpp
index 03709f9..664e7d2 100644
--- a/src/lib/marble/declarative/OfflineDataModel.cpp
+++ b/src/lib/marble/declarative/OfflineDataModel.cpp
@@ -48,7 +48,7 @@ QHash<int, QByteArray> OfflineDataModel::roleNames() const
QVariant OfflineDataModel::data(const QModelIndex &index, int role) const
{
if ( index.isValid() && index.row() >= 0 && index.row() < rowCount() && role == Qt::DisplayRole ) {
- QStringList const data = QSortFilterProxyModel::data( index, role ).toString().split( '/' );
+ QStringList const data = QSortFilterProxyModel::data(index, role).toString().split(QLatin1Char('/'));
if ( data.size() > 1 ) {
QString result = data.at( 1 );
for ( int i=2; i<data.size(); ++i ) {
@@ -62,7 +62,7 @@ QVariant OfflineDataModel::data(const QModelIndex &index, int role) const
}
if ( index.isValid() && index.row() >= 0 && index.row() < rowCount() && role == Qt::UserRole+17 ) {
- QStringList const data = QSortFilterProxyModel::data( index, Qt::DisplayRole ).toString().split( '/' );
+ QStringList const data = QSortFilterProxyModel::data(index, Qt::DisplayRole).toString().split(QLatin1Char('/'));
if ( data.size() > 1 ) {
return data.first().trimmed();
}
diff --git a/src/lib/marble/declarative/Placemark.cpp b/src/lib/marble/declarative/Placemark.cpp
index a46cde8..c7f0245 100644
--- a/src/lib/marble/declarative/Placemark.cpp
+++ b/src/lib/marble/declarative/Placemark.cpp
@@ -258,7 +258,7 @@ void Placemark::addTagValue(QString &target, const QString &key) const
auto const & osmData = m_placemark.osmData();
QString const value = osmData.tagValue(key);
QString description = value;
- description.replace(';', " · ");
+ description.replace(QLatin1Char(';'), " · ");
addTagDescription(target, key, value, description);
}
diff --git a/src/lib/marble/geodata/data/GeoDataCoordinates.cpp b/src/lib/marble/geodata/data/GeoDataCoordinates.cpp
index da0afbb..9e8d2db 100644
--- a/src/lib/marble/geodata/data/GeoDataCoordinates.cpp
+++ b/src/lib/marble/geodata/data/GeoDataCoordinates.cpp
@@ -469,14 +469,14 @@ QString GeoDataCoordinates::lonToString( qreal lon, GeoDataCoordinates::Notation
}
// Evaluate the string
- lonString = QString::fromUtf8("%1\xc2\xb0").arg(lonDeg, 3, 10, QChar(' ') );
+ lonString = QString::fromUtf8("%1\xc2\xb0").arg(lonDeg, 3, 10, QLatin1Char(' '));
if ( precision == 0 ) {
return lonString + weString;
}
if ( notation == DMS || precision < 3 ) {
- lonString += QString(" %2\'").arg(lonMin, 2, 10, QChar('0') );
+ lonString += QString(" %2\'").arg(lonMin, 2, 10, QLatin1Char('0'));
}
if ( precision < 3 ) {
@@ -486,19 +486,19 @@ QString GeoDataCoordinates::lonToString( qreal lon, GeoDataCoordinates::Notation
if ( notation == DMS ) {
// Includes -1 case!
if ( precision < 5 ) {
- lonString += QString(" %3\"").arg(lonSec, 2, 'f', 0, QChar('0') );
+ lonString += QString(" %3\"").arg(lonSec, 2, 'f', 0, QLatin1Char('0'));
return lonString + weString;
}
- lonString += QString(" %L3\"").arg(lonSecF, precision - 1, 'f', precision - 4, QChar('0') );
+ lonString += QString(" %L3\"").arg(lonSecF, precision - 1, 'f', precision - 4, QLatin1Char('0'));
}
else {
- lonString += QString(" %L3'").arg(lonMinF, precision + 1, 'f', precision - 2, QChar('0') );
+ lonString += QString(" %L3'").arg(lonMinF, precision + 1, 'f', precision - 2, QLatin1Char('0'));
}
}
else if ( notation == GeoDataCoordinates::Decimal )
{
- lonString = QString::fromUtf8("%L1\xc2\xb0").arg(lonDegF, 4 + precision, format, precision, QChar(' ') );
+ lonString = QString::fromUtf8("%L1\xc2\xb0").arg(lonDegF, 4 + precision, format, precision, QLatin1Char(' '));
}
else if ( notation == GeoDataCoordinates::Astro )
{
@@ -534,13 +534,13 @@ QString GeoDataCoordinates::lonToString( qreal lon, GeoDataCoordinates::Notation
}
// Evaluate the string
- lonString = QString::fromUtf8("%1h").arg(lonHour, 3, 10, QChar(' ') );
+ lonString = QString::fromUtf8("%1h").arg(lonHour, 3, 10, QLatin1Char(' '));
if ( precision == 0 ) {
return lonString;
}
- lonString += QString(" %2\'").arg(lonMin, 2, 10, QChar('0') );
+ lonString += QString(" %2\'").arg(lonMin, 2, 10, QLatin1Char('0'));
if ( precision < 3 ) {
return lonString;
@@ -548,11 +548,11 @@ QString GeoDataCoordinates::lonToString( qreal lon, GeoDataCoordinates::Notation
// Includes -1 case!
if ( precision < 5 ) {
- lonString += QString(" %3\"").arg(lonSec, 2, 'f', 0, QChar('0') );
+ lonString += QString(" %3\"").arg(lonSec, 2, 'f', 0, QLatin1Char('0'));
return lonString;
}
- lonString += QString(" %L3\"").arg(lonSecF, precision - 1, 'f', precision - 4, QChar('0') );
+ lonString += QString(" %L3\"").arg(lonSecF, precision - 1, 'f', precision - 4, QLatin1Char('0'));
return lonString;
}
@@ -641,14 +641,14 @@ QString GeoDataCoordinates::latToString( qreal lat, GeoDataCoordinates::Notation
}
// Evaluate the string
- latString = QString::fromUtf8("%1\xc2\xb0").arg(latDeg, 3, 10, QChar(' ') );
+ latString = QString::fromUtf8("%1\xc2\xb0").arg(latDeg, 3, 10, QLatin1Char(' '));
if ( precision == 0 ) {
return pmString + latString + nsString;
}
if ( notation == DMS || notation == Astro || precision < 3 ) {
- latString += QString(" %2\'").arg(latMin, 2, 10, QChar('0') );
+ latString += QString(" %2\'").arg(latMin, 2, 10, QLatin1Char('0'));
}
if ( precision < 3 ) {
@@ -658,19 +658,19 @@ QString GeoDataCoordinates::latToString( qreal lat, GeoDataCoordinates::Notation
if ( notation == DMS || notation == Astro ) {
// Includes -1 case!
if ( precision < 5 ) {
- latString += QString(" %3\"").arg(latSec, 2, 'f', 0, QChar('0') );
+ latString += QString(" %3\"").arg(latSec, 2, 'f', 0, QLatin1Char('0'));
return latString + nsString;
}
- latString += QString(" %L3\"").arg(latSecF, precision - 1, 'f', precision - 4, QChar('0') );
+ latString += QString(" %L3\"").arg(latSecF, precision - 1, 'f', precision - 4, QLatin1Char('0'));
}
else {
- latString += QString(" %L3'").arg(latMinF, precision + 1, 'f', precision - 2, QChar('0') );
+ latString += QString(" %L3'").arg(latMinF, precision + 1, 'f', precision - 2, QLatin1Char('0'));
}
}
else // notation = GeoDataCoordinates::Decimal
{
- latString = QString::fromUtf8("%L1\xc2\xb0").arg(latDegF, 4 + precision, format, precision, QChar(' ') );
+ latString = QString::fromUtf8("%L1\xc2\xb0").arg(latDegF, 4 + precision, format, precision, QLatin1Char(' '));
}
return pmString + latString + nsString;
}
diff --git a/src/lib/marble/geodata/data/GeoDataFeature.cpp b/src/lib/marble/geodata/data/GeoDataFeature.cpp
index e62b10f..b6ef8a5 100644
--- a/src/lib/marble/geodata/data/GeoDataFeature.cpp
+++ b/src/lib/marble/geodata/data/GeoDataFeature.cpp
@@ -260,7 +260,7 @@ void GeoDataFeature::setStyleUrl( const QString &value )
}
QString styleUrl = value;
- styleUrl.remove('#');
+ styleUrl.remove(QLatin1Char('#'));
GeoDataObject *object = parent();
bool found = false;
while ( object && !found ) {
@@ -269,7 +269,7 @@ void GeoDataFeature::setStyleUrl( const QString &value )
GeoDataStyleMap &styleMap = doc->styleMap( styleUrl );
if( !styleMap.value( QString( "normal" ) ).isEmpty() ) {
styleUrl = styleMap.value( QString( "normal" ) );
- styleUrl.remove('#');
+ styleUrl.remove(QLatin1Char('#'));
}
// Not calling setStyle here because we don't want
// re-parenting of the style
diff --git a/src/lib/marble/geodata/handlers/dgml/DgmlBrushTagHandler.cpp b/src/lib/marble/geodata/handlers/dgml/DgmlBrushTagHandler.cpp
index 460c06e..5931e1c 100644
--- a/src/lib/marble/geodata/handlers/dgml/DgmlBrushTagHandler.cpp
+++ b/src/lib/marble/geodata/handlers/dgml/DgmlBrushTagHandler.cpp
@@ -66,7 +66,7 @@ GeoNode* DgmlBrushTagHandler::parse(GeoParser& parser) const
GeoSceneGeodata *geodata = parentItem.nodeAs<GeoSceneGeodata>();
geodata->setBrush( brush );
if ( !colorMap.isEmpty() ) {
- const QStringList colorString = colorMap.split(',');
+ const QStringList colorString = colorMap.split(QLatin1Char(','));
QVector<QColor> colorList;
colorList.reserve(colorString.size());
diff --git a/src/lib/marble/geodata/handlers/kml/KmlRoleTagHandler.cpp b/src/lib/marble/geodata/handlers/kml/KmlRoleTagHandler.cpp
index 8667198..a120625 100644
--- a/src/lib/marble/geodata/handlers/kml/KmlRoleTagHandler.cpp
+++ b/src/lib/marble/geodata/handlers/kml/KmlRoleTagHandler.cpp
@@ -44,7 +44,7 @@ GeoNode* KmlroleTagHandler::parse( GeoParser& parser ) const
if( parentItem.is<GeoDataPlacemark>() ) {
QString role = parser.readElementText().trimmed();
if ( role.isEmpty() ) {
- role = ' ';
+ role = QLatin1Char(' ');
}
parentItem.nodeAs<GeoDataPlacemark>()->setRole( role );
}
diff --git a/src/lib/marble/geodata/scene/GeoSceneTileDataset.cpp b/src/lib/marble/geodata/scene/GeoSceneTileDataset.cpp
index 1658e0f..8b1767b 100644
--- a/src/lib/marble/geodata/scene/GeoSceneTileDataset.cpp
+++ b/src/lib/marble/geodata/scene/GeoSceneTileDataset.cpp
@@ -143,7 +143,7 @@ void GeoSceneTileDataset::setTileLevels(const QString &tileLevels)
return;
}
- QStringList values = tileLevels.split(',');
+ const QStringList values = tileLevels.split(QLatin1Char(','));
foreach(const QString &value, values) {
bool canParse(false);
int const tileLevel = value.trimmed().toInt(&canParse);
@@ -260,8 +260,8 @@ QString GeoSceneTileDataset::relativeTileFileName( const TileId &id ) const
relFileName = QString( "%1/%2/%3/%3_%4.%5" )
.arg( themeStr() )
.arg( id.zoomLevel() )
- .arg( id.y(), tileDigits, 10, QChar('0') )
- .arg( id.x(), tileDigits, 10, QChar('0') )
+ .arg(id.y(), tileDigits, 10, QLatin1Char('0'))
+ .arg(id.x(), tileDigits, 10, QLatin1Char('0'))
.arg( suffix );
break;
case GeoSceneTileDataset::OpenStreetMap:
diff --git a/src/lib/marble/geodata/writers/dgml/DgmlTextureTagWriter.cpp b/src/lib/marble/geodata/writers/dgml/DgmlTextureTagWriter.cpp
index 0a36092..8bc786c 100644
--- a/src/lib/marble/geodata/writers/dgml/DgmlTextureTagWriter.cpp
+++ b/src/lib/marble/geodata/writers/dgml/DgmlTextureTagWriter.cpp
@@ -55,7 +55,7 @@ bool DgmlTextureTagWriter::write(const GeoNode *node, GeoWriter& writer) const
{
for( int i = 0; i < texture->downloadUrls().size(); ++i )
{
- QString protocol = texture->downloadUrls().at(i).toString().left( texture->downloadUrls().at(i).toString().indexOf( ':' ) );
+ QString protocol = texture->downloadUrls().at(i).toString().left(texture->downloadUrls().at(i).toString().indexOf(QLatin1Char(':')));
QString host = QString( texture->downloadUrls().at(i).host() );
QString path = QString( texture->downloadUrls().at(i).path() );
QString query = texture->downloadUrls().at(i).query(QUrl::FullyEncoded);
diff --git a/src/lib/marble/geodata/writers/kml/KmlColorStyleTagWriter.cpp b/src/lib/marble/geodata/writers/kml/KmlColorStyleTagWriter.cpp
index c12b459..befc510 100644
--- a/src/lib/marble/geodata/writers/kml/KmlColorStyleTagWriter.cpp
+++ b/src/lib/marble/geodata/writers/kml/KmlColorStyleTagWriter.cpp
@@ -51,7 +51,7 @@ bool KmlColorStyleTagWriter::write( const Marble::GeoNode *node, GeoWriter &writ
QString KmlColorStyleTagWriter::formatColor( const QColor &color )
{
- QChar const fill = QChar( '0' );
+ QChar const fill = QLatin1Char('0');
return QString( "%1%2%3%4" )
.arg( color.alpha(), 2, 16, fill )
.arg( color.blue(), 2, 16, fill )
diff --git a/src/lib/marble/geodata/writers/kml/KmlListStyleTagWriter.cpp b/src/lib/marble/geodata/writers/kml/KmlListStyleTagWriter.cpp
index d522488..e0be22a 100644
--- a/src/lib/marble/geodata/writers/kml/KmlListStyleTagWriter.cpp
+++ b/src/lib/marble/geodata/writers/kml/KmlListStyleTagWriter.cpp
@@ -87,7 +87,7 @@ QString KmlListStyleTagWriter::iconStateToString( GeoDataItemIcon::ItemIconState
stateList << "fetching2";
}
- return stateList.join(" ");
+ return stateList.join(QLatin1Char(' '));
}
}
diff --git a/src/lib/marble/layers/FpsLayer.cpp b/src/lib/marble/layers/FpsLayer.cpp
index ed4392b..0ab8b09 100644
--- a/src/lib/marble/layers/FpsLayer.cpp
+++ b/src/lib/marble/layers/FpsLayer.cpp
@@ -28,7 +28,7 @@ FpsLayer::FpsLayer( QTime *time )
void FpsLayer::paint( QPainter *painter ) const
{
const qreal fps = 1000.0 / (qreal)( m_time->elapsed() );
- const QString fpsString = QString( "Speed: %1 fps" ).arg( fps, 5, 'f', 1, QChar(' ') );
+ const QString fpsString = QString("Speed: %1 fps").arg(fps, 5, 'f', 1, QLatin1Char(' '));
const QPoint fpsLabelPos( 10, 20 );
diff --git a/src/lib/marble/osm/OsmRelationManagerWidget.cpp b/src/lib/marble/osm/OsmRelationManagerWidget.cpp
index f0f2c5e..8c771f5 100644
--- a/src/lib/marble/osm/OsmRelationManagerWidget.cpp
+++ b/src/lib/marble/osm/OsmRelationManagerWidget.cpp
@@ -68,7 +68,7 @@ OsmRelationManagerWidget::~OsmRelationManagerWidget()
void OsmRelationManagerWidget::addRelation( QAction *relationAction )
{
// The QAction::text() adds a '&' for some reason
- QString relationText = relationAction->text().remove( '&' );
+ QString relationText = relationAction->text().remove(QLatin1Char('&'));
if ( relationText == tr( "New Relation" ) ) {
OsmPlacemarkData relationData;
diff --git a/src/lib/marble/osm/OsmTagEditorWidget_p.cpp b/src/lib/marble/osm/OsmTagEditorWidget_p.cpp
index ea4e8db..ebb3ed2 100644
--- a/src/lib/marble/osm/OsmTagEditorWidget_p.cpp
+++ b/src/lib/marble/osm/OsmTagEditorWidget_p.cpp
@@ -336,7 +336,7 @@ QStringList OsmTagEditorWidgetPrivate::generateTagFilter() const
bool OsmTagEditorWidgetPrivate::containsAny( const OsmPlacemarkData &osmData, const QStringList &tags ) const
{
foreach ( const QString &tag, tags ) {
- QStringList tagSplit = tag.split( '=' );
+ const QStringList tagSplit = tag.split(QLatin1Char('='));
// Only "key=value" mappings should be checked
Q_ASSERT( tagSplit.size() == 2 );
@@ -357,7 +357,7 @@ bool OsmTagEditorWidgetPrivate::containsAny( const OsmPlacemarkData &osmData, co
void OsmTagEditorWidgetPrivate::addPattern( QStringList &filter, const OsmPlacemarkData &osmData, const QStringList &tags ) const
{
foreach ( const QString &tag, tags ) {
- QStringList tagSplit = tag.split( '=' );
+ const QStringList tagSplit = tag.split(QLatin1Char('='));
QString key = tagSplit.at( 0 );
if ( !osmData.containsTagKey( key ) ) {
filter << key;
diff --git a/src/lib/marble/routing/instructions/RoutingInstruction.cpp b/src/lib/marble/routing/instructions/RoutingInstruction.cpp
index 9cf8beb..ef56130 100644
--- a/src/lib/marble/routing/instructions/RoutingInstruction.cpp
+++ b/src/lib/marble/routing/instructions/RoutingInstruction.cpp
@@ -341,7 +341,7 @@ QString RoutingInstruction::totalDurationRemaining() const
}
if ( duration >= 60.0 ) {
duration /= 60.0;
- durationUnit = 'h';
+ durationUnit = QStringLiteral("h");
precision = 1;
}
diff --git a/src/lib/marble/routing/instructions/WaypointParser.cpp b/src/lib/marble/routing/instructions/WaypointParser.cpp
index 8f4e05b..6384e57 100644
--- a/src/lib/marble/routing/instructions/WaypointParser.cpp
+++ b/src/lib/marble/routing/instructions/WaypointParser.cpp
@@ -28,7 +28,7 @@ QString WaypointParser::readField<QString>( Field field, const QStringList &fiel
}
// The default values are suitable for older versions of gosmore (the one shipped with Ubuntu Lucid Lynx)
-WaypointParser::WaypointParser() : m_lineSeparator( '\n' ), m_fieldSeparator( ',' )
+WaypointParser::WaypointParser() : m_lineSeparator(QStringLiteral("\n")), m_fieldSeparator(QLatin1Char(','))
{
setFieldIndex( Latitude, 0 );
setFieldIndex( Longitude, 1 );
@@ -63,7 +63,7 @@ RoutingWaypoints WaypointParser::parse( QTextStream &stream ) const
QStringList lines = input.split( m_lineSeparator );
foreach( const QString &line, lines ) {
if ( !line.trimmed().isEmpty() &&
- !line.trimmed().startsWith('#') &&
+ !line.trimmed().startsWith(QLatin1Char('#')) &&
!line.startsWith( QLatin1String( "Content-Type: text/plain" ) ) ) {
QStringList entries = line.split( m_fieldSeparator );
if ( entries.size() >= 1 + m_fieldIndices[RoadName] ) {
diff --git a/src/plugins/positionprovider/flightgear/FlightGearPositionProviderPlugin.cpp b/src/plugins/positionprovider/flightgear/FlightGearPositionProviderPlugin.cpp
index 195a811..b27a8f1 100644
--- a/src/plugins/positionprovider/flightgear/FlightGearPositionProviderPlugin.cpp
+++ b/src/plugins/positionprovider/flightgear/FlightGearPositionProviderPlugin.cpp
@@ -93,10 +93,10 @@ bool fixBadGPRMC(QByteArray &line)
if (!line.startsWith("$GPRMC"))
return false;
- QStringList parts = QString(line).split(',');
+ QStringList parts = QString(line).split(QLatin1Char(','));
if (parts[9].size() == 7) {
parts[9].remove(4,1);
- line = parts.join(",").toLatin1();
+ line = parts.join(QLatin1Char(',')).toLatin1();
// update crc
int crc = 0;
for(int i=1; i < line.size()-3; i++) {
@@ -104,7 +104,7 @@ bool fixBadGPRMC(QByteArray &line)
}
parts[11] = parts[11][0] + parts[11][1] + QString::number(crc, 16).toUpper();
- line = parts.join(",").toLatin1();
+ line = parts.join(QLatin1Char(',')).toLatin1();
return true;
}
return false;
@@ -135,7 +135,7 @@ void FlightGearPositionProviderPlugin::parseNmeaSentence( const QString &sentenc
GeoDataCoordinates oldPosition = m_position;
if ( sentence.startsWith( QLatin1String( "$GPRMC" ) ) ) {
- QStringList const values = sentence.split( ',' );
+ QStringList const values = sentence.split(QLatin1Char(','));
if ( values.size() > 9 ) {
if (values[2] == QLatin1String("A")) {
m_speed = values[7].toDouble() * 0.514444; // knots => m/s
@@ -150,7 +150,7 @@ void FlightGearPositionProviderPlugin::parseNmeaSentence( const QString &sentenc
// in GPRMC and once in GPGGA. Parsing one is sufficient
}
} else if ( sentence.startsWith( QLatin1String( "$GPGGA" ) ) ) {
- QStringList const values = sentence.split( ',' );
+ QStringList const values = sentence.split(QLatin1Char(','));
if ( values.size() > 10 ) {
if ( values[6] == 0 ) {
m_status = PositionProviderStatusAcquiring; // no fix
diff --git a/src/plugins/render/aprs/AprsGatherer.cpp b/src/plugins/render/aprs/AprsGatherer.cpp
index 8180eb4..22fb2c9 100644
--- a/src/plugins/render/aprs/AprsGatherer.cpp
+++ b/src/plugins/render/aprs/AprsGatherer.cpp
@@ -218,7 +218,7 @@ AprsGatherer::addObject( const QString &callSign,
GeoAprsCoordinates location( longitude, latitude, m_seenFrom );
if ( canDoDirect ) {
- if ( !routePath.contains( QChar( '*' ) ) ) {
+ if (!routePath.contains(QLatin1Char('*'))) {
location.addSeenFrom( GeoAprsCoordinates::Directly );
}
}
diff --git a/src/plugins/render/measure/MeasureToolPlugin.cpp b/src/plugins/render/measure/MeasureToolPlugin.cpp
index a938363..06229cd 100644
--- a/src/plugins/render/measure/MeasureToolPlugin.cpp
+++ b/src/plugins/render/measure/MeasureToolPlugin.cpp
@@ -533,7 +533,7 @@ QString MeasureToolPlugin::meterToPreferredUnit(qreal meters, bool isSquare) con
unitString.append(QChar(0xB2));
}
- return QString("%L1 %2").arg(convertedMeters, 8, 'f', 1, QChar(' '))
+ return QString("%L1 %2").arg(convertedMeters, 8, 'f', 1, QLatin1Char(' '))
.arg(unitString);
}
diff --git a/src/plugins/render/opencachingcom/OpenCachingComItem.cpp b/src/plugins/render/opencachingcom/OpenCachingComItem.cpp
index b172695..27af976 100644
--- a/src/plugins/render/opencachingcom/OpenCachingComItem.cpp
+++ b/src/plugins/render/opencachingcom/OpenCachingComItem.cpp
@@ -318,7 +318,7 @@ QString OpenCachingComItem::dateString(const QVariant& ms)
}
else
{
- result = '-';
+ result = QStringLiteral("-");
}
return result;
}
@@ -352,7 +352,7 @@ QString OpenCachingComItem::formatDistance(qreal spheredistance) const
locale->meterToTargetUnit(distance, measurementSystem, convertedMeters, unit);
QString unitString = locale->unitAbbreviation(unit);
- return QString("%L1 %2").arg(convertedMeters, 8, 'f', 1, QChar(' '))
+ return QString("%L1 %2").arg(convertedMeters, 8, 'f', 1, QLatin1Char(' '))
.arg(unitString);
}
diff --git a/src/plugins/render/panoramio/PanoramioParser.cpp b/src/plugins/render/panoramio/PanoramioParser.cpp
index 8d153c2..f7b668b 100644
--- a/src/plugins/render/panoramio/PanoramioParser.cpp
+++ b/src/plugins/render/panoramio/PanoramioParser.cpp
@@ -49,7 +49,7 @@ panoramioDataStructure PanoramioParser::parseObjectOnPosition(const QString &con
// Getting the upload date of the image.
QString upload_date_string=myEngine.evaluate(QString("upload_date(x)")).toString();
- QStringList date = upload_date_string.split( ' ' );
+ QStringList date = upload_date_string.split(QLatin1Char(' '));
if( date.size() == 3 ) {
unsigned int day = date.at( 0 ).toUInt();
unsigned int month = 1;
diff --git a/src/plugins/render/photo/PhotoPlugin.cpp b/src/plugins/render/photo/PhotoPlugin.cpp
index 970fa52..edc2e41 100644
--- a/src/plugins/render/photo/PhotoPlugin.cpp
+++ b/src/plugins/render/photo/PhotoPlugin.cpp
@@ -197,7 +197,7 @@ void PhotoPlugin::setSettings( const QHash<QString,QVariant> &settings )
AbstractDataPlugin::setSettings( settings );
setNumberOfItems( qMin<int>( maximumNumberOfItems, settings.value( "numberOfItems", 15 ).toInt() ) );
- m_checkStateList = settings.value( "checkState", "1,2,3,4,5,6,7" ).toString().split( ',', QString::SkipEmptyParts );
+ m_checkStateList = settings.value( "checkState", "1,2,3,4,5,6,7" ).toString().split(QLatin1Char(','), QString::SkipEmptyParts );
updateSettings();
readSettings();
@@ -253,7 +253,7 @@ void PhotoPlugin::updateSettings()
}
if ( model() ) {
- qobject_cast<PhotoPluginModel*>( model() )->setLicenseValues( m_checkStateList.join(",") );
+ qobject_cast<PhotoPluginModel*>(model())->setLicenseValues(m_checkStateList.join(QLatin1Char(',')));
}
}
diff --git a/src/plugins/render/satellites/SatellitesModel.cpp b/src/plugins/render/satellites/SatellitesModel.cpp
index 890f236..38503db 100644
--- a/src/plugins/render/satellites/SatellitesModel.cpp
+++ b/src/plugins/render/satellites/SatellitesModel.cpp
@@ -148,7 +148,7 @@ void SatellitesModel::parseCatalog( const QString &id,
QString line = ts.readLine();
for( ; !line.isNull(); line = ts.readLine() ) {
- if( line.trimmed().startsWith( QLatin1String( "#" ) ) ) {
+ if (line.trimmed().startsWith(QLatin1Char('#'))) {
continue;
}
diff --git a/src/plugins/render/stars/StarsPlugin.cpp b/src/plugins/render/stars/StarsPlugin.cpp
index 6c73a4a..c9bc5a4 100644
--- a/src/plugins/render/stars/StarsPlugin.cpp
+++ b/src/plugins/render/stars/StarsPlugin.cpp
@@ -205,7 +205,7 @@ QHash<QString, QVariant> StarsPlugin::settings() const
QStringList planetState;
foreach (const QString &key, m_renderPlanet.keys())
planetState += key + QLatin1Char(':') + QString::number((int)m_renderPlanet[key]);
- settings["renderPlanet"] = planetState.join(QChar('|'));
+ settings["renderPlanet"] = planetState.join(QLatin1Char('|'));
settings["renderEcliptic"] = m_renderEcliptic;
settings["renderCelestialEquator"] = m_renderCelestialEquator;
@@ -238,9 +238,9 @@ void StarsPlugin::setSettings( const QHash<QString, QVariant> &settings )
m_renderPlanet.clear();
const QString renderPlanet = readSetting<QString>( settings, "renderPlanet", "" );
- const QStringList renderStates = renderPlanet.split(QChar('|'));
+ const QStringList renderStates = renderPlanet.split(QLatin1Char('|'));
foreach(const QString &state, renderStates) {
- const QStringList stateList = state.split(QChar(':'));
+ const QStringList stateList = state.split(QLatin1Char(':'));
if (stateList.size() == 2)
m_renderPlanet[stateList[0]] = (bool)stateList[1].toInt();
}
@@ -296,7 +296,7 @@ void StarsPlugin::prepareNames()
QTextStream in( &names );
while ( !in.atEnd() ) {
QString line = in.readLine();
- QStringList list = line.split( ';' );
+ const QStringList list = line.split(QLatin1Char(';'));
if ( list.size() == 3 ) {
m_nativeHash[ list.at( 0 ) ] = QCoreApplication::translate( "StarNames", list.at( 1 ).toUtf8().constData() );
m_abbrHash[ list.at( 0 ) ] = list.at( 2 );
@@ -701,7 +701,7 @@ void StarsPlugin::loadConstellations()
// Ignore Comment lines in header and
// between constellation entries
- if ( line.startsWith( '#' ) ) {
+ if (line.startsWith(QLatin1Char('#'))) {
continue;
}
@@ -740,7 +740,7 @@ void StarsPlugin::loadDsos()
// Ignore Comment lines in header and
// between dso entries
- if ( line.startsWith( '#' ) ) {
+ if (line.startsWith(QLatin1Char('#'))) {
continue;
}
diff --git a/src/plugins/render/stars/StarsPlugin.h b/src/plugins/render/stars/StarsPlugin.h
index c15d07f..7f21cc1 100644
--- a/src/plugins/render/stars/StarsPlugin.h
+++ b/src/plugins/render/stars/StarsPlugin.h
@@ -282,7 +282,7 @@ public:
m_plugin( plugin ),
m_name( name )
{
- QStringList starlist = stars.split(" ");
+ const QStringList starlist = stars.split(QLatin1Char(' '));
for (int i = 0; i < starlist.size(); ++i) {
m_stars << starlist.at(i).toInt();
}
diff --git a/src/plugins/render/weather/StationListParser.cpp b/src/plugins/render/weather/StationListParser.cpp
index 2ba249b..dc8f2eb 100644
--- a/src/plugins/render/weather/StationListParser.cpp
+++ b/src/plugins/render/weather/StationListParser.cpp
@@ -180,7 +180,7 @@ void StationListParser::readPoint( BBCStation *station )
if ( isStartElement() ) {
if (name() == QLatin1String("coordinates")) {
QString coorString = readCharacters();
- QStringList coorList = coorString.split( ',' );
+ QStringList coorList = coorString.split(QLatin1Char(','));
if ( coorList.size() >= 2 ) {
GeoDataCoordinates coordinates( coorList.at( 0 ).toFloat() * DEG2RAD,
diff --git a/src/plugins/render/weather/WeatherPlugin.cpp b/src/plugins/render/weather/WeatherPlugin.cpp
index 9d6c864..c722bac 100644
--- a/src/plugins/render/weather/WeatherPlugin.cpp
+++ b/src/plugins/render/weather/WeatherPlugin.cpp
@@ -311,7 +311,7 @@ void WeatherPlugin::updateItemSettings()
void WeatherPlugin::favoriteItemsChanged( const QStringList& favoriteItems )
{
- m_settings["favoriteItems"] = favoriteItems.join( "," );
+ m_settings["favoriteItems"] = favoriteItems.join(QLatin1Char(','));
emit settingsChanged( nameId() );
updateSettings();
}
diff --git a/src/plugins/runner/cyclestreets/CycleStreetsRunner.cpp b/src/plugins/runner/cyclestreets/CycleStreetsRunner.cpp
index 4c6a462..c54bd92 100644
--- a/src/plugins/runner/cyclestreets/CycleStreetsRunner.cpp
+++ b/src/plugins/runner/cyclestreets/CycleStreetsRunner.cpp
@@ -70,7 +70,7 @@ void CycleStreetsRunner::retrieveRoute( const RouteRequest *route )
QUrl url("http://www.cyclestreets.net/api/journey.xml");
QMap<QString, QString> queryStrings;
queryStrings["key"] = "cdccf13997d59e70";
- queryStrings["useDom"] = '1';
+ queryStrings["useDom"] = QLatin1Char('1');
queryStrings["plan"] = settings["plan"].toString();
queryStrings["speed"] = settings["speed"].toString();
GeoDataCoordinates::Unit const degree = GeoDataCoordinates::Degree;
@@ -160,13 +160,13 @@ GeoDataDocument *CycleStreetsRunner::parse( const QByteArray &content ) const
QDomElement route = features.at( 0 ).toElement().firstChild().toElement();
QDomElement lineString = route.elementsByTagName( "gml:LineString" ).at( 0 ).toElement();
QDomElement coordinates = lineString.toElement().elementsByTagName( "gml:coordinates" ).at( 0 ).toElement();
- QStringList coordinatesList = coordinates.text().split( ' ' );
+ QStringList coordinatesList = coordinates.text().split(QLatin1Char(' '));
QStringList::iterator iter = coordinatesList.begin();
QStringList::iterator end = coordinatesList.end();
for( ; iter != end; ++iter) {
- QStringList coordinate = iter->split(',');
+ const QStringList coordinate = iter->split(QLatin1Char(','));
if ( coordinate.size() == 2 ) {
double const lon = coordinate.at( 0 ).toDouble();
double const lat = coordinate.at( 1 ).toDouble();
@@ -194,8 +194,8 @@ GeoDataDocument *CycleStreetsRunner::parse( const QByteArray &content ) const
QString name = segment.elementsByTagName( "cs:name" ).at( 0 ).toElement().text();
QString maneuver = segment.elementsByTagName( "cs:turn" ).at( 0 ).toElement().text();
- QStringList points = segment.elementsByTagName( "cs:points" ).at( 0 ).toElement().text().split( ' ' );
- QStringList const elevation = segment.elementsByTagName( "cs:elevations" ).at( 0 ).toElement().text().split( ',' );
+ QStringList points = segment.elementsByTagName( "cs:points" ).at( 0 ).toElement().text().split(QLatin1Char(' '));
+ QStringList const elevation = segment.elementsByTagName( "cs:elevations" ).at( 0 ).toElement().text().split(QLatin1Char(','));
GeoDataPlacemark *instructions = new GeoDataPlacemark;
QString instructionName;
@@ -220,7 +220,7 @@ GeoDataDocument *CycleStreetsRunner::parse( const QByteArray &content ) const
QStringList::iterator iter = points.begin();
QStringList::iterator end = points.end();
for ( int j=0; iter != end; ++iter, ++j ) {
- QStringList coordinate = iter->split( ',' );
+ const QStringList coordinate = iter->split(QLatin1Char(','));
if ( coordinate.size() == 2 ) {
double const lon = coordinate.at( 0 ).toDouble();
double const lat = coordinate.at( 1 ).toDouble();
diff --git a/src/plugins/runner/gosmore-reversegeocoding/GosmoreReverseGeocodingRunner.cpp b/src/plugins/runner/gosmore-reversegeocoding/GosmoreReverseGeocodingRunner.cpp
index e7ecd47..d3246d2 100644
--- a/src/plugins/runner/gosmore-reversegeocoding/GosmoreReverseGeocodingRunner.cpp
+++ b/src/plugins/runner/gosmore-reversegeocoding/GosmoreReverseGeocodingRunner.cpp
@@ -40,7 +40,7 @@ public:
GosmoreRunnerPrivate::GosmoreRunnerPrivate()
{
m_parser.setLineSeparator("\r");
- m_parser.setFieldSeparator(',');
+ m_parser.setFieldSeparator(QLatin1Char(','));
m_parser.setFieldIndex( WaypointParser::RoadName, 4 );
m_parser.addJunctionTypeMapping( "Jr", RoutingWaypoint::Roundabout );
}
@@ -100,9 +100,9 @@ void GosmoreRunner::reverseGeocoding( const GeoDataCoordinates &coordinates )
GeoDataPlacemark placemark;
placemark.setCoordinate( coordinates );
- QStringList lines = QString::fromUtf8( output ).split( '\r' );
+ QStringList lines = QString::fromUtf8(output).split(QLatin1Char('\r'));
if ( lines.size() > 2 ) {
- QStringList fields = lines.at( lines.size()-2 ).split(',');
+ QStringList fields = lines.at( lines.size()-2 ).split(QLatin1Char(','));
if ( fields.size() >= 5 ) {
QString road = fields.last().trimmed();
placemark.setAddress( road );
diff --git a/src/plugins/runner/gosmore-routing/GosmoreRoutingRunner.cpp b/src/plugins/runner/gosmore-routing/GosmoreRoutingRunner.cpp
index eb382b5..4fd2818 100644
--- a/src/plugins/runner/gosmore-routing/GosmoreRoutingRunner.cpp
+++ b/src/plugins/runner/gosmore-routing/GosmoreRoutingRunner.cpp
@@ -52,7 +52,7 @@ public:
GosmoreRunnerPrivate::GosmoreRunnerPrivate()
{
m_parser.setLineSeparator("\r");
- m_parser.setFieldSeparator(',');
+ m_parser.setFieldSeparator(QLatin1Char(','));
m_parser.setFieldIndex( WaypointParser::RoadName, 4 );
m_parser.addJunctionTypeMapping( "Jr", RoutingWaypoint::Roundabout );
}
@@ -98,9 +98,9 @@ GeoDataLineString GosmoreRunnerPrivate::parseGosmoreOutput( const QByteArray &co
{
GeoDataLineString routeWaypoints;
- QStringList lines = QString::fromLocal8Bit( content ).split( '\r' );
+ QStringList lines = QString::fromLocal8Bit( content ).split(QLatin1Char('\r'));
foreach( const QString &line, lines ) {
- QStringList fields = line.split(',');
+ const QStringList fields = line.split(QLatin1Char(','));
if (fields.size() >= 5) {
qreal lon = fields.at(1).toDouble();
qreal lat = fields.at(0).toDouble();
@@ -115,9 +115,9 @@ GeoDataLineString GosmoreRunnerPrivate::parseGosmoreOutput( const QByteArray &co
QVector<GeoDataPlacemark*> GosmoreRunnerPrivate::parseGosmoreInstructions( const QByteArray &content )
{
// Determine gosmore version
- QStringList lines = QString::fromUtf8( content ).split( '\r' );
+ QStringList lines = QString::fromUtf8(content).split(QLatin1Char('\r'));
if ( lines.size() > 2 ) {
- QStringList fields = lines.at( lines.size()-2 ).split(',');
+ const QStringList fields = lines.at(lines.size()-2).split(QLatin1Char(','));
m_parser.setFieldIndex( WaypointParser::RoadName, fields.size()-1 );
if ( fields.size() < 5 || fields.size() > 6 ) {
// Can happen when gosmore changes the output format, returns garbage
diff --git a/src/plugins/runner/hostip/HostipRunner.cpp b/src/plugins/runner/hostip/HostipRunner.cpp
index 7df520d..17638ed 100644
--- a/src/plugins/runner/hostip/HostipRunner.cpp
+++ b/src/plugins/runner/hostip/HostipRunner.cpp
@@ -42,7 +42,7 @@ void HostipRunner::slotNoResults()
void HostipRunner::search( const QString &searchTerm, const GeoDataLatLonBox & )
{
- if( !searchTerm.contains('.') ) {
+ if (!searchTerm.contains(QLatin1Char('.'))) {
// Simple IP/hostname heuristic to avoid requests not needed:
// String must contain at least one dot.
slotNoResults();
diff --git a/src/plugins/runner/local-osm-search/OsmDatabase.cpp b/src/plugins/runner/local-osm-search/OsmDatabase.cpp
index 558b4da..d36a12d 100644
--- a/src/plugins/runner/local-osm-search/OsmDatabase.cpp
+++ b/src/plugins/runner/local-osm-search/OsmDatabase.cpp
@@ -296,7 +296,7 @@ qreal OsmDatabase::bearing( const GeoDataCoordinates &a, const GeoDataCoordinate
QString OsmDatabase::wildcardQuery( const QString &term )
{
QString result = term;
- if ( term.contains( '*' ) ) {
+ if (term.contains(QLatin1Char('*'))) {
return QLatin1String(" LIKE '") + result.replace(QLatin1Char('*'), QLatin1Char('%')) + QLatin1Char('\'');
} else {
return QLatin1String(" = '") + result + QLatin1Char('\'');
diff --git a/src/plugins/runner/log/LogRunner.cpp b/src/plugins/runner/log/LogRunner.cpp
index 9b77af9..5081322 100644
--- a/src/plugins/runner/log/LogRunner.cpp
+++ b/src/plugins/runner/log/LogRunner.cpp
@@ -53,7 +53,7 @@ GeoDataDocument *LogRunner::parseFile(const QString &fileName, DocumentRole role
bool error = false;
while( !stream.atEnd() || error ){
const QString line = stream.readLine();
- const QStringList list = line.split( ',' );
+ const QStringList list = line.split(QLatin1Char(','));
if ( list.size() != 7 ) {
mDebug() << Q_FUNC_INFO << "Aborting due to error in line" << count << ". Line was:" << line;
diff --git a/src/plugins/runner/monav/MonavConfigWidget.cpp b/src/plugins/runner/monav/MonavConfigWidget.cpp
index 3837325..989360d 100644
--- a/src/plugins/runner/monav/MonavConfigWidget.cpp
+++ b/src/plugins/runner/monav/MonavConfigWidget.cpp
@@ -231,7 +231,7 @@ void MonavConfigWidgetPrivate::parseNewStuff( const QByteArray &data )
QDomNodeList payloads = node.toElement().elementsByTagName( "payload" );
if ( payloads.size() == 1 ) {
QString payload = payloads.at( 0 ).toElement().text();
- filename = payload.mid( 1 + payload.lastIndexOf( "/" ) );
+ filename = payload.mid(1 + payload.lastIndexOf(QLatin1Char('/')));
item.setPayload( payload );
}
@@ -486,7 +486,7 @@ void MonavConfigWidget::cancelOperation()
void MonavConfigWidgetPrivate::install()
{
if ( !m_currentDownload.isEmpty() ) {
- int const index = m_currentDownload.lastIndexOf( "/");
+ int const index = m_currentDownload.lastIndexOf(QLatin1Char('/'));
const QString localFile = MarbleDirs::localPath() + QLatin1String("/maps") + m_currentDownload.mid(index);
m_currentFile.setFileName( localFile );
if ( m_currentFile.open( QFile::WriteOnly ) ) {
diff --git a/src/plugins/runner/monav/MonavMapsModel.cpp b/src/plugins/runner/monav/MonavMapsModel.cpp
index c22d053..b9e08b9 100644
--- a/src/plugins/runner/monav/MonavMapsModel.cpp
+++ b/src/plugins/runner/monav/MonavMapsModel.cpp
@@ -74,7 +74,7 @@ QVariant MonavMapsModel::data ( const QModelIndex & index, int role ) const
return QString( "%1 MB" ).arg( 1 + m_data.at( row ).size() / 1024 / 1024 );
case 3: {
QString payload = m_data.at( row ).payload();
- payload = payload.mid( payload.lastIndexOf( "/" ) + 1 );
+ payload = payload.mid(payload.lastIndexOf(QLatin1Char('/')) + 1);
if ( m_remoteMaps.contains( payload ) ) {
QDate remote = QDate::fromString( m_remoteMaps[payload], "MM/dd/yy" );
QDate local = QDate::fromString( m_data.at( row ).date(), "MM/dd/yy" );
diff --git a/src/plugins/runner/nominatim-search/OsmNominatimSearchRunner.cpp b/src/plugins/runner/nominatim-search/OsmNominatimSearchRunner.cpp
index 8279dd5..1147856 100644
--- a/src/plugins/runner/nominatim-search/OsmNominatimSearchRunner.cpp
+++ b/src/plugins/runner/nominatim-search/OsmNominatimSearchRunner.cpp
@@ -176,20 +176,20 @@ void OsmNominatimRunner::handleResult( QNetworkReply* reply )
placemarkName += road;
data.addTag("addr:street", road);
}
- if (!city.isEmpty() && !placemarkName.contains(",") && city != placemarkName) {
+ if (!city.isEmpty() && !placemarkName.contains(QLatin1Char(',')) && city != placemarkName) {
if( !placemarkName.isEmpty() ) {
placemarkName += QLatin1String(", ");
}
placemarkName += city;
data.addTag("addr:city", city);
}
- if (!administrative.isEmpty()&& !placemarkName.contains(",") && administrative != placemarkName) {
+ if (!administrative.isEmpty() && !placemarkName.contains(QLatin1Char(',')) && administrative != placemarkName) {
if( !placemarkName.isEmpty() ) {
placemarkName += QLatin1String(", ");
}
placemarkName += administrative;
}
- if (!country.isEmpty()&& !placemarkName.contains(",") && country != placemarkName) {
+ if (!country.isEmpty() && !placemarkName.contains(QLatin1Char(',')) && country != placemarkName) {
if( !placemarkName.isEmpty() ) {
placemarkName += QLatin1String(", ");
}
diff --git a/src/plugins/runner/openlocation-code-search/OpenLocationCodeSearchRunner.cpp b/src/plugins/runner/openlocation-code-search/OpenLocationCodeSearchRunner.cpp
index 67076ae..68db402 100644
--- a/src/plugins/runner/openlocation-code-search/OpenLocationCodeSearchRunner.cpp
+++ b/src/plugins/runner/openlocation-code-search/OpenLocationCodeSearchRunner.cpp
@@ -123,7 +123,7 @@ bool OpenLocationCodeSearchRunner::isValidOLC( const QString& olc ) const
{
// It must have only one SEPARATOR located at an even index in
// the string.
- QChar const separator('+');
+ QChar const separator(QLatin1Char('+'));
int separatorPos = olc.indexOf(separator);
if( separatorPos == -1
|| separatorPos != olc.lastIndexOf(separator)
@@ -152,7 +152,7 @@ bool OpenLocationCodeSearchRunner::isValidOLC( const QString& olc ) const
}
// Test the characters before the SEPARATOR.
- QChar const suffixPadding('0');
+ QChar const suffixPadding(QLatin1Char('0'));
bool paddingBegun = false;
for( int index = 0; index < separatorPos; index++ ) {
if( paddingBegun ) {
diff --git a/src/plugins/runner/openrouteservice/OpenRouteServiceRunner.cpp b/src/plugins/runner/openrouteservice/OpenRouteServiceRunner.cpp
index 6c30a9a..068a383 100644
--- a/src/plugins/runner/openrouteservice/OpenRouteServiceRunner.cpp
+++ b/src/plugins/runner/openrouteservice/OpenRouteServiceRunner.cpp
@@ -58,7 +58,7 @@ void OpenRouteServiceRunner::retrieveRoute( const RouteRequest *route )
preference = settings["preference"].toString();
}
if (preference == QLatin1String("Pedestrian")) {
- unit = 'M';
+ unit = QStringLiteral("M");
}
request += requestHeader( unit, preference );
@@ -278,7 +278,7 @@ GeoDataDocument* OpenRouteServiceRunner::parse( const QByteArray &content ) cons
QDomNodeList waypoints = geometry.item( 0 ).toElement().elementsByTagName( "gml:pos" );
for (int i=0 ; i < waypoints.length(); ++i ) {
QDomNode node = waypoints.item( i );
- QStringList content = node.toElement().text().split( ' ' );
+ const QStringList content = node.toElement().text().split(QLatin1Char(' '));
if ( content.length() == 2 ) {
GeoDataCoordinates position;
position.setLongitude( content.at( 0 ).toDouble(), GeoDataCoordinates::Degree );
@@ -307,12 +307,12 @@ GeoDataDocument* OpenRouteServiceRunner::parse( const QByteArray &content ) cons
QDomNodeList positions = node.elementsByTagName( "gml:pos" );
if ( textNodes.size() > 0 && positions.size() > 0 ) {
- QStringList content = positions.at( 0 ).toElement().text().split( ' ' );
+ const QStringList content = positions.at(0).toElement().text().split(QLatin1Char(' '));
if ( content.length() == 2 ) {
GeoDataLineString *lineString = new GeoDataLineString;
for( int i = 0; i < positions.count(); ++i ) {
- QStringList pointList = positions.at( i ).toElement().text().split( ' ' );
+ const QStringList pointList = positions.at(i).toElement().text().split(QLatin1Char(' '));
GeoDataCoordinates position;
position.setLongitude( pointList.at( 0 ).toDouble(), GeoDataCoordinates::Degree );
position.setLatitude( pointList.at( 1 ).toDouble(), GeoDataCoordinates::Degree );
diff --git a/src/plugins/runner/routino/RoutinoRunner.cpp b/src/plugins/runner/routino/RoutinoRunner.cpp
index 5a6e78f..7f8738b 100644
--- a/src/plugins/runner/routino/RoutinoRunner.cpp
+++ b/src/plugins/runner/routino/RoutinoRunner.cpp
@@ -51,7 +51,7 @@ public:
RoutinoRunnerPrivate::RoutinoRunnerPrivate()
{
m_parser.setLineSeparator("\n");
- m_parser.setFieldSeparator('\t');
+ m_parser.setFieldSeparator(QLatin1Char('\t'));
m_parser.setFieldIndex( WaypointParser::RoadName, 10 );
}
@@ -126,14 +126,14 @@ GeoDataLineString* RoutinoRunnerPrivate::parseRoutinoOutput( const QByteArray &c
{
GeoDataLineString* routeWaypoints = new GeoDataLineString;
- QStringList lines = QString::fromUtf8( content ).split( '\n' );
+ const QStringList lines = QString::fromUtf8(content).split(QLatin1Char('\n'));
mDebug() << lines.count() << "lines";
foreach( const QString &line, lines ) {
if (line.startsWith(QLatin1Char('#'))) {
//skip comment
continue;
}
- QStringList fields = line.split('\t');
+ const QStringList fields = line.split(QLatin1Char('\t'));
if ( fields.size() >= 10 ) {
qreal lon = fields.at(1).trimmed().toDouble();
qreal lat = fields.at(0).trimmed().toDouble();
diff --git a/src/plugins/runner/traveling-salesman/TravelingSalesmanRunner.cpp b/src/plugins/runner/traveling-salesman/TravelingSalesmanRunner.cpp
index 9cc9262..cbfeb2b 100644
--- a/src/plugins/runner/traveling-salesman/TravelingSalesmanRunner.cpp
+++ b/src/plugins/runner/traveling-salesman/TravelingSalesmanRunner.cpp
@@ -127,7 +127,7 @@ GeoDataDocument* TravelingSalesmanRunnerPrivate::createDocument( GeoDataLineStri
result->append( routePlacemark );
QString name = "%1 %2 (Traveling Salesman)";
- QString unit = 'm';
+ QString unit = QStringLiteral("m");
qreal length = routeWaypoints->length( EARTH_RADIUS );
if ( length >= 1000 ) {
length /= 1000.0;
diff --git a/tools/asc2kml/asc2kml.cpp b/tools/asc2kml/asc2kml.cpp
index 3055d3a..6a7333a 100644
--- a/tools/asc2kml/asc2kml.cpp
+++ b/tools/asc2kml/asc2kml.cpp
@@ -20,11 +20,11 @@
QString escapeXml( const QString &str )
{
QString xml = str;
- xml.replace('&', "&amp;");
- xml.replace('<', "&lt;");
- xml.replace('>', "&gt;");
- xml.replace('\'', "&apos;");
- xml.replace('"', "&quot;");
+ xml.replace(QLatin1Char('&'), QStringLiteral("&amp;"));
+ xml.replace(QLatin1Char('<'), QStringLiteral("&lt;"));
+ xml.replace(QLatin1Char('>'), QStringLiteral("&gt;"));
+ xml.replace(QLatin1Char('\''), QStringLiteral("&apos;"));
+ xml.replace(QLatin1Char('"'), QStringLiteral("&quot;"));
return xml;
}
@@ -86,7 +86,7 @@ int main(int argc, char *argv[])
while ( !sourcestream.atEnd() ) {
const QString rawline = sourcestream.readLine();
- const QStringList splitline = rawline.split('\t');
+ const QStringList splitline = rawline.split(QLatin1Char('\t'));
const QString name = splitline[1];
const QString latstring = splitline[4];
@@ -101,7 +101,7 @@ int main(int argc, char *argv[])
supportstream.seek(0);
while ( !supportstream.atEnd() ) {
const QString supportrawline = supportstream.readLine();
- const QStringList supportsplitline = supportrawline.split('\t');
+ const QStringList supportsplitline = supportrawline.split(QLatin1Char('\t'));
if (supportsplitline[0] == (country + QLatin1Char('.') +statecode)) {
state = supportsplitline[1];
break;
@@ -112,7 +112,7 @@ int main(int argc, char *argv[])
timezonestream.readLine();
while ( !timezonestream.atEnd() ) {
const QString timezonerawline = timezonestream.readLine();
- const QStringList timezonesplitline = timezonerawline.split('\t');
+ const QStringList timezonesplitline = timezonerawline.split(QLatin1Char('\t'));
if( timezonesplitline[0] == timezone )
{
diff --git a/tools/constellations2kml/constellations2kml.cpp b/tools/constellations2kml/constellations2kml.cpp
index 3a77e66..668505b 100644
--- a/tools/constellations2kml/constellations2kml.cpp
+++ b/tools/constellations2kml/constellations2kml.cpp
@@ -105,7 +105,7 @@ int main(int argc, char *argv[])
// Ignore Comment lines in header and
// between constellation entries
- if ( name.startsWith( '#' ) ) {
+ if (name.startsWith(QLatin1Char('#'))) {
continue;
}
@@ -122,7 +122,7 @@ int main(int argc, char *argv[])
<< " <LineString> \n"
<< " <coordinates> \n";
- starIndexes = indexList.split( ' ' );
+ starIndexes = indexList.split(QLatin1Char(' '));
QList<qreal> x;
QList<qreal> y;
QList<qreal> z;
diff --git a/tools/dateline/dateline.cpp b/tools/dateline/dateline.cpp
index 97bcd00..e741765 100644
--- a/tools/dateline/dateline.cpp
+++ b/tools/dateline/dateline.cpp
@@ -94,12 +94,11 @@ int main(int argc, char *argv[])
{
rawline = sourcestream.readLine();
- if ( !rawline.contains( QChar(' ') ) )
- {
+ if (!rawline.contains(QLatin1Char(' '))) {
qDebug() << "Line " << line << " does not contain a space separator.";
continue;
}
- splitline = rawline.split( QChar(' ') );
+ splitline = rawline.split(QLatin1Char(' '));
lonstring = splitline[0];
latstring = splitline[1];
diff --git a/tools/dso2kml/dso2kml.cpp b/tools/dso2kml/dso2kml.cpp
index be6a3e1..c1ab805 100644
--- a/tools/dso2kml/dso2kml.cpp
+++ b/tools/dso2kml/dso2kml.cpp
@@ -58,7 +58,7 @@ int main(int argc, char *argv[])
// Ignore Comment lines in header and
// between dso entries
- if ( line.startsWith( '#' ) ) {
+ if (line.startsWith(QLatin1Char('#'))) {
continue;
}
diff --git a/tools/iau2kml/iau2kml.cpp b/tools/iau2kml/iau2kml.cpp
index 1e25b98..fe93a09 100644
--- a/tools/iau2kml/iau2kml.cpp
+++ b/tools/iau2kml/iau2kml.cpp
@@ -21,11 +21,11 @@
QString escapeXml( const QString &str )
{
QString xml = str;
- xml.replace('&', "&amp;");
- xml.replace('<', "&lt;");
- xml.replace('>', "&gt;");
- xml.replace('\'', "&apos;");
- xml.replace('"', "&quot;");
+ xml.replace(QLatin1Char('&'), QStringLiteral("&amp;"));
+ xml.replace(QLatin1Char('<'), QStringLiteral("&lt;"));
+ xml.replace(QLatin1Char('>'), QStringLiteral("&gt;"));
+ xml.replace(QLatin1Char('\''), QStringLiteral("&apos;"));
+ xml.replace(QLatin1Char('"'), QStringLiteral("&quot;"));
return xml;
}
@@ -96,12 +96,12 @@ int main(int argc, char *argv[])
}
rawline = rawline.replace( "\"|", "|" );
rawline = rawline.replace( "|\"", "|" );
- if ( rawline.startsWith('\"') && rawline.endsWith('\"') ) {
+ if (rawline.startsWith(QLatin1Char('\"')) && rawline.endsWith(QLatin1Char('\"'))) {
rawline = rawline.left( rawline.length() - 1 );
rawline = rawline.right( rawline.length() - 2 );
}
- splitline = rawline.split('|');
+ splitline = rawline.split(QLatin1Char('|'));
nameString = splitline[2];
latString = splitline[3];
@@ -132,7 +132,7 @@ int main(int argc, char *argv[])
lat = latString.toFloat();
- description = description.remove('"');
+ description.remove(QLatin1Char('"'));
targetstream << " <MarblePlacemark> \n";
targetstream << " <name>" << escapeXml( nameString ) << "</name> \n";
diff --git a/tools/mbtile-import/mbtile-import.cpp b/tools/mbtile-import/mbtile-import.cpp
index 9ab8fc2..07b7594 100644
--- a/tools/mbtile-import/mbtile-import.cpp
+++ b/tools/mbtile-import/mbtile-import.cpp
@@ -42,7 +42,7 @@ void importTiles(const QString &tileDirectory, MbTileWriter &tileWriter, const Q
}
QString const tileId = tileInfo.absoluteFilePath().mid(strip);
- QStringList const tileEntries = tileId.split('/');
+ QStringList const tileEntries = tileId.split(QLatin1Char('/'));
if (tileEntries.size() == 3) {
int const x = tileEntries[1].toInt(&isNumber);
if (isNumber && x >= 0) {
@@ -98,7 +98,7 @@ int main(int argc, char** argv)
parser.showHelp(3);
}
- QStringList const tileLevels = parser.value("tilelevels").split('-');
+ QStringList const tileLevels = parser.value("tilelevels").split(QLatin1Char('-'));
QPair<int, int> tileLevelRange = QPair<int, int>(0, 20);
bool haveValidRange = false;
if (tileLevels.size() == 2) {
diff --git a/tools/osm-addresses/OsmParser.cpp b/tools/osm-addresses/OsmParser.cpp
index de64573..a84bc72 100644
--- a/tools/osm-addresses/OsmParser.cpp
+++ b/tools/osm-addresses/OsmParser.cpp
@@ -727,10 +727,10 @@ void OsmParser::writeKml( const QString &area, const QString &version, const QSt
lineStyle.setColor( color );
lineStyle.setWidth( 4 );
style->setLineStyle( lineStyle );
- style->setId( color.name().replace( '#', 'f' ) );
+ style->setId(color.name().replace(QLatin1Char('#'), QLatin1Char('f')));
GeoDataStyleMap styleMap;
- styleMap.setId( color.name().replace( '#', 'f' ) );
+ styleMap.setId(color.name().replace(QLatin1Char('#'), QLatin1Char('f')));
styleMap.insert("normal", QLatin1Char('#') + style->id());
document->addStyle( style );
diff --git a/tools/osm-simplify/TagsFilter.cpp b/tools/osm-simplify/TagsFilter.cpp
index 564db6c..45b8413 100644
--- a/tools/osm-simplify/TagsFilter.cpp
+++ b/tools/osm-simplify/TagsFilter.cpp
@@ -31,7 +31,7 @@ TagsFilter::TagsFilter(GeoDataDocument *document, const QStringList &tagsList, b
bool flag = andFlag;
QStringList::const_iterator itr = tagsList.begin();
for (; itr != tagsList.end(); ++itr) {
- QStringList currentTag = (*itr).split('=');
+ QStringList currentTag = (*itr).split(QLatin1Char('='));
QString currentKey;
QString currentValue;
if (currentTag.size() != 2) {
diff --git a/tools/osm-simplify/main.cpp b/tools/osm-simplify/main.cpp
index 3c9f83c..06942e9 100644
--- a/tools/osm-simplify/main.cpp
+++ b/tools/osm-simplify/main.cpp
@@ -253,7 +253,7 @@ int main(int argc, char *argv[])
//Parses the tags given at command line and makes a Hash of key-value pairs
qDebug()<<" Parsed tf value: "<<parser.value("tags-filter")<<endl;
- QStringList tagsList = parser.value("tags-filter").split(',');
+ QStringList tagsList = parser.value("tags-filter").split(QLatin1Char(','));
//Filters and considers only those placemarks which have all the key-value pairs given at command line
WayConcatenator concatenator(map, tagsList, parser.isSet("tags-and"));
diff --git a/tools/osm-sisyphus/jobmanager.cpp b/tools/osm-sisyphus/jobmanager.cpp
index f2fc6f0..7a6556b 100644
--- a/tools/osm-sisyphus/jobmanager.cpp
+++ b/tools/osm-sisyphus/jobmanager.cpp
@@ -74,7 +74,7 @@ void JobManager::setRegionsFile(const QString &filename)
region.setPbfFile(node.namedItem("pbf").toElement().text());
}
if (!node.namedItem("transport").isNull()) {
- QStringList input = node.namedItem("transport").toElement().text().split(',', QString::SkipEmptyParts);
+ QStringList input = node.namedItem("transport").toElement().text().split(QLatin1Char(','), QString::SkipEmptyParts);
foreach( const QString &value, input ) {
if (!region.continent().isEmpty() && !region.name().isEmpty()) {
PendingJob job;
diff --git a/tools/pntreplace/svgxmlhandler.cpp b/tools/pntreplace/svgxmlhandler.cpp
index 4cc626b..485b783 100644
--- a/tools/pntreplace/svgxmlhandler.cpp
+++ b/tools/pntreplace/svgxmlhandler.cpp
@@ -33,7 +33,7 @@ bool SVGXmlHandler::startElement(const QString& /*nspace*/,
// This requires absolute paths and repeated L commands to
// to be enforced in inkscape!
- stringlist << coordinates.mid( 1 ).split( 'L' );
+ stringlist << coordinates.mid(1).split(QLatin1Char('L'));
bool firstheader = true;
int count = 0;
@@ -41,8 +41,8 @@ bool SVGXmlHandler::startElement(const QString& /*nspace*/,
foreach ( const QString& str, stringlist ) {
float x;
float y;
- x = str.section( ',', 0, 0 ).toFloat();
- y = str.section( ',', 1, 1 ).toFloat();
+ x = str.section(QLatin1Char(','), 0, 0).toFloat();
+ y = str.section(QLatin1Char(','), 1, 1).toFloat();
short header;
short lat;
diff --git a/tools/routing-instructions/main.cpp b/tools/routing-instructions/main.cpp
index c259f8f..23f03c2 100644
--- a/tools/routing-instructions/main.cpp
+++ b/tools/routing-instructions/main.cpp
@@ -27,9 +27,9 @@ QString adjustGosmoreVersion( QTextStream &stream, WaypointParser &parser )
{
QString content = stream.readAll();
if ( !QCoreApplication::instance()->arguments().contains( "--routino" ) ) {
- QStringList lines = content.split( '\r' );
+ QStringList lines = content.split(QLatin1Char('\r'));
if ( lines.size() > 2 ) {
- QStringList fields = lines.at( lines.size()-2 ).split(',');
+ QStringList fields = lines.at( lines.size()-2 ).split(QLatin1Char(','));
parser.setFieldIndex( WaypointParser::RoadType, fields.size()-3 );
parser.setFieldIndex( WaypointParser::TotalSecondsRemaining, fields.size()-2 );
parser.setFieldIndex( WaypointParser::RoadName, fields.size()-1 );
@@ -43,7 +43,7 @@ void loadTranslations( QCoreApplication &app, QTranslator &translator )
const QString lang = QLocale::system().name();
QString code;
- int index = lang.indexOf ( '_' );
+ int index = lang.indexOf(QLatin1Char('_'));
if (lang == QLatin1String("C")) {
code = "en";
}
@@ -51,7 +51,7 @@ void loadTranslations( QCoreApplication &app, QTranslator &translator )
code = lang.left ( index );
}
else {
- index = lang.indexOf ( '@' );
+ index = lang.indexOf(QLatin1Char('@'));
if ( index != -1 )
code = lang.left ( index );
else
@@ -113,7 +113,7 @@ int main( int argc, char* argv[] )
if ( arguments.contains( "--routino" ) )
{
parser.setLineSeparator( "\n" );
- parser.setFieldSeparator( '\t' );
+ parser.setFieldSeparator(QLatin1Char('\t'));
parser.setFieldIndex( WaypointParser::RoadName, 10 );
}
else
diff --git a/tools/sentineltile/tileprocessor.cpp b/tools/sentineltile/tileprocessor.cpp
index 3d178a3..c0cb2c8 100644
--- a/tools/sentineltile/tileprocessor.cpp
+++ b/tools/sentineltile/tileprocessor.cpp
@@ -78,8 +78,8 @@ void TileProcessor::colorForFile(const QString& filePath){
// int tileCountBathymetry = pow(2, m_tileLevel);
int tileCount = pow(2, m_tileLevel);
- int xTile = filePath.section('/', -2, -2).toUInt();
- int yTile = filePath.section('/', -1).section(".",0, 0).toUInt();
+ int xTile = filePath.section(QLatin1Char('/'), -2, -2).toUInt();
+ int yTile = filePath.section(QLatin1Char('/'), -1).section(QLatin1Char('.'), 0, 0).toUInt();
int x = m_bathymetry.width() * xTile / (double)tileCount;
qreal lat_rad = atan(sinh(M_PI * (1 - 2 * yTile / (double)tileCount)));
@@ -128,7 +128,7 @@ void TileProcessor::colorForFile(const QString& filePath){
tile.save(modFilePath, "JPG", 85);
if (opacity > 0.0) {
- qDebug() << progress << filePath.section('/', -2, -2) << filePath.section('/', -1).section(".",0, 0);
+ qDebug() << progress << filePath.section(QLatin1Char('/'), -2, -2) << filePath.section(QLatin1Char('/'), -1).section(QLatin1Char('.'), 0, 0);
qDebug() << maskValueTopLeft << modFilePath;
}
}
diff --git a/tools/svg2pnt/svgxmlhandler.cpp b/tools/svg2pnt/svgxmlhandler.cpp
index 64d6f70..bef7697 100644
--- a/tools/svg2pnt/svgxmlhandler.cpp
+++ b/tools/svg2pnt/svgxmlhandler.cpp
@@ -41,7 +41,7 @@ bool SVGXmlHandler::startElement(const QString& nspace,
QStringList stringlist;
coordinates.chop(2);
- stringlist << coordinates.mid( 1 ).split( 'L' );
+ stringlist << coordinates.mid(1).split(QLatin1Char('L'));
// The last element is the first element
// stringlist.removeLast();
bool firstheader = true;
@@ -58,8 +58,8 @@ bool SVGXmlHandler::startElement(const QString& nspace,
// qDebug()<<str;
float x;
float y;
- x = str.section( ',', 0, 0 ).toFloat();
- y = str.section( ',', 1, 1 ).toFloat();
+ x = str.section(QLatin1Char(','), 0, 0).toFloat();
+ y = str.section(QLatin1Char(','), 1, 1).toFloat();
// qDebug() << "x:" << x << "y:" << y;
diff --git a/tools/tilecreator-srtm2/tccore.cpp b/tools/tilecreator-srtm2/tccore.cpp
index fa8ca97..c656587 100644
--- a/tools/tilecreator-srtm2/tccore.cpp
+++ b/tools/tilecreator-srtm2/tccore.cpp
@@ -124,8 +124,8 @@ public:
private:
QString hgtFileName( int lng, int lat ) const
{
- QChar EW( lng >= 0 ? 'E' : 'W' );
- QChar NS( lat >= 0 ? 'N' : 'S' );
+ QChar EW(QLatin1Char(lng >= 0 ? 'E' : 'W'));
+ QChar NS(QLatin1Char(lat >= 0 ? 'N' : 'S'));
QStringList dirs;
dirs << "Africa" << "Australia" << "Eurasia" << "Silands" << "North_America" << "South_America";