summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFriedrich W. H. Kossebau <kossebau@kde.org>2016-08-24 22:32:07 (GMT)
committerFriedrich W. H. Kossebau <kossebau@kde.org>2016-08-24 22:32:07 (GMT)
commit598dc83ea6c51ad172088e150c7bfd538aedcb9e (patch)
treea12256230062cbb5c59b7c72a7deb69f5e7f582e
parent5c53d7fc46c6dbd0de2aa2839d60f03ffb27d582 (diff)
Use QLatin1Char in string calculation expressions
-rw-r--r--examples/cpp/marble-game/ClickOnThat.cpp4
-rw-r--r--src/apps/marble-kde/marble_part.cpp4
-rw-r--r--src/apps/marble-qt/QtMainWindow.cpp4
-rw-r--r--src/lib/marble/BookmarkManager.cpp2
-rw-r--r--src/lib/marble/BookmarkManagerDialog.cpp4
-rw-r--r--src/lib/marble/CurrentLocationWidget.cpp2
-rw-r--r--src/lib/marble/DataMigration.cpp6
-rw-r--r--src/lib/marble/DiscCache.cpp2
-rw-r--r--src/lib/marble/FileLoader.cpp8
-rw-r--r--src/lib/marble/FileStoragePolicy.cpp4
-rw-r--r--src/lib/marble/MapThemeDownloadDialog.cpp2
-rw-r--r--src/lib/marble/MapThemeManager.cpp27
-rw-r--r--src/lib/marble/MapWizard.cpp2
-rw-r--r--src/lib/marble/MarbleDirs.cpp16
-rw-r--r--src/lib/marble/MarbleModel.cpp10
-rw-r--r--src/lib/marble/MarbleWidgetPopupMenu.cpp2
-rw-r--r--src/lib/marble/MovieCaptureDialog.cpp6
-rw-r--r--src/lib/marble/NewstuffModel.cpp2
-rw-r--r--src/lib/marble/PluginManager.cpp6
-rw-r--r--src/lib/marble/PositionTracking.cpp4
-rw-r--r--src/lib/marble/RemoteIconLoader.cpp2
-rw-r--r--src/lib/marble/StyleBuilder.cpp4
-rw-r--r--src/lib/marble/TemplateDocument.cpp2
-rw-r--r--src/lib/marble/TileCreator.cpp6
-rw-r--r--src/lib/marble/TourCaptureDialog.cpp6
-rw-r--r--src/lib/marble/cloudsync/BookmarkSyncManager.cpp2
-rw-r--r--src/lib/marble/cloudsync/OwncloudSyncBackend.cpp4
-rw-r--r--src/lib/marble/cloudsync/RouteItemDelegate.cpp2
-rw-r--r--src/lib/marble/cloudsync/RouteSyncManager.cpp2
-rw-r--r--src/lib/marble/geodata/data/GeoDataObject.cpp2
-rw-r--r--src/lib/marble/geodata/parser/GeoParser.cpp4
-rw-r--r--src/lib/marble/geodata/writers/kml/KmlPointTagWriter.cpp12
-rw-r--r--src/lib/marble/geodata/writers/kml/KmlTrackWriter.cpp5
-rw-r--r--src/lib/marble/osm/OsmTagEditorWidget.cpp2
-rw-r--r--src/lib/marble/osm/OsmTagEditorWidget_p.cpp2
-rw-r--r--src/lib/marble/routing/instructions/RoutingInstruction.cpp4
-rw-r--r--src/plugins/positionprovider/flightgear/FlightGearPositionProviderPlugin.cpp2
-rw-r--r--src/plugins/render/aprs/AprsPlugin.cpp8
-rw-r--r--src/plugins/render/earthquake/EarthquakeModel.cpp2
-rw-r--r--src/plugins/render/elevationprofilefloatitem/ElevationProfileFloatItem.cpp6
-rw-r--r--src/plugins/render/elevationprofilemarker/ElevationProfileMarker.cpp2
-rw-r--r--src/plugins/render/foursquare/FoursquareModel.cpp2
-rw-r--r--src/plugins/render/measure/MeasureToolPlugin.cpp2
-rw-r--r--src/plugins/render/opencachingcom/OpenCachingComItem.cpp2
-rw-r--r--src/plugins/render/opencachingcom/OpenCachingComModel.cpp6
-rw-r--r--src/plugins/render/opendesktop/OpenDesktopModel.cpp2
-rw-r--r--src/plugins/render/overviewmap/OverviewMap.cpp2
-rw-r--r--src/plugins/render/photo/PhotoPluginModel.cpp37
-rw-r--r--src/plugins/render/postalcode/PostalCodeModel.cpp6
-rw-r--r--src/plugins/render/progress/ProgressFloatItem.cpp2
-rw-r--r--src/plugins/render/stars/StarsPlugin.cpp2
-rw-r--r--src/plugins/render/weather/GeoNamesWeatherService.cpp2
-rw-r--r--src/plugins/render/weather/WeatherData.cpp4
-rw-r--r--src/plugins/render/weather/WeatherItem.cpp24
-rw-r--r--src/plugins/runner/cyclestreets/CycleStreetsRunner.cpp4
-rw-r--r--src/plugins/runner/gpx/handlers/GPXgpxTagHandler.cpp6
-rw-r--r--src/plugins/runner/kml/KmlDocument.cpp2
-rw-r--r--src/plugins/runner/kml/KmzHandler.cpp4
-rw-r--r--src/plugins/runner/local-osm-search/LocalOsmSearchRunner.cpp4
-rw-r--r--src/plugins/runner/local-osm-search/OsmDatabase.cpp4
-rw-r--r--src/plugins/runner/mapquest/MapQuestRunner.cpp6
-rw-r--r--src/plugins/runner/monav/MonavConfigWidget.cpp2
-rw-r--r--src/plugins/runner/nominatim-search/OsmNominatimSearchRunner.cpp2
-rw-r--r--src/plugins/runner/open-source-routing-machine/OSRMRunner.cpp6
-rw-r--r--src/plugins/runner/osm/OsmWay.cpp2
-rw-r--r--tools/asc2kml/asc2kml.cpp3
-rw-r--r--tools/osm-addresses/OsmParser.cpp6
-rw-r--r--tools/osm-simplify/main.cpp2
-rw-r--r--tools/osm-sisyphus/job.cpp6
-rw-r--r--tools/osm-sisyphus/jobqueue.cpp2
-rw-r--r--tools/osm-sisyphus/upload.cpp8
-rw-r--r--tools/poly2kml/main.cpp4
-rw-r--r--tools/speaker-files/main.cpp2
-rw-r--r--tools/tilecreator-srtm2/tccore.cpp4
74 files changed, 183 insertions, 187 deletions
diff --git a/examples/cpp/marble-game/ClickOnThat.cpp b/examples/cpp/marble-game/ClickOnThat.cpp
index 515d8fb..b256968 100644
--- a/examples/cpp/marble-game/ClickOnThat.cpp
+++ b/examples/cpp/marble-game/ClickOnThat.cpp
@@ -182,13 +182,13 @@ void ClickOnThat::initiateGame()
GeoDataStyleMap styleMap;
styleMap.setId("default-map");
- styleMap.insert( "normal", QString("#").append( pinStyle->id()) );
+ styleMap.insert("normal", QLatin1Char('#') + pinStyle->id());
d->m_selectPinDocument->addStyle( pinStyle );
d->m_selectPinDocument->addStyleMap( styleMap );
d->m_selectPinDocument->append( pinPlacemark );
- pinPlacemark->setStyleUrl( QString("#").append(styleMap.id()) );
+ pinPlacemark->setStyleUrl(QLatin1Char('#') + styleMap.id());
d->m_selectPinDocument->setVisible( false );
// Add this document to treeModel
diff --git a/src/apps/marble-kde/marble_part.cpp b/src/apps/marble-kde/marble_part.cpp
index 657aec5..fead748 100644
--- a/src/apps/marble-kde/marble_part.cpp
+++ b/src/apps/marble-kde/marble_part.cpp
@@ -243,13 +243,13 @@ bool MarblePart::openFile()
continue;
const QStringList fileExtensions = plugin->fileExtensions().replaceInStrings( QRegExp( "^" ), "*." );
- const QString filter = QString( "%1 (%2)" ).arg( plugin->fileFormatDescription() ).arg( fileExtensions.join( " " ) );
+ const QString filter = plugin->fileFormatDescription() + QLatin1String(" (") + fileExtensions.join(QLatin1Char(' ')) + QLatin1Char(')');
filters << filter;
allFileExtensions << fileExtensions;
}
allFileExtensions.sort(); // sort since file extensions are visible under Windows
- const QString allFileTypes = QString( "%1 (%2)" ).arg( i18n( "All Supported Files" ) ).arg( allFileExtensions.join( " " ) );
+ const QString allFileTypes = i18n("All Supported Files") + QLatin1String(" (") + allFileExtensions.join(QLatin1Char(' ')) + QLatin1Char(')');
filters.sort();
filters.prepend( allFileTypes );
diff --git a/src/apps/marble-qt/QtMainWindow.cpp b/src/apps/marble-qt/QtMainWindow.cpp
index b6115e4..ca441c2 100644
--- a/src/apps/marble-qt/QtMainWindow.cpp
+++ b/src/apps/marble-qt/QtMainWindow.cpp
@@ -995,13 +995,13 @@ void MainWindow::openFile()
continue;
const QStringList fileExtensions = plugin->fileExtensions().replaceInStrings( QRegExp( "^" ), "*." );
- const QString filter = QString( "%1 (%2)" ).arg( plugin->fileFormatDescription() ).arg( fileExtensions.join( " " ) );
+ const QString filter = plugin->fileFormatDescription() + QLatin1String(" (") + fileExtensions.join(QLatin1Char(' ')) + QLatin1Char(')');
filters << filter;
allFileExtensions << fileExtensions;
}
allFileExtensions.sort(); // sort since file extensions are visible under Windows
- const QString allFileTypes = QString( "%1 (%2)" ).arg( tr( "All Supported Files" ) ).arg( allFileExtensions.join( " " ) );
+ const QString allFileTypes = tr("All Supported Files") + QLatin1String(" (") + allFileExtensions.join(QLatin1Char(' ')) + QLatin1Char(')');
filters.sort();
filters.prepend( allFileTypes );
diff --git a/src/lib/marble/BookmarkManager.cpp b/src/lib/marble/BookmarkManager.cpp
index e87685c..81f8409 100644
--- a/src/lib/marble/BookmarkManager.cpp
+++ b/src/lib/marble/BookmarkManager.cpp
@@ -246,7 +246,7 @@ void BookmarkManager::setStyleBuilder(const StyleBuilder *styleBuilder)
bool BookmarkManager::updateBookmarkFile()
{
- QString absoluteLocalFilePath = MarbleDirs::localPath() + '/' + d->m_bookmarkFileRelativePath ;
+ const QString absoluteLocalFilePath = MarbleDirs::localPath() + QLatin1Char('/') + d->m_bookmarkFileRelativePath;
if ( ! d->m_bookmarkFileRelativePath.isNull() ) {
QFile file( absoluteLocalFilePath );
diff --git a/src/lib/marble/BookmarkManagerDialog.cpp b/src/lib/marble/BookmarkManagerDialog.cpp
index a97324b..6c220e3 100644
--- a/src/lib/marble/BookmarkManagerDialog.cpp
+++ b/src/lib/marble/BookmarkManagerDialog.cpp
@@ -322,9 +322,7 @@ GeoDataContainer *BookmarkManagerDialogPrivate::selectedFolder()
void BookmarkManagerDialogPrivate::initializeFoldersView( GeoDataTreeModel* treeModel )
{
m_folderFilterModel.setFilterKeyColumn( 1 );
- QString regexp = GeoDataTypes::GeoDataFolderType;
- regexp += '|';
- regexp += GeoDataTypes::GeoDataDocumentType;
+ const QString regexp = QLatin1String(GeoDataTypes::GeoDataFolderType) + QLatin1Char('|') + QLatin1String(GeoDataTypes::GeoDataDocumentType);
m_folderFilterModel.setFilterRegExp( regexp );
m_folderFilterModel.setSourceModel( treeModel );
diff --git a/src/lib/marble/CurrentLocationWidget.cpp b/src/lib/marble/CurrentLocationWidget.cpp
index 079c978..b46f46f 100644
--- a/src/lib/marble/CurrentLocationWidget.cpp
+++ b/src/lib/marble/CurrentLocationWidget.cpp
@@ -308,7 +308,7 @@ void CurrentLocationWidgetPrivate::receiveGpsCoordinates( const GeoDataCoordinat
const QString distanceString = QString( "%1 %2" ).arg( length, 0, 'f', 1, QChar(' ') ).arg( distanceUnitString );
html = html.arg( position.lonToString() ).arg( position.latToString() );
- html = html.arg( altitudeString ).arg( speedString + ' ' + unitString );
+ html = html.arg(altitudeString).arg(speedString + QLatin1Char(' ') + unitString);
html = html.arg( distanceString );
m_currentLocationUi.locationLabel->setText( html );
m_currentLocationUi.showTrackCheckBox->setEnabled( true );
diff --git a/src/lib/marble/DataMigration.cpp b/src/lib/marble/DataMigration.cpp
index 2e9f38f..426567f 100644
--- a/src/lib/marble/DataMigration.cpp
+++ b/src/lib/marble/DataMigration.cpp
@@ -152,7 +152,7 @@ void DataMigration::moveFiles( const QString& source, const QString& target )
else {
// Add child directories to the stack
foreach( const QString& childDir, childDirs ) {
- dirs.push( sourceDirPath + '/' + childDir );
+ dirs.push(sourceDirPath + QLatin1Char('/') + childDir);
progressSliceSizeStack.push( childSliceSize );
}
@@ -168,9 +168,7 @@ void DataMigration::moveFiles( const QString& source, const QString& target )
return;
}
- QString sourceFilePath = sourceDirPath;
- sourceFilePath += '/';
- sourceFilePath += file;
+ const QString sourceFilePath = sourceDirPath + QLatin1Char('/') + file;
if( !sourceFilePath.startsWith( sourcePath ) ) {
continue;
diff --git a/src/lib/marble/DiscCache.cpp b/src/lib/marble/DiscCache.cpp
index 0c97f60..f011078 100644
--- a/src/lib/marble/DiscCache.cpp
+++ b/src/lib/marble/DiscCache.cpp
@@ -169,7 +169,7 @@ QString DiscCache::keyToFileName( const QString &key ) const
QString fileName( key );
fileName.replace( '/', '_' );
- return m_CacheDirectory + '/' + fileName;
+ return m_CacheDirectory + QLatin1Char('/') + fileName;
}
void DiscCache::cleanup()
diff --git a/src/lib/marble/FileLoader.cpp b/src/lib/marble/FileLoader.cpp
index a4e0226..11b0fd0 100644
--- a/src/lib/marble/FileLoader.cpp
+++ b/src/lib/marble/FileLoader.cpp
@@ -53,7 +53,7 @@ public:
{
if( m_style ) {
m_styleMap->setId("default-map");
- m_styleMap->insert("normal", QString("#").append(m_style->id()));
+ m_styleMap->insert("normal", QLatin1Char('#') + m_style->id());
}
}
@@ -146,11 +146,11 @@ void FileLoader::run()
// determine source, cache names
if ( fileinfo.isAbsolute() ) {
// We got an _absolute_ path now: e.g. "/patrick.kml"
- defaultSourceName = path + '/' + name + '.' + suffix;
+ defaultSourceName = path + QLatin1Char('/') + name + QLatin1Char('.') + suffix;
}
else if ( d->m_filepath.contains( '/' ) ) {
// _relative_ path: "maps/mars/viking/patrick.kml"
- defaultSourceName = MarbleDirs::path( path + '/' + name + '.' + suffix );
+ defaultSourceName = MarbleDirs::path(path + QLatin1Char('/') + name + QLatin1Char('.') + suffix);
if ( !QFile::exists( defaultSourceName ) ) {
defaultSourceName = MarbleDirs::path(path + QLatin1Char('/') + name + QLatin1String(".cache"));
}
@@ -264,7 +264,7 @@ void FileLoaderPrivate::createFilterProperties( GeoDataContainer *container )
placemark->geometry()->nodeType() != GeoDataTypes::GeoDataPointType
&& m_documentRole == MapDocument
&& m_style ) {
- placemark->setStyleUrl( QString("#").append( m_styleMap->id() ) );
+ placemark->setStyleUrl(QLatin1Char('#') + m_styleMap->id());
}
// Mountain (H), Volcano (V), Shipwreck (W)
diff --git a/src/lib/marble/FileStoragePolicy.cpp b/src/lib/marble/FileStoragePolicy.cpp
index 1e14286..579f61b 100644
--- a/src/lib/marble/FileStoragePolicy.cpp
+++ b/src/lib/marble/FileStoragePolicy.cpp
@@ -42,14 +42,14 @@ FileStoragePolicy::~FileStoragePolicy()
bool FileStoragePolicy::fileExists( const QString &fileName ) const
{
- const QString fullName( m_dataDirectory + '/' + fileName );
+ const QString fullName = m_dataDirectory + QLatin1Char('/') + fileName;
return QFile::exists( fullName );
}
bool FileStoragePolicy::updateFile( const QString &fileName, const QByteArray &data )
{
QFileInfo const dirInfo( fileName );
- QString const fullName = dirInfo.isAbsolute() ? fileName : m_dataDirectory + '/' + fileName;
+ QString const fullName = dirInfo.isAbsolute() ? fileName : m_dataDirectory + QLatin1Char('/') + fileName;
// Create directory if it doesn't exist yet...
QFileInfo info( fullName );
diff --git a/src/lib/marble/MapThemeDownloadDialog.cpp b/src/lib/marble/MapThemeDownloadDialog.cpp
index 3cca4a2..8b7df31 100644
--- a/src/lib/marble/MapThemeDownloadDialog.cpp
+++ b/src/lib/marble/MapThemeDownloadDialog.cpp
@@ -144,7 +144,7 @@ void MapItemDelegate::paint( QPainter *painter, const QStyleOptionViewItem &opti
progressBarOption.minimum = 0;
progressBarOption.maximum = 100;
progressBarOption.progress = ( 100.0 * progress / total );
- progressBarOption.text = QString::number( progressBarOption.progress ) + '%';
+ progressBarOption.text = QString::number(progressBarOption.progress) + QLatin1Char('%');
progressBarOption.textVisible = true;
QApplication::style()->drawControl(QStyle::CE_ProgressBar, &progressBarOption, painter);
diff --git a/src/lib/marble/MapThemeManager.cpp b/src/lib/marble/MapThemeManager.cpp
index 8c52275..ae96d0c 100644
--- a/src/lib/marble/MapThemeManager.cpp
+++ b/src/lib/marble/MapThemeManager.cpp
@@ -216,7 +216,7 @@ bool MapThemeManager::Private::deleteDirectory( const QString& directory )
GeoSceneDocument* MapThemeManager::Private::loadMapThemeFile( const QString& mapThemeStringID )
{
- const QString mapThemePath = mapDirName + '/' + mapThemeStringID;
+ const QString mapThemePath = mapDirName + QLatin1Char('/') + mapThemeStringID;
const QString dgmlPath = MarbleDirs::path( mapThemePath );
// Check whether file exists
@@ -252,8 +252,8 @@ GeoSceneDocument* MapThemeManager::Private::loadMapThemeFile( const QString& map
QStringList MapThemeManager::Private::pathsToWatch()
{
QStringList result;
- const QString localMapPathName = MarbleDirs::localPath() + '/' + mapDirName;
- const QString systemMapPathName = MarbleDirs::systemPath() + '/' + mapDirName;
+ const QString localMapPathName = MarbleDirs::localPath() + QLatin1Char('/') + mapDirName;
+ const QString systemMapPathName = MarbleDirs::systemPath() + QLatin1Char('/') + mapDirName;
if( !QDir().exists( localMapPathName ) ) {
QDir().mkpath( localMapPathName );
@@ -268,7 +268,7 @@ QStringList MapThemeManager::Private::pathsToWatch()
QStringList MapThemeManager::Private::findMapThemes( const QString& basePath )
{
- const QString mapPathName = basePath + '/' + mapDirName;
+ const QString mapPathName = basePath + QLatin1Char('/') + mapDirName;
QDir paths = QDir( mapPathName );
@@ -279,14 +279,14 @@ QStringList MapThemeManager::Private::findMapThemes( const QString& basePath )
QStringList mapDirs;
for ( int planet = 0; planet < mapPaths.size(); ++planet ) {
- QDir themeDir = QDir( mapPathName + '/' + mapPaths.at( planet ) );
+ QDir themeDir = QDir(mapPathName + QLatin1Char('/') + mapPaths.at(planet));
QStringList themeMapPaths = themeDir.entryList(
QStringList( "*" ),
QDir::AllDirs |
QDir::NoSymLinks |
QDir::NoDotAndDotDot );
for ( int theme = 0; theme < themeMapPaths.size(); ++theme ) {
- mapDirs << mapPathName + '/' + mapPaths.at( planet ) + '/'
+ mapDirs << mapPathName + QLatin1Char('/') + mapPaths.at(planet) + QLatin1Char('/')
+ themeMapPaths.at( theme );
}
}
@@ -294,7 +294,7 @@ QStringList MapThemeManager::Private::findMapThemes( const QString& basePath )
QStringList mapFiles;
QStringListIterator it( mapDirs );
while ( it.hasNext() ) {
- QString themeDir = it.next() + '/';
+ QString themeDir = it.next() + QLatin1Char('/');
QString themeDirName = QDir( themeDir ).path().section( '/', -2, -1 );
QStringList tmp = QDir( themeDir ).entryList( QStringList( "*.dgml" ),
QDir::Files | QDir::NoSymLinks );
@@ -302,7 +302,7 @@ QStringList MapThemeManager::Private::findMapThemes( const QString& basePath )
QStringListIterator k( tmp );
while ( k.hasNext() ) {
QString themeXml = k.next();
- mapFiles << themeDirName + '/' + themeXml;
+ mapFiles << themeDirName + QLatin1Char('/') + themeXml;
}
}
}
@@ -358,10 +358,9 @@ QList<QStandardItem *> MapThemeManager::Private::createMapThemeRow( QString cons
}
QPixmap themeIconPixmap;
- QString relativePath;
- relativePath = mapDirName + '/'
- + mapTheme->head()->target() + '/' + mapTheme->head()->theme() + '/'
+ QString relativePath = mapDirName + QLatin1Char('/')
+ + mapTheme->head()->target() + QLatin1Char('/') + mapTheme->head()->theme() + QLatin1Char('/')
+ mapTheme->head()->icon()->pixmap();
themeIconPixmap.load( MarbleDirs::path( relativePath ) );
@@ -507,7 +506,7 @@ void MapThemeManager::Private::addMapThemePaths( const QString& mapPathName, QSt
| QDir::NoDotAndDotDot );
QStringListIterator itOrb( orbDirNames );
while ( itOrb.hasNext() ) {
- QString orbPathName = mapPathName + '/' + itOrb.next();
+ const QString orbPathName = mapPathName + QLatin1Char('/') + itOrb.next();
result << orbPathName;
QDir orbPath( orbPathName );
@@ -517,7 +516,7 @@ void MapThemeManager::Private::addMapThemePaths( const QString& mapPathName, QSt
| QDir::NoDotAndDotDot );
QStringListIterator itThemeDir( themeDirNames );
while ( itThemeDir.hasNext() ) {
- QString themePathName = orbPathName + '/' + itThemeDir.next();
+ const QString themePathName = orbPathName + QLatin1Char('/') + itThemeDir.next();
result << themePathName;
QDir themePath( themePathName );
@@ -526,7 +525,7 @@ void MapThemeManager::Private::addMapThemePaths( const QString& mapPathName, QSt
| QDir::NoSymLinks );
QStringListIterator itThemeFile( themeFileNames );
while ( itThemeFile.hasNext() ) {
- QString themeFilePathName = themePathName + '/' + itThemeFile.next();
+ const QString themeFilePathName = themePathName + QLatin1Char('/') + itThemeFile.next();
result << themeFilePathName;
}
}
diff --git a/src/lib/marble/MapWizard.cpp b/src/lib/marble/MapWizard.cpp
index 9c8b6df..a03a171 100644
--- a/src/lib/marble/MapWizard.cpp
+++ b/src/lib/marble/MapWizard.cpp
@@ -811,7 +811,7 @@ GeoSceneDocument* MapWizard::createDocument()
QString image = d->uiWidget.lineEditSource->text();
d->format = image.right( image.length() - image.lastIndexOf( '.' ) - 1 ).toLower();
texture->setFileFormat( d->format.toUpper() );
- texture->setInstallMap( document->head()->theme() + '.' + d->format );
+ texture->setInstallMap(document->head()->theme() + QLatin1Char('.') + d->format);
texture->setServerLayout( new MarbleServerLayout( texture ) );
texture->setProjection( GeoSceneTileDataset::Equirectangular );
int imageWidth = QImage( image ).width();
diff --git a/src/lib/marble/MarbleDirs.cpp b/src/lib/marble/MarbleDirs.cpp
index 83980e9..0cd265c 100644
--- a/src/lib/marble/MarbleDirs.cpp
+++ b/src/lib/marble/MarbleDirs.cpp
@@ -54,8 +54,8 @@ MarbleDirs::MarbleDirs()
QString MarbleDirs::path( const QString& relativePath )
{
- QString localpath = localPath() + '/' + relativePath; // local path
- QString systempath = systemPath() + '/' + relativePath; // system path
+ QString localpath = localPath() + QLatin1Char('/') + relativePath; // local path
+ QString systempath = systemPath() + QLatin1Char('/') + relativePath; // system path
QString fullpath = systempath;
@@ -68,8 +68,8 @@ QString MarbleDirs::path( const QString& relativePath )
QString MarbleDirs::pluginPath( const QString& relativePath )
{
- QString localpath = pluginLocalPath() + QDir::separator() + relativePath; // local path
- QString systempath = pluginSystemPath() + QDir::separator() + relativePath; // system path
+ const QString localpath = pluginLocalPath() + QDir::separator() + relativePath; // local path
+ const QString systempath = pluginSystemPath() + QDir::separator() + relativePath; // system path
QString fullpath = systempath;
@@ -82,8 +82,8 @@ QString MarbleDirs::pluginPath( const QString& relativePath )
QStringList MarbleDirs::entryList( const QString& relativePath, QDir::Filters filters )
{
- QStringList filesLocal = QDir( MarbleDirs::localPath() + '/' + relativePath ).entryList(filters);
- QStringList filesSystem = QDir( MarbleDirs::systemPath() + '/' + relativePath ).entryList(filters);
+ QStringList filesLocal = QDir(MarbleDirs::localPath() + QLatin1Char('/') + relativePath).entryList(filters);
+ QStringList filesSystem = QDir(MarbleDirs::systemPath() + QLatin1Char('/') + relativePath).entryList(filters);
QStringList allFiles( filesLocal );
allFiles << filesSystem;
@@ -101,8 +101,8 @@ QStringList MarbleDirs::entryList( const QString& relativePath, QDir::Filters fi
QStringList MarbleDirs::pluginEntryList( const QString& relativePath, QDir::Filters filters )
{
- QStringList filesLocal = QDir( MarbleDirs::pluginLocalPath() + '/' + relativePath ).entryList(filters);
- QStringList filesSystem = QDir( MarbleDirs::pluginSystemPath() + '/' + relativePath ).entryList(filters);
+ QStringList filesLocal = QDir(MarbleDirs::pluginLocalPath() + QLatin1Char('/') + relativePath).entryList(filters);
+ QStringList filesSystem = QDir(MarbleDirs::pluginSystemPath() + QLatin1Char('/') + relativePath).entryList(filters);
QStringList allFiles( filesLocal );
allFiles << filesSystem;
diff --git a/src/lib/marble/MarbleModel.cpp b/src/lib/marble/MarbleModel.cpp
index 78f668c..08d125f 100644
--- a/src/lib/marble/MarbleModel.cpp
+++ b/src/lib/marble/MarbleModel.cpp
@@ -461,7 +461,7 @@ void MarbleModelPrivate::addHighlightStyle(GeoDataDocument* doc)
|| highlightPenColor.isValid() )
{
GeoDataStyleMap styleMap = doc->styleMap("default-map");
- styleMap.insert( "highlight", QString("#").append(highlightStyle->id()) );
+ styleMap.insert("highlight", QLatin1Char('#') + highlightStyle->id());
doc->addStyle( highlightStyle );
doc->addStyleMap( styleMap );
}
@@ -474,7 +474,7 @@ void MarbleModelPrivate::assignNewStyle( const QString &filePath, const GeoDataS
Q_ASSERT( doc );
GeoDataStyleMap styleMap;
styleMap.setId("default-map");
- styleMap.insert( "normal", QString("#").append(style->id()) );
+ styleMap.insert("normal", QLatin1Char('#') + style->id());
doc->addStyleMap( styleMap );
doc->addStyle( style );
@@ -490,7 +490,7 @@ void MarbleModelPrivate::assignNewStyle( const QString &filePath, const GeoDataS
if ( placemark->geometry()->nodeType() != GeoDataTypes::GeoDataTrackType &&
placemark->geometry()->nodeType() != GeoDataTypes::GeoDataPointType )
{
- placemark->setStyleUrl( QString("#").append( styleMap.id() ) );
+ placemark->setStyleUrl(QLatin1Char('#') + styleMap.id());
}
}
}
@@ -867,7 +867,7 @@ void MarbleModelPrivate::assignFillColors( const QString &filePath ) {
style->setId( "default" );
GeoDataStyleMap styleMap;
styleMap.setId("default-map");
- styleMap.insert( "normal", QString("#").append(style->id()) );
+ styleMap.insert("normal", QLatin1Char('#') + style->id());
doc->addStyle( style );
doc->addStyleMap( styleMap );
@@ -881,7 +881,7 @@ void MarbleModelPrivate::assignFillColors( const QString &filePath ) {
if ( placemark->geometry()->nodeType() != GeoDataTypes::GeoDataTrackType &&
placemark->geometry()->nodeType() != GeoDataTypes::GeoDataPointType )
{
- placemark->setStyleUrl( QString("#").append( styleMap.id() ) );
+ placemark->setStyleUrl(QLatin1Char('#') + styleMap.id());
}
}
}
diff --git a/src/lib/marble/MarbleWidgetPopupMenu.cpp b/src/lib/marble/MarbleWidgetPopupMenu.cpp
index 36175fc..c1e9db9 100644
--- a/src/lib/marble/MarbleWidgetPopupMenu.cpp
+++ b/src/lib/marble/MarbleWidgetPopupMenu.cpp
@@ -404,7 +404,7 @@ void MarbleWidgetPopupMenu::Private::setupDialogCity( PopupLayer *popup, const G
if(dst.startsWith('-')) {
doc["timezone"] = dst;
} else {
- doc["timezone"] = '+'+dst;
+ doc["timezone"] = QLatin1Char('+') + dst;
}
const QString flagPath = MarbleDirs::path(
diff --git a/src/lib/marble/MovieCaptureDialog.cpp b/src/lib/marble/MovieCaptureDialog.cpp
index 8a5ab7e..0c41ef2 100644
--- a/src/lib/marble/MovieCaptureDialog.cpp
+++ b/src/lib/marble/MovieCaptureDialog.cpp
@@ -76,12 +76,14 @@ void MovieCaptureDialog::loadDestinationFile()
bool supported = false;
foreach(const MovieFormat &format, formats) {
- if (destination.endsWith('.'+format.extension()))
+ if (destination.endsWith(QLatin1Char('.') + format.extension())) {
supported = true;
+ break;
+ }
}
if (!supported) {
- QString formatsExtensions = '.' + formats.at( 0 ).extension();
+ QString formatsExtensions = QLatin1Char('.') + formats.at(0).extension();
for( int i = 1; i < formats.size(); ++i )
{
formatsExtensions += QLatin1String(", .") + formats.at(i).extension();
diff --git a/src/lib/marble/NewstuffModel.cpp b/src/lib/marble/NewstuffModel.cpp
index 0fd4fee..52775ee 100644
--- a/src/lib/marble/NewstuffModel.cpp
+++ b/src/lib/marble/NewstuffModel.cpp
@@ -883,7 +883,7 @@ void NewstuffModelPrivate::updateRegistry(const QStringList &files)
foreach( const QString &file, files ) {
QDomNode fileNode = node.appendChild( m_registryDocument.createElement( "installedfile" ) );
- fileNode.appendChild( m_registryDocument.createTextNode( m_targetDirectory + '/' + file ) );
+ fileNode.appendChild(m_registryDocument.createTextNode(m_targetDirectory + QLatin1Char('/') + file));
}
saveRegistry();
diff --git a/src/lib/marble/PluginManager.cpp b/src/lib/marble/PluginManager.cpp
index 94e489c..0c92f64 100644
--- a/src/lib/marble/PluginManager.cpp
+++ b/src/lib/marble/PluginManager.cpp
@@ -297,12 +297,12 @@ void PluginManagerPrivate::loadPlugins()
}
foreach (const QString & file, copyList) {
- QString const target = MarbleDirs::pluginLocalPath() + '/' + file;
- if (QFileInfo(MarbleDirs::pluginSystemPath() + '/' + file).isDir()) {
+ QString const target = MarbleDirs::pluginLocalPath() + QLatin1Char('/') + file;
+ if (QFileInfo(MarbleDirs::pluginSystemPath() + QLatin1Char('/') + file).isDir()) {
pluginHome.mkpath(target);
}
else {
- QFile temporaryFile(MarbleDirs::pluginSystemPath() + '/' + file);
+ QFile temporaryFile(MarbleDirs::pluginSystemPath() + QLatin1Char('/') + file);
temporaryFile.copy(target);
QFileInfo targetFile(target);
d->m_pluginPaths << targetFile.canonicalFilePath();
diff --git a/src/lib/marble/PositionTracking.cpp b/src/lib/marble/PositionTracking.cpp
index 94c76bd..c8b5a93 100644
--- a/src/lib/marble/PositionTracking.cpp
+++ b/src/lib/marble/PositionTracking.cpp
@@ -164,12 +164,12 @@ PositionTracking::PositionTracking( GeoDataTreeModel *model )
GeoDataStyleMap styleMap;
styleMap.setId("map-track");
- styleMap.insert("normal", QString("#").append(style->id()));
+ styleMap.insert("normal", QLatin1Char('#') + style->id());
d->m_document.addStyleMap(styleMap);
d->m_document.addStyle(style);
d->m_document.append( d->m_currentTrackPlacemark );
- d->m_currentTrackPlacemark->setStyleUrl(QString("#").append(styleMap.id()));
+ d->m_currentTrackPlacemark->setStyleUrl(QLatin1Char('#') + styleMap.id());
d->m_treeModel->addDocument( &d->m_document );
}
diff --git a/src/lib/marble/RemoteIconLoader.cpp b/src/lib/marble/RemoteIconLoader.cpp
index 824c15e..877a8e4 100644
--- a/src/lib/marble/RemoteIconLoader.cpp
+++ b/src/lib/marble/RemoteIconLoader.cpp
@@ -102,7 +102,7 @@ QString RemoteIconLoaderPrivate::cacheFileName( const QUrl& url ) const
{
const QString suffix = QFileInfo(url.path()).suffix();
const QByteArray hash = QCryptographicHash::hash( url.toEncoded(), QCryptographicHash::Md5 ).toHex();
- const QString fileName = QString::fromLatin1(hash) + '.' + suffix;
+ const QString fileName = QString::fromLatin1(hash) + QLatin1Char('.') + suffix;
return fileName;
}
diff --git a/src/lib/marble/StyleBuilder.cpp b/src/lib/marble/StyleBuilder.cpp
index dcf6124..42315b5 100644
--- a/src/lib/marble/StyleBuilder.cpp
+++ b/src/lib/marble/StyleBuilder.cpp
@@ -822,9 +822,9 @@ QString StyleBuilder::Private::createPaintLayerItem(const QString &itemType, Geo
{
QString const category = visualCategoryName(visualCategory);
if (subType.isEmpty()) {
- return QString("%1/%2").arg(itemType).arg(category);
+ return itemType + QLatin1Char('/') + category;
} else {
- return QString("%1/%2/%3").arg(itemType).arg(category).arg(subType);
+ return itemType + QLatin1Char('/') + category + QLatin1Char('/') + subType;
}
}
diff --git a/src/lib/marble/TemplateDocument.cpp b/src/lib/marble/TemplateDocument.cpp
index 6e1a32d..76d6c7c 100644
--- a/src/lib/marble/TemplateDocument.cpp
+++ b/src/lib/marble/TemplateDocument.cpp
@@ -95,7 +95,7 @@ QString TemplateDocument::finalText() const
typedef QMap<QString, QString>::ConstIterator ConstIterator;
ConstIterator end = d->templateEntries.constEnd();
for (ConstIterator i = d->templateEntries.constBegin(); i != end; i++) {
- ready.replace('%' + i.key() + '%', i.value());
+ ready.replace(QLatin1Char('%') + i.key() + QLatin1Char('%'), i.value());
}
d->processTemplateIncludes(ready);
return ready;
diff --git a/src/lib/marble/TileCreator.cpp b/src/lib/marble/TileCreator.cpp
index 4a1e154..8525125 100644
--- a/src/lib/marble/TileCreator.cpp
+++ b/src/lib/marble/TileCreator.cpp
@@ -171,7 +171,7 @@ TileCreator::TileCreator(const QString& sourceDir, const QString& installMap,
// If the sourceDir starts with a '/' assume an absolute path.
// Otherwise assume a relative marble data path
if ( QDir::isAbsolutePath( sourceDir ) ) {
- sourcePath = sourceDir + '/' + installMap;
+ sourcePath = sourceDir + QLatin1Char('/') + installMap;
mDebug() << "Trying absolute path*:" << sourcePath;
}
else {
@@ -186,7 +186,7 @@ TileCreator::TileCreator(const QString& sourceDir, const QString& installMap,
if ( d->m_targetDir.isNull() )
d->m_targetDir = MarbleDirs::localPath() + QLatin1String("/maps/")
- + sourcePath.section( '/', -3, -2 ) + '/';
+ + sourcePath.section(QLatin1Char('/'), -3, -2) + QLatin1Char('/');
setTerminationEnabled( true );
}
@@ -216,7 +216,7 @@ void TileCreator::run()
}
if ( !d->m_targetDir.endsWith('/') )
- d->m_targetDir += '/';
+ d->m_targetDir += QLatin1Char('/');
mDebug() << "Installing tiles to: " << d->m_targetDir;
diff --git a/src/lib/marble/TourCaptureDialog.cpp b/src/lib/marble/TourCaptureDialog.cpp
index 60bd753..b9509a5 100644
--- a/src/lib/marble/TourCaptureDialog.cpp
+++ b/src/lib/marble/TourCaptureDialog.cpp
@@ -88,12 +88,14 @@ void TourCaptureDialog::loadDestinationFile()
bool supported = false;
foreach(const MovieFormat &format, formats) {
- if (destination.endsWith('.'+format.extension()))
+ if (destination.endsWith(QLatin1Char('.') + format.extension())) {
supported = true;
+ break;
+ }
}
if (!supported) {
- QString formatsExtensions = '.'+formats.at( 0 ).extension();
+ QString formatsExtensions = QLatin1Char('.') + formats.at(0).extension();
for( int i = 1; i < formats.size(); ++i )
{
formatsExtensions += QLatin1String(", .") + formats.at(i).extension();
diff --git a/src/lib/marble/cloudsync/BookmarkSyncManager.cpp b/src/lib/marble/cloudsync/BookmarkSyncManager.cpp
index ddb8084..b729b45 100644
--- a/src/lib/marble/cloudsync/BookmarkSyncManager.cpp
+++ b/src/lib/marble/cloudsync/BookmarkSyncManager.cpp
@@ -278,7 +278,7 @@ void BookmarkSyncManager::startBookmarkSync()
QUrl BookmarkSyncManager::Private::endpointUrl( const QString &endpoint ) const
{
- return QUrl( QString( "%0/%1" ).arg( m_cloudSyncManager->apiUrl().toString() ).arg( endpoint ) );
+ return QUrl(m_cloudSyncManager->apiUrl().toString() + QLatin1Char('/') + endpoint);
}
void BookmarkSyncManager::Private::uploadBookmarks()
diff --git a/src/lib/marble/cloudsync/OwncloudSyncBackend.cpp b/src/lib/marble/cloudsync/OwncloudSyncBackend.cpp
index 88612ef..8eb432f 100644
--- a/src/lib/marble/cloudsync/OwncloudSyncBackend.cpp
+++ b/src/lib/marble/cloudsync/OwncloudSyncBackend.cpp
@@ -420,13 +420,13 @@ void OwncloudSyncBackend::saveDownloadedRoute()
QUrl OwncloudSyncBackend::endpointUrl( const QString &endpoint ) const
{
- QString endpointUrl = QString( "%0/%1" ).arg( d->m_cloudSyncManager->apiUrl().toString() ).arg( endpoint );
+ const QString endpointUrl = d->m_cloudSyncManager->apiUrl().toString() + QLatin1Char('/') + endpoint;
return QUrl( endpointUrl );
}
QUrl OwncloudSyncBackend::endpointUrl( const QString &endpoint, const QString &parameter ) const
{
- QString endpointUrl = QString( "%0/%1/%2" ).arg( d->m_cloudSyncManager->apiUrl().toString() ).arg( endpoint ).arg( parameter );
+ const QString endpointUrl = d->m_cloudSyncManager->apiUrl().toString() + QLatin1Char('/') + endpoint + QLatin1Char('/') + parameter;
return QUrl( endpointUrl );
}
diff --git a/src/lib/marble/cloudsync/RouteItemDelegate.cpp b/src/lib/marble/cloudsync/RouteItemDelegate.cpp
index a395c01..17377d7 100644
--- a/src/lib/marble/cloudsync/RouteItemDelegate.cpp
+++ b/src/lib/marble/cloudsync/RouteItemDelegate.cpp
@@ -63,7 +63,7 @@ void RouteItemDelegate::paint( QPainter* painter, const QStyleOptionViewItem& op
progressBarOption.minimum = 0;
progressBarOption.maximum = 100;
progressBarOption.progress = ( 100.0 * progress / total );
- progressBarOption.text = QString::number( progressBarOption.progress ) + '%';
+ progressBarOption.text = QString::number(progressBarOption.progress) + QLatin1Char('%');
progressBarOption.textVisible = true;
QApplication::style()->drawControl(QStyle::CE_ProgressBar, &progressBarOption, painter);
} else if ( !cached && onCloud ) {
diff --git a/src/lib/marble/cloudsync/RouteSyncManager.cpp b/src/lib/marble/cloudsync/RouteSyncManager.cpp
index 0243f36..14d5f0f 100644
--- a/src/lib/marble/cloudsync/RouteSyncManager.cpp
+++ b/src/lib/marble/cloudsync/RouteSyncManager.cpp
@@ -130,7 +130,7 @@ QVector<RouteItem> RouteSyncManager::cachedRouteList() const
QVector<RouteItem> routeList;
QStringList cachedRoutes = d->m_cacheDir.entryList( QStringList() << "*.kml", QDir::Files );
foreach ( const QString &routeFilename, cachedRoutes ) {
- QFile file( d->m_cacheDir.absolutePath() + '/' + routeFilename );
+ QFile file(d->m_cacheDir.absolutePath() + QLatin1Char('/') + routeFilename);
file.open( QFile::ReadOnly );
GeoDataParser parser( GeoData_KML );
diff --git a/src/lib/marble/geodata/data/GeoDataObject.cpp b/src/lib/marble/geodata/data/GeoDataObject.cpp
index d8e1bcc..85c2238 100644
--- a/src/lib/marble/geodata/data/GeoDataObject.cpp
+++ b/src/lib/marble/geodata/data/GeoDataObject.cpp
@@ -101,7 +101,7 @@ QString GeoDataObject::resolvePath( const QString &relativePath ) const
if ( document ) {
QString const baseUri = document->baseUri();
QFileInfo const documentRoot = baseUri.isEmpty() ? document->fileName() : baseUri;
- QFileInfo const absoluteImage( documentRoot.absolutePath() + '/' + url.path() );
+ QFileInfo const absoluteImage(documentRoot.absolutePath() + QLatin1Char('/') + url.path());
return absoluteImage.absoluteFilePath();
} else if ( d->m_parent ) {
return d->m_parent->resolvePath( relativePath );
diff --git a/src/lib/marble/geodata/parser/GeoParser.cpp b/src/lib/marble/geodata/parser/GeoParser.cpp
index c48d9fe..05cf062 100644
--- a/src/lib/marble/geodata/parser/GeoParser.cpp
+++ b/src/lib/marble/geodata/parser/GeoParser.cpp
@@ -58,13 +58,13 @@ static void dumpParentStack( const QString& name, int size, bool close )
QString result;
for ( int i = 0; i < depth; ++i )
- result += ' ';
+ result += QLatin1Char(' ');
if ( close ) {
depth--;
result += QLatin1String("</");
} else
- result += '<';
+ result += QLatin1Char('<');
result += name + QLatin1String("> stack size ") + QString::number(size);
fprintf( stderr, "%s\n", qPrintable( result ));
diff --git a/src/lib/marble/geodata/writers/kml/KmlPointTagWriter.cpp b/src/lib/marble/geodata/writers/kml/KmlPointTagWriter.cpp
index 1acef94..28309b2 100644
--- a/src/lib/marble/geodata/writers/kml/KmlPointTagWriter.cpp
+++ b/src/lib/marble/geodata/writers/kml/KmlPointTagWriter.cpp
@@ -40,18 +40,16 @@ bool KmlPointTagWriter::write( const GeoNode *node,
writer.writeOptionalElement( kml::kmlTag_extrude, QString::number( point->extrude() ), "0" );
writer.writeStartElement("coordinates");
- QString coordinateString;
-
//FIXME: this should be using the GeoDataCoordinates::toString but currently
// it is not including the altitude and is adding an extra space after commas
- coordinateString += QString::number( point->coordinates().longitude( GeoDataCoordinates::Degree ), 'f', 10 );
- coordinateString += ',' ;
- coordinateString += QString::number( point->coordinates().latitude( GeoDataCoordinates::Degree ) , 'f', 10 );
+ QString coordinateString =
+ QString::number(point->coordinates().longitude(GeoDataCoordinates::Degree), 'f', 10) +
+ QLatin1Char(',') +
+ QString::number(point->coordinates().latitude(GeoDataCoordinates::Degree) , 'f', 10);
if( point->coordinates().altitude() ) {
- coordinateString += ',';
- coordinateString += QString::number( point->coordinates().altitude() , 'f' , 10);
+ coordinateString += QLatin1Char(',') + QString::number( point->coordinates().altitude() , 'f' , 10);
}
writer.writeCharacters( coordinateString );
diff --git a/src/lib/marble/geodata/writers/kml/KmlTrackWriter.cpp b/src/lib/marble/geodata/writers/kml/KmlTrackWriter.cpp
index 0dc20da..a3cf459 100644
--- a/src/lib/marble/geodata/writers/kml/KmlTrackWriter.cpp
+++ b/src/lib/marble/geodata/writers/kml/KmlTrackWriter.cpp
@@ -37,8 +37,9 @@ bool KmlTrackWriter::write( const GeoNode *node, GeoWriter &writer ) const
qreal lon, lat, alt;
track->coordinatesList().at( i ).geoCoordinates( lon, lat, alt, GeoDataCoordinates::Degree );
- QString coord = QString::number( lon, 'f', 10 ) + ' '
- + QString::number( lat, 'f', 10 ) + ' ' + QString::number( alt, 'f', 10 );
+ const QString coord = QString::number(lon, 'f', 10) + QLatin1Char(' ') +
+ QString::number(lat, 'f', 10) + QLatin1Char(' ') +
+ QString::number(alt, 'f', 10);
writer.writeElement( "gx:coord", coord );
}
diff --git a/src/lib/marble/osm/OsmTagEditorWidget.cpp b/src/lib/marble/osm/OsmTagEditorWidget.cpp
index ca50e58..05b77b5 100644
--- a/src/lib/marble/osm/OsmTagEditorWidget.cpp
+++ b/src/lib/marble/osm/OsmTagEditorWidget.cpp
@@ -103,7 +103,7 @@ void OsmTagEditorWidget::addSelectedTag()
QString value = selectedTag->text( 1 );
// If the value is <value>, the user has to type a value for that particular key
- if ( value == QString( "<%1>" ).arg( tr( "value" ) ) ) {
+ if (value == QLatin1Char('<') + tr("value") + QLatin1Char('>')) {
int lastIndex = d->m_currentTagsList->topLevelItemCount() - 1;
QTreeWidgetItem *adderItem = d->m_currentTagsList->topLevelItem( lastIndex );
adderItem->setText( 0, key );
diff --git a/src/lib/marble/osm/OsmTagEditorWidget_p.cpp b/src/lib/marble/osm/OsmTagEditorWidget_p.cpp
index cba3f23..ea4e8db 100644
--- a/src/lib/marble/osm/OsmTagEditorWidget_p.cpp
+++ b/src/lib/marble/osm/OsmTagEditorWidget_p.cpp
@@ -102,7 +102,7 @@ QTreeWidgetItem *OsmTagEditorWidgetPrivate::tagWidgetItem( const OsmTag &tag ) c
QStringList itemText;
itemText << tag.first;
- itemText << ( tag.second.isEmpty() ? QString( "<%1>" ).arg( QObject::tr( "value" ) ) : tag.second );
+ itemText << (tag.second.isEmpty() ? QLatin1Char('<') + QObject::tr("value") + QLatin1Char('>') : tag.second);
QTreeWidgetItem *tagItem = new QTreeWidgetItem( itemText );
diff --git a/src/lib/marble/routing/instructions/RoutingInstruction.cpp b/src/lib/marble/routing/instructions/RoutingInstruction.cpp
index e3135c8..9cf8beb 100644
--- a/src/lib/marble/routing/instructions/RoutingInstruction.cpp
+++ b/src/lib/marble/routing/instructions/RoutingInstruction.cpp
@@ -352,9 +352,9 @@ QString RoutingInstruction::totalDurationRemaining() const
QString RoutingInstruction::instructionText() const
{
QString text = nextRoadInstruction();
- text += ' ' + nextDistanceInstruction();
+ text += QLatin1Char(' ') + nextDistanceInstruction();
if ( QCoreApplication::instance()->arguments().contains( "--remaining-duration" ) ) {
- text += ' ' + totalDurationRemaining();
+ text += QLatin1Char(' ') + totalDurationRemaining();
}
return text;
}
diff --git a/src/plugins/positionprovider/flightgear/FlightGearPositionProviderPlugin.cpp b/src/plugins/positionprovider/flightgear/FlightGearPositionProviderPlugin.cpp
index cee5ad7..195a811 100644
--- a/src/plugins/positionprovider/flightgear/FlightGearPositionProviderPlugin.cpp
+++ b/src/plugins/positionprovider/flightgear/FlightGearPositionProviderPlugin.cpp
@@ -140,7 +140,7 @@ void FlightGearPositionProviderPlugin::parseNmeaSentence( const QString &sentenc
if (values[2] == QLatin1String("A")) {
m_speed = values[7].toDouble() * 0.514444; // knots => m/s
m_track = values[8].toDouble();
- QString const date = values[9] + ' ' + values[1];
+ QString const date = values[9] + QLatin1Char(' ') + values[1];
m_timestamp = QDateTime::fromString( date, "ddMMyy HHmmss" );
if (m_timestamp.date().year() <= 1930 && m_timestamp.date().year() >= 1900 ) {
m_timestamp = m_timestamp.addYears( 100 ); // Qt range is 1900-1999 for two-digits
diff --git a/src/plugins/render/aprs/AprsPlugin.cpp b/src/plugins/render/aprs/AprsPlugin.cpp
index a005f76..de80108 100644
--- a/src/plugins/render/aprs/AprsPlugin.cpp
+++ b/src/plugins/render/aprs/AprsPlugin.cpp
@@ -414,10 +414,10 @@ bool AprsPlugin::render( GeoPainter *painter, ViewportParams *viewport, const QS
if ( !( viewport->viewLatLonAltBox() == m_lastBox ) ) {
m_lastBox = viewport->viewLatLonAltBox();
QString towrite = QLatin1String("#filter a/") +
- QString().number( m_lastBox.north( GeoDataCoordinates::Degree ) ) +'/' +
- QString().number( m_lastBox.west( GeoDataCoordinates::Degree ) ) +'/' +
- QString().number( m_lastBox.south( GeoDataCoordinates::Degree ) ) +'/' +
- QString().number( m_lastBox.east( GeoDataCoordinates::Degree ) ) +'\n';
+ QString::number(m_lastBox.north(GeoDataCoordinates::Degree)) + QLatin1Char('/') +
+ QString::number(m_lastBox.west(GeoDataCoordinates::Degree)) + QLatin1Char('/') +
+ QString::number(m_lastBox.south(GeoDataCoordinates::Degree)) + QLatin1Char('/') +
+ QString::number(m_lastBox.east(GeoDataCoordinates::Degree)) + QLatin1Char('\n');
mDebug() << "upating filter: " << towrite.toLocal8Bit().data();
QMutexLocker locker( m_mutex );
diff --git a/src/plugins/render/earthquake/EarthquakeModel.cpp b/src/plugins/render/earthquake/EarthquakeModel.cpp
index 088ff37..8afd784 100644
--- a/src/plugins/render/earthquake/EarthquakeModel.cpp
+++ b/src/plugins/render/earthquake/EarthquakeModel.cpp
@@ -78,7 +78,7 @@ void EarthquakeModel::parseFile( const QByteArray& file )
QScriptEngine engine;
// Qt requires parentheses around json code
- data = engine.evaluate( '(' + QString( file ) + ')' );
+ data = engine.evaluate(QLatin1Char('(') + QString(file) + QLatin1Char(')'));
// Parse if any result exists
if ( data.property( "earthquakes" ).isArray() ) {
diff --git a/src/plugins/render/elevationprofilefloatitem/ElevationProfileFloatItem.cpp b/src/plugins/render/elevationprofilefloatitem/ElevationProfileFloatItem.cpp
index 881acbc..f13a911 100644
--- a/src/plugins/render/elevationprofilefloatitem/ElevationProfileFloatItem.cpp
+++ b/src/plugins/render/elevationprofilefloatitem/ElevationProfileFloatItem.cpp
@@ -265,7 +265,7 @@ void ElevationProfileFloatItem::paintContent( QPainter *painter )
intervalStr.setNum( tick.value * m_axisX.scale() );
if ( tick.position == m_axisX.ticks().last().position ) {
- intervalStr += ' ' + m_axisX.unit();
+ intervalStr += QLatin1Char(' ') + m_axisX.unit();
}
labelRect.setWidth( QFontMetricsF( font() ).width( intervalStr ) * 1.5 );
labelRect.moveCenter( QPoint( posX, labelRect.center().y() ) );
@@ -367,13 +367,13 @@ void ElevationProfileFloatItem::paintContent( QPainter *painter )
painter->drawLine( m_leftGraphMargin + m_cursorPositionX - 5, ypos,
m_leftGraphMargin + m_cursorPositionX + 5, ypos );
intervalStr.setNum( xpos * m_axisX.scale(), 'f', 2 );
- intervalStr += ' ' + m_axisX.unit();
+ intervalStr += QLatin1Char(' ') + m_axisX.unit();
int currentStringBegin = m_leftGraphMargin + m_cursorPositionX
- QFontMetricsF( font() ).width( intervalStr ) / 2;
painter->drawText( currentStringBegin, contentSize().height() - 1.5 * m_fontHeight, intervalStr );
intervalStr.setNum( currentPoint.altitude(), 'f', 1 );
- intervalStr += ' ' + m_axisY.unit();
+ intervalStr += QLatin1Char(' ') + m_axisY.unit();
if ( m_cursorPositionX + QFontMetricsF( font() ).width( intervalStr ) + m_leftGraphMargin
< m_eleGraphWidth ) {
currentStringBegin = ( m_leftGraphMargin + m_cursorPositionX + 5 + 2 );
diff --git a/src/plugins/render/elevationprofilemarker/ElevationProfileMarker.cpp b/src/plugins/render/elevationprofilemarker/ElevationProfileMarker.cpp
index 2ea5f20..96ed196 100644
--- a/src/plugins/render/elevationprofilemarker/ElevationProfileMarker.cpp
+++ b/src/plugins/render/elevationprofilemarker/ElevationProfileMarker.cpp
@@ -160,7 +160,7 @@ bool ElevationProfileMarker::render( GeoPainter* painter, ViewportParams* viewpo
QString intervalStr;
intervalStr.setNum( m_currentPosition.altitude() * displayScale, 'f', 1 );
- intervalStr += ' ' + unitString;
+ intervalStr += QLatin1Char(' ') + unitString;
m_markerText.setText( intervalStr );
}
}
diff --git a/src/plugins/render/foursquare/FoursquareModel.cpp b/src/plugins/render/foursquare/FoursquareModel.cpp
index 84af7d5..e6ce0d2 100644
--- a/src/plugins/render/foursquare/FoursquareModel.cpp
+++ b/src/plugins/render/foursquare/FoursquareModel.cpp
@@ -74,7 +74,7 @@ void FoursquareModel::parseFile( const QByteArray& file )
QScriptValue data;
QScriptEngine engine;
// Qt requires parentheses around JSON
- data = engine.evaluate( '(' + QString::fromUtf8( file ) + ')' );
+ data = engine.evaluate(QLatin1Char('(') + QString::fromUtf8(file) + QLatin1Char(')'));
data = data.property("response");
// Parse if any result exists
diff --git a/src/plugins/render/measure/MeasureToolPlugin.cpp b/src/plugins/render/measure/MeasureToolPlugin.cpp
index e49cc5b..a938363 100644
--- a/src/plugins/render/measure/MeasureToolPlugin.cpp
+++ b/src/plugins/render/measure/MeasureToolPlugin.cpp
@@ -293,7 +293,7 @@ void MeasureToolPlugin::drawSegments( GeoPainter* painter )
}
QString bearingString = QString::fromUtf8( "%1°" ).arg( bearing, 0, 'f', 2 );
if ( !infoString.isEmpty() ) {
- infoString.append( "\n" );
+ infoString += QLatin1Char('\n');
}
infoString.append( bearingString );
}
diff --git a/src/plugins/render/opencachingcom/OpenCachingComItem.cpp b/src/plugins/render/opencachingcom/OpenCachingComItem.cpp
index 526fe36..b172695 100644
--- a/src/plugins/render/opencachingcom/OpenCachingComItem.cpp
+++ b/src/plugins/render/opencachingcom/OpenCachingComItem.cpp
@@ -284,7 +284,7 @@ void OpenCachingComItem::addDownloadedFile( const QString &url, const QString &t
QScriptEngine engine;
// Qt requires parentheses around json code
- QScriptValue data = engine.evaluate( '(' + QString::fromUtf8( file.readAll() ) + ')' );
+ QScriptValue data = engine.evaluate(QLatin1Char('(') + QString::fromUtf8(file.readAll()) + QLatin1Char(')'));
QVariantMap cache = data.toVariant().toMap();
m_cache["description"] = cache["description"];
diff --git a/src/plugins/render/opencachingcom/OpenCachingComModel.cpp b/src/plugins/render/opencachingcom/OpenCachingComModel.cpp
index 94756c5..2c721f6 100644
--- a/src/plugins/render/opencachingcom/OpenCachingComModel.cpp
+++ b/src/plugins/render/opencachingcom/OpenCachingComModel.cpp
@@ -65,14 +65,14 @@ void OpenCachingComModel::getAdditionalItems( const GeoDataLatLonAltBox& box, qi
}
QString url("http://www.opencaching.com/api/geocache/?Authorization=");
- url += AUTHKEY + QString("&bbox=%1,%2,%3,%4")
+ url += AUTHKEY + QStringLiteral("&bbox=%1,%2,%3,%4")
.arg( box.south( GeoDataCoordinates::Degree ) )
.arg( box.west(GeoDataCoordinates::Degree ) )
.arg( box.north(GeoDataCoordinates::Degree ) )
.arg( box.east(GeoDataCoordinates::Degree ) );
if(!m_previousbox.isNull())
{
- url += QString("&exclude_bbox=%1,%2,%3,%4")
+ url += QStringLiteral("&exclude_bbox=%1,%2,%3,%4")
.arg( m_previousbox.south( GeoDataCoordinates::Degree ) )
.arg( m_previousbox.west(GeoDataCoordinates::Degree ) )
.arg( m_previousbox.north(GeoDataCoordinates::Degree ) )
@@ -92,7 +92,7 @@ void OpenCachingComModel::parseFile( const QByteArray& file )
QScriptEngine engine;
// Qt requires parentheses around json code
- QScriptValue data = engine.evaluate( '(' + QString::fromUtf8( file ) + ')' );
+ QScriptValue data = engine.evaluate(QLatin1Char('(') + QString::fromUtf8(file) + QLatin1Char(')'));
QVariantList caches = data.toVariant().toList();
// qDebug()<<"parsing "<<caches.size()<<" items";
diff --git a/src/plugins/render/opendesktop/OpenDesktopModel.cpp b/src/plugins/render/opendesktop/OpenDesktopModel.cpp
index ab25ee6..6a61129 100644
--- a/src/plugins/render/opendesktop/OpenDesktopModel.cpp
+++ b/src/plugins/render/opendesktop/OpenDesktopModel.cpp
@@ -62,7 +62,7 @@ void OpenDesktopModel::parseFile( const QByteArray& file )
{
QScriptValue data;
QScriptEngine engine;
- data = engine.evaluate( '(' + QString(file) + ')' );
+ data = engine.evaluate(QLatin1Char('(') + QString(file) + QLatin1Char(')'));
// Parse if any result exists
if ( data.property( "data" ).isArray() )
diff --git a/src/plugins/render/overviewmap/OverviewMap.cpp b/src/plugins/render/overviewmap/OverviewMap.cpp
index 6a102a1..003998d 100644
--- a/src/plugins/render/overviewmap/OverviewMap.cpp
+++ b/src/plugins/render/overviewmap/OverviewMap.cpp
@@ -470,7 +470,7 @@ void OverviewMap::loadMapSuggestions()
{
QStringList paths = QDir(MarbleDirs::pluginPath(QString())).entryList(QStringList("*.svg"), QDir::Files | QDir::NoDotAndDotDot);
for( int i = 0; i < paths.size(); ++i ) {
- paths[i] = MarbleDirs::pluginPath( QString() ) + '/' + paths[i];
+ paths[i] = MarbleDirs::pluginPath(QString()) + QLatin1Char('/') + paths[i];
}
paths << MarbleDirs::path( "svg/worldmap.svg" ) << MarbleDirs::path( "svg/lunarmap.svg" );
ui_configWidget->m_tableWidget->setRowCount( paths.size() );
diff --git a/src/plugins/render/photo/PhotoPluginModel.cpp b/src/plugins/render/photo/PhotoPluginModel.cpp
index 642054d..ad4ae35 100644
--- a/src/plugins/render/photo/PhotoPluginModel.cpp
+++ b/src/plugins/render/photo/PhotoPluginModel.cpp
@@ -57,10 +57,7 @@ QUrl PhotoPluginModel::generateUrl( const QString& service,
QHash<QString,QString>::const_iterator it = options.constBegin();
QHash<QString,QString>::const_iterator const end = options.constEnd();
for (; it != end; ++it ) {
- url += '&';
- url += it.key();
- url += '=';
- url += it.value();
+ url += QLatin1Char('&') + it.key() + QLatin1Char('=') + it.value();
}
return QUrl( url );
@@ -75,11 +72,11 @@ void PhotoPluginModel::getAdditionalItems( const GeoDataLatLonAltBox& box,
}
if( box.west() <= box.east() ) {
- QString bbox;
- bbox += QString::number( box.west() * RAD2DEG ) + ',';
- bbox += QString::number( box.south() * RAD2DEG ) + ',';
- bbox += QString::number( box.east() * RAD2DEG ) + ',';
- bbox += QString::number( box.north() * RAD2DEG );
+ const QString bbox =
+ QString::number(box.west() * RAD2DEG) + QLatin1Char(',') +
+ QString::number(box.south() * RAD2DEG) + QLatin1Char(',') +
+ QString::number(box.east() * RAD2DEG) + QLatin1Char(',') +
+ QString::number(box.north() * RAD2DEG);
QHash<QString,QString> options;
options.insert( "per_page", QString::number( number ) );
@@ -91,11 +88,11 @@ void PhotoPluginModel::getAdditionalItems( const GeoDataLatLonAltBox& box,
}
else {
// Flickr api doesn't support bboxes with west > east so we have to split in two boxes
- QString bboxWest;
- bboxWest += QString::number( box.west() * RAD2DEG ) + ',';
- bboxWest += QString::number( box.south() * RAD2DEG ) + ',';
- bboxWest += QString::number( 180 ) + ',';
- bboxWest += QString::number( box.north() * RAD2DEG );
+ const QString bboxWest =
+ QString::number(box.west() * RAD2DEG) + QLatin1Char(',') +
+ QString::number(box.south() * RAD2DEG) + QLatin1Char(',') +
+ QString::number(180 ) + QLatin1Char(',') +
+ QString::number(box.north() * RAD2DEG);
QHash<QString,QString> optionsWest;
optionsWest.insert( "per_page", QString::number( number/2 ) );
@@ -106,12 +103,12 @@ void PhotoPluginModel::getAdditionalItems( const GeoDataLatLonAltBox& box,
downloadDescriptionFile( generateUrl( "flickr", "flickr.photos.search", optionsWest ) );
- QString bboxEast;
- bboxEast += QString::number( -180 ) + ',';
- bboxEast += QString::number( box.south() * RAD2DEG ) + ',';
- bboxEast += QString::number( box.east() * RAD2DEG ) + ',';
- bboxEast += QString::number( box.north() * RAD2DEG );
-
+ const QString bboxEast =
+ QString::number(-180) +QLatin1Char( ',') +
+ QString::number(box.south() * RAD2DEG) + QLatin1Char(',') +
+ QString::number(box.east() * RAD2DEG) + QLatin1Char(',') +
+ QString::number(box.north() * RAD2DEG);
+
QHash<QString,QString> optionsEast;
optionsEast.insert( "per_page", QString::number( number/2 ) );
optionsEast.insert( "bbox", bboxEast );
diff --git a/src/plugins/render/postalcode/PostalCodeModel.cpp b/src/plugins/render/postalcode/PostalCodeModel.cpp
index 7edfbac..1a30374 100644
--- a/src/plugins/render/postalcode/PostalCodeModel.cpp
+++ b/src/plugins/render/postalcode/PostalCodeModel.cpp
@@ -70,7 +70,7 @@ void PostalCodeModel::parseFile( const QByteArray& file )
QScriptEngine engine;
// Qt requires parentheses around json code
- data = engine.evaluate( '(' + QString::fromUtf8( file ) + ')' );
+ data = engine.evaluate(QLatin1Char('(') + QString::fromUtf8(file) + QLatin1Char(')'));
// Parse if any result exists
if ( data.property( "postalCodes" ).isArray() ) {
@@ -96,7 +96,7 @@ void PostalCodeModel::parseFile( const QByteArray& file )
QString tooltip;
if ( !placeName.isEmpty() ) {
- tooltip += placeName + ' ';
+ tooltip += placeName + QLatin1Char(' ');
}
addLine( &tooltip, postalCode );
@@ -128,7 +128,7 @@ void PostalCodeModel::addLine(QString *string, const QString &line)
{
Q_ASSERT( string );
if ( !line.isEmpty() ) {
- *string += line + '\n';
+ *string += line + QLatin1Char('\n');
}
}
diff --git a/src/plugins/render/progress/ProgressFloatItem.cpp b/src/plugins/render/progress/ProgressFloatItem.cpp
index 00944b6..e960e1e 100644
--- a/src/plugins/render/progress/ProgressFloatItem.cpp
+++ b/src/plugins/render/progress/ProgressFloatItem.cpp
@@ -188,7 +188,7 @@ void ProgressFloatItem::paintContent( QPainter *painter )
// Paint progress label
QFont myFont = font();
myFont.setPointSize( m_fontSize );
- QString done = QString::number( (int) ( m_completed * 100 ) ) + '%';
+ const QString done = QString::number((int) (m_completed * 100)) + QLatin1Char('%');
int fontWidth = QFontMetrics( myFont ).boundingRect( done ).width();
QPointF baseline( padding() + 0.5 * ( rect.width() - fontWidth ), 0.75 * rect.height() );
QPainterPath path;
diff --git a/src/plugins/render/stars/StarsPlugin.cpp b/src/plugins/render/stars/StarsPlugin.cpp
index d43a2ff..6c73a4a 100644
--- a/src/plugins/render/stars/StarsPlugin.cpp
+++ b/src/plugins/render/stars/StarsPlugin.cpp
@@ -204,7 +204,7 @@ QHash<QString, QVariant> StarsPlugin::settings() const
QStringList planetState;
foreach (const QString &key, m_renderPlanet.keys())
- planetState.append(key+QChar(':')+QString::number((int)m_renderPlanet[key]));
+ planetState += key + QLatin1Char(':') + QString::number((int)m_renderPlanet[key]);
settings["renderPlanet"] = planetState.join(QChar('|'));
settings["renderEcliptic"] = m_renderEcliptic;
diff --git a/src/plugins/render/weather/GeoNamesWeatherService.cpp b/src/plugins/render/weather/GeoNamesWeatherService.cpp
index 19f6356..568068b 100644
--- a/src/plugins/render/weather/GeoNamesWeatherService.cpp
+++ b/src/plugins/render/weather/GeoNamesWeatherService.cpp
@@ -83,7 +83,7 @@ void GeoNamesWeatherService::parseFile( const QByteArray& file )
QScriptEngine engine;
// Qt requires parentheses around json code
- data = engine.evaluate( '(' + QString( file ) + ')' );
+ data = engine.evaluate(QLatin1Char('(') + QString(file) + QLatin1Char(')'));
// Parse if any result exists
QList<AbstractDataPluginItem*> items;
diff --git a/src/plugins/render/weather/WeatherData.cpp b/src/plugins/render/weather/WeatherData.cpp
index 2ccfd4e..9777e25 100644
--- a/src/plugins/render/weather/WeatherData.cpp
+++ b/src/plugins/render/weather/WeatherData.cpp
@@ -592,7 +592,7 @@ QString WeatherData::windSpeedString( WeatherData::SpeedUnit unit ) const
QLocale locale = QLocale::system();
// We round to integer.
QString string = locale.toString( floor( windSpeed( unit ) + 0.5 ) );
- string += ' ';
+ string += QLatin1Char(' ');
switch ( unit ) {
case WeatherData::kph:
string += QObject::tr("km/h");
@@ -751,7 +751,7 @@ QString WeatherData::pressureString( WeatherData::PressureUnit unit ) const
QLocale locale = QLocale::system();
// We round to integer.
QString string = locale.toString( pressure( unit ), 'f', 2 );
- string += ' ';
+ string += QLatin1Char(' ');
switch ( unit ) {
case WeatherData::HectoPascal:
string += tr( "hPa" );
diff --git a/src/plugins/render/weather/WeatherItem.cpp b/src/plugins/render/weather/WeatherItem.cpp
index e671564..d8e3e72 100644
--- a/src/plugins/render/weather/WeatherItem.cpp
+++ b/src/plugins/render/weather/WeatherItem.cpp
@@ -136,7 +136,7 @@ class WeatherItemPrivate
.arg( m_currentWeather.pressureDevelopmentString() );
if ( !m_forecastWeather.isEmpty() ) {
- toolTip += '\n';
+ toolTip += QLatin1Char('\n');
QDate const minDate = QDate::currentDate();
foreach( const WeatherData& data, m_forecastWeather ) {
@@ -146,8 +146,8 @@ class WeatherItemPrivate
&& data.hasValidMinTemperature()
&& data.hasValidMaxTemperature() )
{
- toolTip += '\n';
- toolTip += tr( "%1: %2, %3 to %4", "DayOfWeek: Condition, MinTemp to MaxTemp" )
+ toolTip += QLatin1Char('\n') +
+ tr( "%1: %2, %3 to %4", "DayOfWeek: Condition, MinTemp to MaxTemp" )
.arg( locale.standaloneDayName( date.dayOfWeek() ) )
.arg( data.conditionString() )
.arg( data.minTemperatureString( temperatureUnit() ) )
@@ -526,16 +526,18 @@ QString WeatherItem::createFromTemplate(const QString &templateHtml)
forecastNumber++;
const QString suffix = QString::number(forecastNumber);
QDate date = forecast.dataDate();
- html.replace(QLatin1String("%day_f")+suffix+'%', locale.standaloneDayName(date.dayOfWeek()));
- html.replace(QLatin1String("%weather_situation_f")+suffix+'%', "file://"+forecast.iconSource());
- html.replace(QLatin1String("%max_temp_f")+suffix+'%',
+ html.replace(QLatin1String("%day_f") + suffix + QLatin1Char('%'),
+ locale.standaloneDayName(date.dayOfWeek()));
+ html.replace(QLatin1String("%weather_situation_f") + suffix + QLatin1Char('%'),
+ QLatin1String("file://")+forecast.iconSource());
+ html.replace(QLatin1String("%max_temp_f") + suffix + QLatin1Char('%'),
forecast.maxTemperatureString(WeatherData::Celsius));
- html.replace(QLatin1String("%min_temp_f")+suffix+'%',
+ html.replace(QLatin1String("%min_temp_f") + suffix + QLatin1Char('%'),
forecast.minTemperatureString(WeatherData::Celsius));
- html.replace(QLatin1String("%condition_f")+suffix+'%', forecast.conditionString());
- html.replace(QLatin1String("%wind_direction_f")+suffix+'%', forecast.windDirectionString());
- html.replace(QLatin1String("%wind_speed_f")+suffix+'%', forecast.windSpeedString());
- html.replace(QLatin1String("%publish_time_f")+suffix+'%', forecast.publishingTime().toString());
+ html.replace(QLatin1String("%condition_f") + suffix + QLatin1Char('%'), forecast.conditionString());
+ html.replace(QLatin1String("%wind_direction_f") + suffix + QLatin1Char('%'), forecast.windDirectionString());
+ html.replace(QLatin1String("%wind_speed_f") + suffix + QLatin1Char('%'), forecast.windSpeedString());
+ html.replace(QLatin1String("%publish_time_f") + suffix + QLatin1Char('%'), forecast.publishingTime().toString());
}
return html;
diff --git a/src/plugins/runner/cyclestreets/CycleStreetsRunner.cpp b/src/plugins/runner/cyclestreets/CycleStreetsRunner.cpp
index 770a632..4c6a462 100644
--- a/src/plugins/runner/cyclestreets/CycleStreetsRunner.cpp
+++ b/src/plugins/runner/cyclestreets/CycleStreetsRunner.cpp
@@ -75,9 +75,9 @@ void CycleStreetsRunner::retrieveRoute( const RouteRequest *route )
queryStrings["speed"] = settings["speed"].toString();
GeoDataCoordinates::Unit const degree = GeoDataCoordinates::Degree;
QString itinerarypoints;
- itinerarypoints.append( QString::number( route->source().longitude( degree ), 'f', 6 ) + ',' + QString::number( route->source().latitude( degree ), 'f', 6 ) );
+ itinerarypoints.append(QString::number(route->source().longitude(degree), 'f', 6) + QLatin1Char(',') + QString::number(route->source().latitude(degree), 'f', 6));
for ( int i=1; i<route->size(); ++i ) {
- itinerarypoints.append( '|' + QString::number( route->at( i ).longitude( degree ), 'f', 6 ) + ',' + QString::number( route->at( i ).latitude( degree ), 'f', 6 ) );
+ itinerarypoints.append(QLatin1Char('|') + QString::number(route->at(i).longitude(degree), 'f', 6) + QLatin1Char(',') + QString::number(route->at(i).latitude(degree), 'f', 6));
}
queryStrings["itinerarypoints"] = itinerarypoints;
diff --git a/src/plugins/runner/gpx/handlers/GPXgpxTagHandler.cpp b/src/plugins/runner/gpx/handlers/GPXgpxTagHandler.cpp
index 765a367..eb96c69 100644
--- a/src/plugins/runner/gpx/handlers/GPXgpxTagHandler.cpp
+++ b/src/plugins/runner/gpx/handlers/GPXgpxTagHandler.cpp
@@ -54,7 +54,7 @@ GeoNode* GPXgpxTagHandler::parse(GeoParser& parser) const
GeoDataStyleMap styleMap;
styleMap.setId("map-track");
- styleMap.insert("normal", QString("#").append(style->id()));
+ styleMap.insert("normal", QLatin1Char('#') + style->id());
doc->addStyleMap(styleMap);
doc->addStyle(style);
@@ -70,7 +70,7 @@ GeoNode* GPXgpxTagHandler::parse(GeoParser& parser) const
GeoDataStyleMap routeStyleMap;
routeStyleMap.setId("map-route");
- routeStyleMap.insert("normal", QString("#").append(routestyle->id()));
+ routeStyleMap.insert("normal", QLatin1Char('#') + routestyle->id());
doc->addStyleMap(routeStyleMap);
doc->addStyle(routestyle);
@@ -88,7 +88,7 @@ GeoNode* GPXgpxTagHandler::parse(GeoParser& parser) const
GeoDataStyleMap waypointStyleMap;
waypointStyleMap.setId("map-waypoint");
- waypointStyleMap.insert("normal", QString("#").append(waypointStyle->id()));
+ waypointStyleMap.insert("normal", QLatin1Char('#') + waypointStyle->id());
doc->addStyleMap(waypointStyleMap);
doc->addStyle(waypointStyle);
diff --git a/src/plugins/runner/kml/KmlDocument.cpp b/src/plugins/runner/kml/KmlDocument.cpp
index b8e2dda..2faf6e8 100644
--- a/src/plugins/runner/kml/KmlDocument.cpp
+++ b/src/plugins/runner/kml/KmlDocument.cpp
@@ -39,7 +39,7 @@ void KmlDocument::removeDirectoryRecursively( const QString &path )
{
QStringList const subdirs = QDir( path ).entryList( QDir::Dirs | QDir::NoSymLinks | QDir::NoDotAndDotDot );
foreach( const QString &subdir, subdirs ) {
- removeDirectoryRecursively( path + '/' + subdir );
+ removeDirectoryRecursively(path + QLatin1Char('/') + subdir);
}
QDir::root().rmdir( path );
}
diff --git a/src/plugins/runner/kml/KmzHandler.cpp b/src/plugins/runner/kml/KmzHandler.cpp
index 7724fe4..f7bf807 100644
--- a/src/plugins/runner/kml/KmzHandler.cpp
+++ b/src/plugins/runner/kml/KmzHandler.cpp
@@ -33,7 +33,7 @@ bool KmzHandler::open(const QString &kmz, QString &error)
return false;
}
- m_kmzPath = filename + '/';
+ m_kmzPath = filename + QLatin1Char('/');
if (!zip.extractAll( m_kmzPath ))
{
error = QString("Failed to extract kmz file contents to %1").arg(m_kmzPath);
@@ -45,7 +45,7 @@ bool KmzHandler::open(const QString &kmz, QString &error)
//if (!fileInfo.isFile) {
// continue;
//}
- QString file = filename + '/' + fileInfo.filePath;
+ QString file = filename + QLatin1Char('/') + fileInfo.filePath;
m_kmzFiles << fileInfo.filePath;
if (file.endsWith(".kml", Qt::CaseInsensitive)) {
if ( !m_kmlFile.isEmpty() ) {
diff --git a/src/plugins/runner/local-osm-search/LocalOsmSearchRunner.cpp b/src/plugins/runner/local-osm-search/LocalOsmSearchRunner.cpp
index 47ba1b1..4cb57dd 100644
--- a/src/plugins/runner/local-osm-search/LocalOsmSearchRunner.cpp
+++ b/src/plugins/runner/local-osm-search/LocalOsmSearchRunner.cpp
@@ -110,10 +110,10 @@ void LocalOsmSearchRunner::search( const QString &searchTerm, const GeoDataLatLo
GeoDataPlacemark* hit = new GeoDataPlacemark;
hit->setName( placemark.name() );
if ( placemark.category() == OsmPlacemark::Address && !placemark.houseNumber().isEmpty() ) {
- hit->setName( hit->name() + ' ' + placemark.houseNumber() );
+ hit->setName(hit->name() + QLatin1Char(' ') + placemark.houseNumber());
}
if ( !placemark.additionalInformation().isEmpty() ) {
- hit->setName( hit->name() + '(' + placemark.additionalInformation() + ')' );
+ hit->setName(hit->name() + QLatin1Char('(') + placemark.additionalInformation() + QLatin1Char(')'));
}
if ( placemark.category() != OsmPlacemark::UnknownCategory ) {
hit->setVisualCategory( m_categoryMap[placemark.category()] );
diff --git a/src/plugins/runner/local-osm-search/OsmDatabase.cpp b/src/plugins/runner/local-osm-search/OsmDatabase.cpp
index 501f186..558b4da 100644
--- a/src/plugins/runner/local-osm-search/OsmDatabase.cpp
+++ b/src/plugins/runner/local-osm-search/OsmDatabase.cpp
@@ -109,7 +109,7 @@ QVector<OsmPlacemark> OsmDatabase::find( const DatabaseQuery &userQuery )
QLatin1String(" AND regions.lft <= ") + regionsQuery.value( 1 ).toString() + QLatin1Char(')');
regionCount++;
}
- regionRestriction += ')';
+ regionRestriction += QLatin1Char(')');
mDebug() << Q_FUNC_INFO << "region query in" << databaseFile << "with query" << regionsQueryString
<< "took" << regionTimer.elapsed() << "ms for" << regionCount << "results";
@@ -281,7 +281,7 @@ QString OsmDatabase::formatDistance( const GeoDataCoordinates &a, const GeoDataC
heading = QObject::tr( "north-east" );
}
- return fuzzyDistance + ' ' + heading;
+ return fuzzyDistance + QLatin1Char(' ') + heading;
}
qreal OsmDatabase::bearing( const GeoDataCoordinates &a, const GeoDataCoordinates &b )
diff --git a/src/plugins/runner/mapquest/MapQuestRunner.cpp b/src/plugins/runner/mapquest/MapQuestRunner.cpp
index 07ed380..cf4f751 100644
--- a/src/plugins/runner/mapquest/MapQuestRunner.cpp
+++ b/src/plugins/runner/mapquest/MapQuestRunner.cpp
@@ -60,9 +60,9 @@ void MapQuestRunner::retrieveRoute( const RouteRequest *route )
QString url = "http://open.mapquestapi.com/directions/v1/route?callback=renderAdvancedNarrative&outFormat=xml&narrativeType=text&shapeFormat=raw&generalize=0";
GeoDataCoordinates::Unit const degree = GeoDataCoordinates::Degree;
- append( &url, "from", QString::number( route->source().latitude( degree ), 'f', 6 ) + ',' + QString::number( route->source().longitude( degree ), 'f', 6 ) );
+ append(&url, "from", QString::number(route->source().latitude(degree), 'f', 6) + QLatin1Char(',') + QString::number(route->source().longitude(degree), 'f', 6));
for ( int i=1; i<route->size(); ++i ) {
- append( &url, "to", QString::number( route->at( i ).latitude( degree ), 'f', 6 ) + ',' + QString::number( route->at( i ).longitude( degree ), 'f', 6 ) );
+ append(&url, "to", QString::number(route->at(i).latitude(degree), 'f', 6) + QLatin1Char(',') + QString::number(route->at(i).longitude(degree), 'f', 6));
}
QString const unit = MarbleGlobal::getInstance()->locale()->measurementSystem() == MarbleLocale::MetricSystem ? "k" : "m";
@@ -167,7 +167,7 @@ void MapQuestRunner::handleError( QNetworkReply::NetworkError error )
void MapQuestRunner::append(QString *input, const QString &key, const QString &value)
{
- *input += '&' + key + '=' + value;
+ *input += QLatin1Char('&') + key + QLatin1Char('=') + value;
}
int MapQuestRunner::maneuverType( int mapQuestId )
diff --git a/src/plugins/runner/monav/MonavConfigWidget.cpp b/src/plugins/runner/monav/MonavConfigWidget.cpp
index 3019e46..3837325 100644
--- a/src/plugins/runner/monav/MonavConfigWidget.cpp
+++ b/src/plugins/runner/monav/MonavConfigWidget.cpp
@@ -662,7 +662,7 @@ void MonavConfigWidget::upgradeMap( int index )
QString payload = d->m_mapsModel->payload( index );
if ( !payload.isEmpty() ) {
foreach( const MonavStuffEntry &entry, d->m_remoteMaps ) {
- if ( entry.payload().endsWith( '/' + payload ) ) {
+ if (entry.payload().endsWith(QLatin1Char('/') + payload)) {
d->m_currentDownload = entry.payload();
d->install();
return;
diff --git a/src/plugins/runner/nominatim-search/OsmNominatimSearchRunner.cpp b/src/plugins/runner/nominatim-search/OsmNominatimSearchRunner.cpp
index 7036c98..8279dd5 100644
--- a/src/plugins/runner/nominatim-search/OsmNominatimSearchRunner.cpp
+++ b/src/plugins/runner/nominatim-search/OsmNominatimSearchRunner.cpp
@@ -158,7 +158,7 @@ void OsmNominatimRunner::handleResult( QNetworkReply* reply )
QString description;
for (int i=0; i<place.childNodes().size(); ++i) {
QDomElement item = place.childNodes().at(i).toElement();
- description += item.nodeName() + ':' + item.text() + '\n';
+ description += item.nodeName() + QLatin1Char(':') + item.text() + QLatin1Char('\n');
}
description += QLatin1String("Category: ") + key + QLatin1Char('/') + value;
diff --git a/src/plugins/runner/open-source-routing-machine/OSRMRunner.cpp b/src/plugins/runner/open-source-routing-machine/OSRMRunner.cpp
index 14839a2..e303ac3 100644
--- a/src/plugins/runner/open-source-routing-machine/OSRMRunner.cpp
+++ b/src/plugins/runner/open-source-routing-machine/OSRMRunner.cpp
@@ -63,7 +63,7 @@ void OSRMRunner::retrieveRoute( const RouteRequest *route )
QString const invalidEntry = "invalid";
for ( int i=0; i<route->size(); ++i ) {
GeoDataCoordinates const coordinates = route->at( i );
- append( &url, "loc", QString::number( coordinates.latitude( degree ), 'f', 6 ) + ',' + QString::number( coordinates.longitude( degree ), 'f', 6 ) );
+ append(&url, "loc", QString::number(coordinates.latitude(degree), 'f', 6) + QLatin1Char(',') + QString::number(coordinates.longitude(degree), 'f', 6));
foreach( const CachePair &hint, m_cachedHints ) {
if ( hint.first == coordinates && hint.second != invalidEntry && m_hintChecksum != invalidEntry ) {
append( &url, "hint", hint.second );
@@ -130,7 +130,7 @@ void OSRMRunner::get()
void OSRMRunner::append(QString *input, const QString &key, const QString &value)
{
- *input += '&' + key + '=' + value;
+ *input += QLatin1Char('&') + key + QLatin1Char('=') + value;
}
GeoDataLineString *OSRMRunner::decodePolyline( const QString &geometry )
@@ -200,7 +200,7 @@ GeoDataDocument *OSRMRunner::parse( const QByteArray &input ) const
{
QScriptEngine engine;
// Qt requires parentheses around json code
- QScriptValue const data = engine.evaluate( '(' + QString::fromUtf8( input ) + ')' );
+ QScriptValue const data = engine.evaluate(QLatin1Char('(') + QString::fromUtf8(input) + QLatin1Char(')'));
GeoDataDocument* result = 0;
GeoDataLineString* routeWaypoints = 0;
diff --git a/src/plugins/runner/osm/OsmWay.cpp b/src/plugins/runner/osm/OsmWay.cpp
index 04dd681..a5f081d 100644
--- a/src/plugins/runner/osm/OsmWay.cpp
+++ b/src/plugins/runner/osm/OsmWay.cpp
@@ -115,7 +115,7 @@ bool OsmWay::isArea() const
}
for (auto iter = m_osmData.tagsBegin(), end=m_osmData.tagsEnd(); iter != end; ++iter) {
- QString const keyValue = QString("%1=%2").arg(iter.key()).arg(iter.value());
+ QString const keyValue = iter.key() + QLatin1Char('=') + iter.value();
if (isAreaTag(keyValue)) {
return true;
}
diff --git a/tools/asc2kml/asc2kml.cpp b/tools/asc2kml/asc2kml.cpp
index c421400..3055d3a 100644
--- a/tools/asc2kml/asc2kml.cpp
+++ b/tools/asc2kml/asc2kml.cpp
@@ -102,8 +102,7 @@ int main(int argc, char *argv[])
while ( !supportstream.atEnd() ) {
const QString supportrawline = supportstream.readLine();
const QStringList supportsplitline = supportrawline.split('\t');
- if(supportsplitline[0] == (country + '.' +statecode))
- {
+ if (supportsplitline[0] == (country + QLatin1Char('.') +statecode)) {
state = supportsplitline[1];
break;
}
diff --git a/tools/osm-addresses/OsmParser.cpp b/tools/osm-addresses/OsmParser.cpp
index ddeced0..de64573 100644
--- a/tools/osm-addresses/OsmParser.cpp
+++ b/tools/osm-addresses/OsmParser.cpp
@@ -621,7 +621,7 @@ bool OsmParser::shouldSave( ElementType /*type*/, const QString &key, const QStr
void OsmParser::setCategory( Element &element, const QString &key, const QString &value )
{
- QString const term = key + '/' + value;
+ QString const term = key + QLatin1Char('/') + value;
if ( m_categoryMap.contains( term ) ) {
if ( element.category != OsmPlacemark::UnknownCategory ) {
qDebug() << "Overwriting category " << element.category << " with " << m_categoryMap[term] << " for " << element.name;
@@ -731,10 +731,10 @@ void OsmParser::writeKml( const QString &area, const QString &version, const QSt
GeoDataStyleMap styleMap;
styleMap.setId( color.name().replace( '#', 'f' ) );
- styleMap.insert( "normal", QString( "#" ).append( style->id() ) );
+ styleMap.insert("normal", QLatin1Char('#') + style->id());
document->addStyle( style );
- placemark->setStyleUrl( QString( "#" ).append( styleMap.id() ) );
+ placemark->setStyleUrl(QLatin1Char('#') + styleMap.id());
//placemark->setGeometry( new GeoDataLinearRing( region.region.geometry().outerBoundary() ) );
GeoDataMultiGeometry *geometry = new GeoDataMultiGeometry;
diff --git a/tools/osm-simplify/main.cpp b/tools/osm-simplify/main.cpp
index bbe8626..3c9f83c 100644
--- a/tools/osm-simplify/main.cpp
+++ b/tools/osm-simplify/main.cpp
@@ -84,7 +84,7 @@ GeoDataDocument* mergeDocuments(GeoDataDocument* map1, GeoDataDocument* map2)
bool writeTile(const QCommandLineParser &parser, const QString &outputName, GeoDataDocument* tile, int x, int y, int zoomLevel)
{
QString const extension = parser.value("extension");
- QString const baseDir = parser.isSet("output") ? QString("%1/").arg(outputName) : QString();
+ QString const baseDir = parser.isSet("output") ? (outputName + QLatin1Char('/')) : QString();
QString const outputDir = QString("%1%2/%3").arg(baseDir).arg(zoomLevel).arg(x);
QDir().mkpath(outputDir);
QString const outputFile = QString("%1/%2.%3").arg(outputDir).arg(y).arg(extension);
diff --git a/tools/osm-sisyphus/job.cpp b/tools/osm-sisyphus/job.cpp
index 7083a51..fa40afa 100644
--- a/tools/osm-sisyphus/job.cpp
+++ b/tools/osm-sisyphus/job.cpp
@@ -86,8 +86,8 @@ void Job::changeStatus(Job::Status status, const QString &message)
case Error: statusType = "error"; break;
}
- Logger::instance().setStatus(m_region.id() + '_' + m_transport,
- m_region.name() + QLatin1String( " (" ) + m_transport + ')', statusType, message);
+ Logger::instance().setStatus(m_region.id() + QLatin1Char('_') + m_transport,
+ m_region.name() + QLatin1String(" (") + m_transport + QLatin1Char(')'), statusType, message);
m_statusMessage = message;
m_status = status;
}
@@ -182,7 +182,7 @@ bool Job::monav()
if (subdir.exists() && subdir.isDir()) {
QFileInfoList files = QDir(subdir.absoluteFilePath()).entryInfoList(QDir::Files);
foreach(const QFileInfo &file, files) {
- if (!QFile::rename(file.absoluteFilePath(), monavDir().absoluteFilePath() + '/' + file.fileName())) {
+ if (!QFile::rename(file.absoluteFilePath(), monavDir().absoluteFilePath() + QLatin1Char('/') + file.fileName())) {
changeStatus(Error, "Unable to move monav files to target directory.");
return false;
}
diff --git a/tools/osm-sisyphus/jobqueue.cpp b/tools/osm-sisyphus/jobqueue.cpp
index 1ce8950..2953015 100644
--- a/tools/osm-sisyphus/jobqueue.cpp
+++ b/tools/osm-sisyphus/jobqueue.cpp
@@ -35,7 +35,7 @@ void JobQueue::addJob(Job *newJob)
if (m_runningJobs.size()<m_maxConcurrentJobs) {
startJob(newJob);
} else {
- Logger::instance().setStatus(newJob->region().id() + '_' + newJob->transport(), newJob->region().name() + QLatin1String( " (" ) + newJob->transport() + ')', "waiting", "Queued.");
+ Logger::instance().setStatus(newJob->region().id() + QLatin1Char('_') + newJob->transport(), newJob->region().name() + QLatin1String(" (") + newJob->transport() + QLatin1Char(')'), "waiting", "Queued.");
m_jobs << newJob;
}
}
diff --git a/tools/osm-sisyphus/upload.cpp b/tools/osm-sisyphus/upload.cpp
index fea51c9..cc4eeec 100644
--- a/tools/osm-sisyphus/upload.cpp
+++ b/tools/osm-sisyphus/upload.cpp
@@ -27,8 +27,8 @@ Upload::Upload(QObject *parent) :
void Upload::changeStatus(const Package &package, const QString &status, const QString &message)
{
- Logger::instance().setStatus( package.region.id() + '_' + package.transport,
- package.region.name() + QLatin1String( " (" ) + package.transport + ')', status, message);
+ Logger::instance().setStatus(package.region.id() + QLatin1Char('_') + package.transport,
+ package.region.name() + QLatin1String(" (") + package.transport + QLatin1Char(')'), status, message);
}
void Upload::processQueue()
@@ -71,8 +71,8 @@ bool Upload::upload(const Package &package)
QProcess scp;
arguments.clear();
arguments << package.file.absoluteFilePath();
- QString target = remoteDir + '/' + package.file.fileName();
- arguments << auth + ':' + target;
+ const QString target = remoteDir + QLatin1Char('/') + package.file.fileName();
+ arguments << auth + QLatin1Char(':') + target;
scp.start("scp", arguments);
scp.waitForFinished(1000 * 60 * 60 * 12); // wait up to 12 hours for upload to complete
if (scp.exitStatus() != QProcess::NormalExit || scp.exitCode() != 0) {
diff --git a/tools/poly2kml/main.cpp b/tools/poly2kml/main.cpp
index 5e2756d..0193387 100644
--- a/tools/poly2kml/main.cpp
+++ b/tools/poly2kml/main.cpp
@@ -105,11 +105,11 @@ void parseBoundingBox( const QFileInfo &file, const QString &name,
GeoDataStyleMap styleMap;
styleMap.setId("map-border");
- styleMap.insert("normal", QString("#").append(style->id()));
+ styleMap.insert("normal", QLatin1Char('#') + style->id());
document->addStyleMap(styleMap);
document->addStyle(style);
- placemark->setStyleUrl(QString("#").append(styleMap.id()));
+ placemark->setStyleUrl(QLatin1Char('#') + styleMap.id());
placemark->setName( name );
if ( !version.isEmpty() ) {
diff --git a/tools/speaker-files/main.cpp b/tools/speaker-files/main.cpp
index a68291f..31e6229 100644
--- a/tools/speaker-files/main.cpp
+++ b/tools/speaker-files/main.cpp
@@ -282,7 +282,7 @@ int process( const QDir &input, const QDir &output, const QString &xml )
qDebug() << "Name: " << name;
QString const simpleNick = QString( nick ).replace( QLatin1Char(' '), QLatin1Char('-') );
- QString const nickDir = output.filePath( "files.kde.org" ) + '/' + simpleNick;
+ QString const nickDir = output.filePath("files.kde.org") + QLatin1Char('/') + simpleNick;
QDir::root().mkdir( nickDir );
extract( zip, extracted );
normalize( extracted );
diff --git a/tools/tilecreator-srtm2/tccore.cpp b/tools/tilecreator-srtm2/tccore.cpp
index b71d6cb..fa8ca97 100644
--- a/tools/tilecreator-srtm2/tccore.cpp
+++ b/tools/tilecreator-srtm2/tccore.cpp
@@ -130,7 +130,7 @@ private:
QStringList dirs;
dirs << "Africa" << "Australia" << "Eurasia" << "Silands" << "North_America" << "South_America";
foreach( const QString &dir, dirs) {
- QString fileName = m_sourceDir + '/' + dir + '/';
+ QString fileName = m_sourceDir + QLatin1Char('/') + dir + QLatin1Char('/');
if ( lat < 0 ) lat *= -1;
fileName += QString( "%1%2%3%4.hgt" ).arg( NS ).arg( lat<0 ? lat*-1 : lat, 2, 10, QLatin1Char('0') )
.arg( EW ).arg( lng<0 ? lng*-1 : lng, 3, 10, QLatin1Char('0' ) );
@@ -141,7 +141,7 @@ private:
QProcess p;
p.execute("unzip", QStringList() << fileName + QLatin1String(".zip"));
p.waitForFinished();
- QFile( QDir::currentPath() + '/' + QFileInfo( fileName ).fileName()).rename(fileName);
+ QFile(QDir::currentPath() + QLatin1Char('/') + QFileInfo(fileName).fileName()).rename(fileName);
}
if ( QFile::exists( fileName ) ) {
return fileName;