summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFriedrich W. H. Kossebau <kossebau@kde.org>2016-08-24 19:32:48 (GMT)
committerFriedrich W. H. Kossebau <kossebau@kde.org>2016-08-24 19:32:48 (GMT)
commit5b6f30c7d24825c30cbab7b015ccbc06ebb3728f (patch)
treef7b8d80f23dfc6cc98d11120ad4163bc5183eb9f
parente25f8b7b92e3c5ade103d99c8e5c9b7878c6f041 (diff)
Use QLatin1String in string calculation expressions
-rw-r--r--examples/cpp/marble-game/ClickOnThat.cpp4
-rw-r--r--examples/cpp/marble-game/gamemain.cpp4
-rw-r--r--src/apps/marble-kde/kdemain.cpp2
-rw-r--r--src/apps/marble-kde/marble_part.cpp2
-rw-r--r--src/apps/marble-qt/QtMainWindow.cpp6
-rw-r--r--src/apps/marble-qt/qtmain.cpp6
-rw-r--r--src/apps/marble-ui/ControlView.cpp48
-rw-r--r--src/lib/marble/AbstractDataPluginModel.cpp4
-rw-r--r--src/lib/marble/BookmarkManagerDialog.cpp4
-rw-r--r--src/lib/marble/CelestialSortFilterProxyModel.cpp6
-rw-r--r--src/lib/marble/CurrentLocationWidget.cpp24
-rw-r--r--src/lib/marble/DiscCache.cpp2
-rw-r--r--src/lib/marble/ExternalEditorDialog.cpp6
-rw-r--r--src/lib/marble/FileLoader.cpp6
-rw-r--r--src/lib/marble/FileStoragePolicy.cpp8
-rw-r--r--src/lib/marble/FileStorageWatcher.cpp4
-rw-r--r--src/lib/marble/GeoDataTreeModel.cpp2
-rw-r--r--src/lib/marble/MapThemeDownloadDialog.cpp4
-rw-r--r--src/lib/marble/MapThemeManager.cpp10
-rw-r--r--src/lib/marble/MapThemeSortFilterProxyModel.cpp4
-rw-r--r--src/lib/marble/MapViewItemDelegate.cpp2
-rw-r--r--src/lib/marble/MapViewWidget.cpp5
-rw-r--r--src/lib/marble/MapWizard.cpp22
-rw-r--r--src/lib/marble/MarbleAboutDialog.cpp4
-rw-r--r--src/lib/marble/MarbleDirs.cpp26
-rw-r--r--src/lib/marble/MarbleLegendBrowser.cpp62
-rw-r--r--src/lib/marble/MarbleWidget.cpp4
-rw-r--r--src/lib/marble/MarbleWidgetPopupMenu.cpp12
-rw-r--r--src/lib/marble/MergedLayerDecorator.cpp2
-rw-r--r--src/lib/marble/MovieCapture.cpp2
-rw-r--r--src/lib/marble/MovieCaptureDialog.cpp6
-rw-r--r--src/lib/marble/NewstuffModel.cpp4
-rw-r--r--src/lib/marble/PluginAboutDialog.cpp11
-rw-r--r--src/lib/marble/PopupItem.cpp4
-rw-r--r--src/lib/marble/PositionTracking.cpp2
-rw-r--r--src/lib/marble/RemoteIconLoader.cpp4
-rw-r--r--src/lib/marble/ServerLayout.cpp2
-rw-r--r--src/lib/marble/StyleBuilder.cpp8
-rw-r--r--src/lib/marble/TemplateDocument.cpp4
-rw-r--r--src/lib/marble/TileCreator.cpp7
-rw-r--r--src/lib/marble/TileCreatorDialog.cpp2
-rw-r--r--src/lib/marble/TinyWebBrowser.cpp2
-rw-r--r--src/lib/marble/TourCaptureDialog.cpp6
-rw-r--r--src/lib/marble/cloudsync/BookmarkSyncManager.cpp4
-rw-r--r--src/lib/marble/cloudsync/CloudRouteModel.cpp4
-rw-r--r--src/lib/marble/cloudsync/OwncloudSyncBackend.cpp4
-rw-r--r--src/lib/marble/cloudsync/RouteSyncManager.cpp9
-rw-r--r--src/lib/marble/declarative/OfflineDataModel.cpp4
-rw-r--r--src/lib/marble/declarative/Placemark.cpp8
-rw-r--r--src/lib/marble/geodata/data/GeoDataCoordinates.cpp2
-rw-r--r--src/lib/marble/geodata/data/LonLatParser.cpp4
-rw-r--r--src/lib/marble/geodata/graphicsitem/GeoLineStringGraphicsItem.cpp6
-rw-r--r--src/lib/marble/geodata/graphicsitem/GeoPhotoGraphicsItem.cpp2
-rw-r--r--src/lib/marble/geodata/graphicsitem/GeoPointGraphicsItem.cpp2
-rw-r--r--src/lib/marble/geodata/graphicsitem/GeoPolygonGraphicsItem.cpp8
-rw-r--r--src/lib/marble/geodata/graphicsitem/GeoTrackGraphicsItem.cpp2
-rw-r--r--src/lib/marble/geodata/handlers/kml/KmlWhenTagHandler.cpp4
-rw-r--r--src/lib/marble/geodata/parser/GeoParser.cpp8
-rw-r--r--src/lib/marble/geodata/scene/GeoSceneHead.cpp2
-rw-r--r--src/lib/marble/geodata/scene/GeoSceneTileDataset.cpp6
-rw-r--r--src/lib/marble/osm/OsmRelationManagerWidget_p.cpp2
-rw-r--r--src/lib/marble/routing/RoutingManager.cpp8
-rw-r--r--src/lib/marble/routing/RoutingModel.cpp26
-rw-r--r--src/lib/marble/routing/RoutingWidget.cpp9
-rw-r--r--src/lib/marble/routing/SpeakersModel.cpp4
-rw-r--r--src/lib/marble/routing/VoiceNavigationModel.cpp4
-rw-r--r--src/plugins/render/annotate/EditPolygonDialog.cpp2
-rw-r--r--src/plugins/render/annotate/EditPolylineDialog.cpp2
-rw-r--r--src/plugins/render/annotate/GroundOverlayFrame.cpp64
-rw-r--r--src/plugins/render/aprs/AprsPlugin.cpp2
-rw-r--r--src/plugins/render/earthquake/EarthquakeItem.cpp13
-rw-r--r--src/plugins/render/earthquake/EarthquakeModel.cpp18
-rw-r--r--src/plugins/render/elevationprofilefloatitem/ElevationProfileDataSource.cpp2
-rw-r--r--src/plugins/render/elevationprofilefloatitem/ElevationProfileFloatItem.cpp2
-rw-r--r--src/plugins/render/foursquare/FoursquareModel.cpp28
-rw-r--r--src/plugins/render/mapscale/MapScaleFloatItem.cpp7
-rw-r--r--src/plugins/render/measure/MeasureToolPlugin.cpp4
-rw-r--r--src/plugins/render/navigation/ArrowDiscWidget.cpp2
-rw-r--r--src/plugins/render/navigation/NavigationFloatItem.cpp2
-rw-r--r--src/plugins/render/navigation/NavigationSlider.cpp2
-rw-r--r--src/plugins/render/opencaching/OpenCachingItem.cpp31
-rw-r--r--src/plugins/render/opencaching/OpenCachingModel.cpp14
-rw-r--r--src/plugins/render/opencachingcom/OpenCachingComItem.cpp97
-rw-r--r--src/plugins/render/opencachingcom/OpenCachingComModel.cpp2
-rw-r--r--src/plugins/render/opendesktop/OpenDesktopItem.cpp22
-rw-r--r--src/plugins/render/opendesktop/OpenDesktopModel.cpp14
-rw-r--r--src/plugins/render/overviewmap/OverviewMap.cpp9
-rw-r--r--src/plugins/render/panoramio/PanoramioModel.cpp22
-rw-r--r--src/plugins/render/panoramio/PanoramioParser.cpp2
-rw-r--r--src/plugins/render/photo/PhotoPluginItem.cpp3
-rw-r--r--src/plugins/render/photo/PhotoPluginModel.cpp14
-rw-r--r--src/plugins/render/postalcode/PostalCodeModel.cpp2
-rw-r--r--src/plugins/render/routing/RoutingPlugin.cpp2
-rw-r--r--src/plugins/render/satellites/TrackerPluginModel.cpp2
-rw-r--r--src/plugins/render/twitter/jsonparser.cpp4
-rw-r--r--src/plugins/render/twitter/twitterPlugin.cpp6
-rw-r--r--src/plugins/render/weather/BBCWeatherItem.cpp2
-rw-r--r--src/plugins/render/weather/GeoNamesWeatherService.cpp2
-rw-r--r--src/plugins/render/weather/WeatherData.cpp2
-rw-r--r--src/plugins/render/weather/WeatherItem.cpp2
-rw-r--r--src/plugins/render/wikipedia/WikipediaItem.cpp20
-rw-r--r--src/plugins/runner/cyclestreets/CycleStreetsRunner.cpp2
-rw-r--r--src/plugins/runner/gosmore-reversegeocoding/GosmoreReverseGeocodingPlugin.cpp2
-rw-r--r--src/plugins/runner/gosmore-reversegeocoding/GosmoreReverseGeocodingRunner.cpp2
-rw-r--r--src/plugins/runner/gosmore-routing/GosmoreRoutingPlugin.cpp2
-rw-r--r--src/plugins/runner/gosmore-routing/GosmoreRoutingRunner.cpp2
-rw-r--r--src/plugins/runner/gpsbabel/GpsbabelRunner.cpp9
-rw-r--r--src/plugins/runner/gpx/handlers/GPXcmtTagHandler.cpp2
-rw-r--r--src/plugins/runner/gpx/handlers/GPXdescTagHandler.cpp4
-rw-r--r--src/plugins/runner/gpx/handlers/GPXlinkTagHandler.cpp2
-rw-r--r--src/plugins/runner/kml/KmzHandler.cpp2
-rw-r--r--src/plugins/runner/local-osm-search/LocalOsmSearchPlugin.cpp4
-rw-r--r--src/plugins/runner/local-osm-search/OsmDatabase.cpp34
-rw-r--r--src/plugins/runner/monav/MonavConfigWidget.cpp2
-rw-r--r--src/plugins/runner/monav/MonavMap.cpp4
-rw-r--r--src/plugins/runner/monav/MonavPlugin.cpp2
-rw-r--r--src/plugins/runner/nominatim-search/OsmNominatimSearchRunner.cpp10
-rw-r--r--src/plugins/runner/openrouteservice/OpenRouteServiceRunner.cpp58
-rw-r--r--src/plugins/runner/osm/OsmWay.cpp2
-rw-r--r--src/plugins/runner/osm/writers/OsmTagWriter.cpp2
-rw-r--r--src/plugins/runner/routino/RoutinoPlugin.cpp2
-rw-r--r--src/plugins/runner/routino/RoutinoRunner.cpp8
-rw-r--r--src/plugins/runner/traveling-salesman/TravelingSalesmanRunner.cpp2
-rw-r--r--tools/maptheme-previewimage/main.cpp4
-rw-r--r--tools/osm-sisyphus/job.cpp30
-rw-r--r--tools/osm-sisyphus/upload.cpp4
-rw-r--r--tools/routing-instructions/main.cpp4
-rw-r--r--tools/sentineltile/tileprocessor.cpp4
-rw-r--r--tools/speaker-files/main.cpp14
-rw-r--r--tools/stars/stars.cpp14
-rw-r--r--tools/tilecreator-srtm2/tccore.cpp4
131 files changed, 574 insertions, 578 deletions
diff --git a/examples/cpp/marble-game/ClickOnThat.cpp b/examples/cpp/marble-game/ClickOnThat.cpp
index ccff8f6..515d8fb 100644
--- a/examples/cpp/marble-game/ClickOnThat.cpp
+++ b/examples/cpp/marble-game/ClickOnThat.cpp
@@ -248,10 +248,10 @@ void ClickOnThat::updateSelectPin(bool result, const GeoDataCoordinates &clicked
QString iconPath = dir.absolutePath();
if ( result ) {
//iconPath = MarbleDirs::path("bitmaps/MapTackRoundHeadGreen.png");
- iconPath = iconPath.append("/MapTackRoundHeadGreen.png");
+ iconPath += QLatin1String("/MapTackRoundHeadGreen.png");
}
else {
- iconPath = iconPath.append("/MapTackRoundHeadRed.png");
+ iconPath += QLatin1String("/MapTackRoundHeadRed.png");
}
GeoDataStyle::Ptr style = d->m_selectPinDocument->style("answer");
diff --git a/examples/cpp/marble-game/gamemain.cpp b/examples/cpp/marble-game/gamemain.cpp
index 531723c..9455ac8 100644
--- a/examples/cpp/marble-game/gamemain.cpp
+++ b/examples/cpp/marble-game/gamemain.cpp
@@ -35,7 +35,7 @@ int main(int argc, char *argv[])
QString lang = QLocale::system().name().section('_', 0, 0);
QTranslator translator;
- translator.load( "marble-" + lang, MarbleDirs::path(QString("lang") ) );
+ translator.load(QLatin1String("marble-") + lang, MarbleDirs::path(QStringLiteral("lang")));
app.installTranslator(&translator);
// For non static builds on mac and win
@@ -45,7 +45,7 @@ int main(int argc, char *argv[])
#ifdef Q_WS_WIN
QApplication::addLibraryPath( QApplication::applicationDirPath()
- + QDir::separator() + "plugins" );
+ + QDir::separator() + QLatin1String("plugins"));
#endif
QString marbleDataPath;
diff --git a/src/apps/marble-kde/kdemain.cpp b/src/apps/marble-kde/kdemain.cpp
index 85cf159..1f543d7 100644
--- a/src/apps/marble-kde/kdemain.cpp
+++ b/src/apps/marble-kde/kdemain.cpp
@@ -42,7 +42,7 @@ using namespace Marble;
static bool loadTranslation(const QString &localeDirName, QApplication &app)
{
- const QString subPath = QStringLiteral("locale/") + localeDirName + QStringLiteral("/LC_MESSAGES/marble_qt.qm");
+ const QString subPath = QLatin1String("locale/") + localeDirName + QLatin1String("/LC_MESSAGES/marble_qt.qm");
const QString fullPath = QStandardPaths::locate(QStandardPaths::GenericDataLocation, subPath);
if (fullPath.isEmpty()) {
return false;
diff --git a/src/apps/marble-kde/marble_part.cpp b/src/apps/marble-kde/marble_part.cpp
index 4ce068b..657aec5 100644
--- a/src/apps/marble-kde/marble_part.cpp
+++ b/src/apps/marble-kde/marble_part.cpp
@@ -1116,7 +1116,7 @@ void MarblePart::migrateNewstuffConfigFiles() const
// shared between Marble KDE and Marble Qt in Marble's data path of the user.
// This method moves an old KDE newstuff config file to the new location if the former
// exists and the latter not.
- QFileInfo const target( MarbleDirs::localPath() + "/newstuff/marble-map-themes.knsregistry" );
+ QFileInfo const target(MarbleDirs::localPath() + QLatin1String("/newstuff/marble-map-themes.knsregistry"));
if ( !target.exists() ) {
QString const source = QStandardPaths::locate( QStandardPaths::GenericDataLocation, "knewstuff3/marble.knsregistry" );
if ( !source.isEmpty() ) {
diff --git a/src/apps/marble-qt/QtMainWindow.cpp b/src/apps/marble-qt/QtMainWindow.cpp
index cc68032..b6115e4 100644
--- a/src/apps/marble-qt/QtMainWindow.cpp
+++ b/src/apps/marble-qt/QtMainWindow.cpp
@@ -720,7 +720,7 @@ void MainWindow::createPluginMenus()
const QList<QActionGroup*> *tmp_toolbarActionGroups = (*i)->toolbarActionGroups();
if ( (*i)->enabled() && tmp_toolbarActionGroups ) {
QToolBar* toolbar = new QToolBar(this);
- toolbar->setObjectName( QString( "plugin-toolbar-%1" ).arg( (*i)->nameId() ) );
+ toolbar->setObjectName(QLatin1String("plugin-toolbar-") + (*i)->nameId());
foreach( QActionGroup* ag, *tmp_toolbarActionGroups ) {
toolbar->addActions( ag->actions() );
@@ -910,8 +910,10 @@ void MainWindow::handbook()
{
const QString code = MarbleLocale::languageCode();
- QUrl handbookLocation( "http://docs.kde.org/stable/" + code + "/kdeedu/marble/index.html" );
+ QUrl handbookLocation(QLatin1String("http://docs.kde.org/stable/") + code + QLatin1String("/kdeedu/marble/index.html"));
+ // TODO: this logic seems broken. Should that check "code.isEmpty()" instead?
+ // and how do we konw there is a doc for the code?
if ( handbookLocation.isEmpty() )
handbookLocation = QUrl("http://docs.kde.org/stable/en/kdeedu/marble/index.html");
diff --git a/src/apps/marble-qt/qtmain.cpp b/src/apps/marble-qt/qtmain.cpp
index 96f542f..ba84cf0 100644
--- a/src/apps/marble-qt/qtmain.cpp
+++ b/src/apps/marble-qt/qtmain.cpp
@@ -48,7 +48,7 @@ int main(int argc, char *argv[])
QString lang = QLocale::system().name().section('_', 0, 0);
QTranslator translator;
- translator.load( "marble-" + lang, MarbleDirs::path(QString("lang") ) );
+ translator.load(QLatin1String("marble-") + lang, MarbleDirs::path(QStringLiteral("lang")));
app.installTranslator(&translator);
app.setApplicationDisplayName(MainWindow::tr("Marble - Virtual Globe"));
@@ -59,7 +59,7 @@ int main(int argc, char *argv[])
#ifdef Q_WS_WIN
QApplication::addLibraryPath( QApplication::applicationDirPath()
- + QDir::separator() + "plugins" );
+ + QDir::separator() + QLatin1String("plugins"));
#endif
#ifdef Q_OS_MACX
QApplication::instance()->setAttribute(Qt::AA_DontShowIconsInMenus);
@@ -76,7 +76,7 @@ int main(int argc, char *argv[])
// lets try to set the qt plugin search path...
if (myPath.contains(".app"))
{
- myPath += "/Contents/plugins";
+ myPath += QLatin1String("/Contents/plugins");
QApplication::addLibraryPath( myPath );
qDebug( "Added %s to plugin search path", qPrintable( myPath ) );
}
diff --git a/src/apps/marble-ui/ControlView.cpp b/src/apps/marble-ui/ControlView.cpp
index 3bbb7d4..4305a8f 100644
--- a/src/apps/marble-ui/ControlView.cpp
+++ b/src/apps/marble-ui/ControlView.cpp
@@ -239,7 +239,7 @@ void ControlView::printMapScreenShot( QPointer<QPrintDialog> printDialog)
printDrivingInstructionsAdvice( document, text );
}
- text += "</body></html>";
+ text += QLatin1String("</body></html>");
document.setHtml( text );
document.print( printDialog->printer() );
@@ -415,21 +415,21 @@ void ControlView::printRouteSummary( QTextDocument &document, QString &text)
summary = summary.arg(destination).arg( distance, 0, 'f', precision ).arg( unit );
text += summary;
- text += "<table cellpadding=\"2\">";
+ text += QLatin1String("<table cellpadding=\"2\">");
QString pixmapTemplate = "marble://viaPoint-%1.png";
for ( int i=0; i<routeRequest->size(); ++i ) {
- text += "<tr><td>";
+ text += QLatin1String("<tr><td>");
QPixmap pixmap = routeRequest->pixmap(i);
QString pixmapResource = pixmapTemplate.arg( i );
document.addResource(QTextDocument::ImageResource,
QUrl( pixmapResource ), QVariant( pixmap ) );
QString myimg = "<img src=\"%1\">";
- text += myimg.arg( pixmapResource );
- text += "</td><td>";
- text += routeRequest->name( i );
- text += "</td></tr>";
+ text += myimg.arg(pixmapResource) +
+ QLatin1String("</td><td>");
+ routeRequest->name(i) +
+ QLatin1String("</td></tr>");
}
- text += "</table>";
+ text += QLatin1String("</table>");
}
#endif
}
@@ -445,8 +445,8 @@ void ControlView::printDrivingInstructions( QTextDocument &document, QString &te
GeoDataLineString total = routingModel->route().path();
- text += "<table cellpadding=\"4\">";
- text += "<tr><th>No.</th><th>Distance</th><th>Instruction</th></tr>";
+ text += QLatin1String("<table cellpadding=\"4\">"
+ "<tr><th>No.</th><th>Distance</th><th>Instruction</th></tr>");
for ( int i=0; i<routingModel->rowCount(); ++i ) {
QModelIndex index = routingModel->index(i, 0);
GeoDataCoordinates coordinates = index.data( RoutingModel::CoordinateRole ).value<GeoDataCoordinates>();
@@ -459,18 +459,18 @@ void ControlView::printDrivingInstructions( QTextDocument &document, QString &te
}
if ( i%2 == 0 ) {
- text += "<tr bgcolor=\"lightGray\"><td align=\"right\" valign=\"middle\">";
+ text += QLatin1String("<tr bgcolor=\"lightGray\"><td align=\"right\" valign=\"middle\">");
}
else {
- text += "<tr><td align=\"right\" valign=\"middle\">";
+ text += QLatin1String("<tr><td align=\"right\" valign=\"middle\">");
}
- text += QString::number( i+1 );
- text += "</td><td align=\"right\" valign=\"middle\">";
+ text += QString::number(i+1) +
+ QLatin1String("</td><td align=\"right\" valign=\"middle\">");
qreal planetRadius = marbleModel()->planet()->radius();
- text += QString::number( accumulator.length( planetRadius ) * METER2KM, 'f', 1 );
- /** @todo: support localization */
- text += " km</td><td valign=\"middle\">";
+ text += QString::number(accumulator.length(planetRadius) * METER2KM, 'f', 1) +
+ /** @todo: support localization */
+ QLatin1String(" km</td><td valign=\"middle\">");
QPixmap instructionIcon = index.data( Qt::DecorationRole ).value<QPixmap>();
if ( !instructionIcon.isNull() ) {
@@ -479,20 +479,20 @@ void ControlView::printDrivingInstructions( QTextDocument &document, QString &te
text += QString("<img src=\"%1\">").arg(uri);
}
- text += routingModel->data( index ).toString();
- text += "</td></tr>";
+ text += routingModel->data( index ).toString() +
+ QLatin1String("</td></tr>");
}
- text += "</table>";
+ text += QLatin1String("</table>");
#endif
}
void ControlView::printDrivingInstructionsAdvice( QTextDocument &, QString &text )
{
#ifndef QT_NO_PRINTER
- text += "<p>" + tr( "The Marble development team wishes you a pleasant and safe journey." ) + "</p>";
- text += "<p>" + tr( "Caution: Driving instructions may be incomplete or inaccurate." );
- text += ' ' + tr( "Road construction, weather and other unforeseen variables can result in this suggested route not to be the most expedient or safest route to your destination." );
- text += ' ' + tr( "Please use common sense while navigating." ) + "</p>";
+ text += QLatin1String("<p>") + tr("The Marble development team wishes you a pleasant and safe journey.") + QLatin1String("</p>") +
+ QLatin1String("<p>") + tr("Caution: Driving instructions may be incomplete or inaccurate.") +
+ QLatin1Char(' ') + tr("Road construction, weather and other unforeseen variables can result in this suggested route not to be the most expedient or safest route to your destination.") +
+ QLatin1Char(' ') + tr("Please use common sense while navigating.") + QLatin1String("</p>");
#endif
}
diff --git a/src/lib/marble/AbstractDataPluginModel.cpp b/src/lib/marble/AbstractDataPluginModel.cpp
index e35411f..d9b75b3 100644
--- a/src/lib/marble/AbstractDataPluginModel.cpp
+++ b/src/lib/marble/AbstractDataPluginModel.cpp
@@ -126,7 +126,7 @@ AbstractDataPluginModelPrivate::AbstractDataPluginModelPrivate( const QString& n
m_descriptionFileNumber( 0 ),
m_itemSettings(),
m_favoriteItemsOnly( false ),
- m_storagePolicy( MarbleDirs::localPath() + "/cache/" + m_name + '/' ),
+ m_storagePolicy(MarbleDirs::localPath() + QLatin1String("/cache/") + m_name + QLatin1Char('/')),
m_downloadManager( &m_storagePolicy ),
m_favoritesModel( 0 ),
m_hasMetaObject( false ),
@@ -535,7 +535,7 @@ QString AbstractDataPluginModelPrivate::generateFilename( const QString& id, con
QString AbstractDataPluginModelPrivate::generateFilepath( const QString& id, const QString& type ) const
{
- return MarbleDirs::localPath() + "/cache/" + m_name + '/' + generateFilename( id, type );
+ return MarbleDirs::localPath() + QLatin1String("/cache/") + m_name + QLatin1Char('/') + generateFilename(id, type);
}
AbstractDataPluginItem *AbstractDataPluginModel::findItem( const QString& id ) const
diff --git a/src/lib/marble/BookmarkManagerDialog.cpp b/src/lib/marble/BookmarkManagerDialog.cpp
index 7b9e5c3..a97324b 100644
--- a/src/lib/marble/BookmarkManagerDialog.cpp
+++ b/src/lib/marble/BookmarkManagerDialog.cpp
@@ -457,8 +457,8 @@ void BookmarkManagerDialog::importBookmarks()
QString const newBookmark = tr( "Imported bookmark" );
QString const existingBookmark = tr( "Existing bookmark" );
QString const question = tr( "Do you want to replace the existing bookmark with the imported one?" );
- QString html = "<p>%1</p><table><tr><td>%2</td><td><b>%3 / %4</b></td></tr>";
- html += "<tr><td>%5</td><td><b>%6 / %7</b></td></tr></table><p>%8</p>";
+ QString html = QLatin1String("<p>%1</p><table><tr><td>%2</td><td><b>%3 / %4</b></td></tr>"
+ "<tr><td>%5</td><td><b>%6 / %7</b></td></tr></table><p>%8</p>");
html = html.arg( intro ).arg( existingBookmark ).arg( existingFolder->name() );
html = html.arg( existingPlacemark->name() ).arg( newBookmark ).arg( newFolder->name() );
html = html.arg( newPlacemark->name() ).arg( question );
diff --git a/src/lib/marble/CelestialSortFilterProxyModel.cpp b/src/lib/marble/CelestialSortFilterProxyModel.cpp
index 6eb1baa..4ac7109 100644
--- a/src/lib/marble/CelestialSortFilterProxyModel.cpp
+++ b/src/lib/marble/CelestialSortFilterProxyModel.cpp
@@ -34,11 +34,11 @@ QVariant CelestialSortFilterProxyModel::data( const QModelIndex &index, int role
if ( role == Qt::DisplayRole && index.column() == 0 ) {
QString newOne = var.toString();
if (newOne == tr("Moon")) {
- return QString(" " + tr("Moon"));
+ return QString(QLatin1String(" ") + tr("Moon"));
} else if ( m_moons.contains( newOne.toLower() ) ) {
- return QString( " "+newOne+" (" + tr( "moon" ) + ')' );
+ return QString(QLatin1String(" ") + newOne + QLatin1String(" (") + tr("moon") + QLatin1Char(')'));
} else if ( m_dwarfs.contains( newOne.toLower() ) ) {
- return QString( newOne+ " (" + tr( "dwarf planet" ) + ')');
+ return QString(newOne + QLatin1String(" (") + tr("dwarf planet") + QLatin1Char(')'));
}
return newOne;
} else {
diff --git a/src/lib/marble/CurrentLocationWidget.cpp b/src/lib/marble/CurrentLocationWidget.cpp
index 54152d4..079c978 100644
--- a/src/lib/marble/CurrentLocationWidget.cpp
+++ b/src/lib/marble/CurrentLocationWidget.cpp
@@ -216,7 +216,7 @@ void CurrentLocationWidgetPrivate::adjustPositionTrackingStatus( PositionProvide
break;
}
- html += "</p></body></html>";
+ html += QLatin1String("</p></body></html>");
m_currentLocationUi.locationLabel->setEnabled( true );
m_currentLocationUi.locationLabel->setText( html );
}
@@ -259,15 +259,15 @@ void CurrentLocationWidgetPrivate::receiveGpsCoordinates( const GeoDataCoordinat
qreal altitude = 0.0;
qreal length = m_widget->model()->positionTracking()->length( m_widget->model()->planetRadius() );
- QString html = "<html><body>";
- html += "<table cellspacing=\"2\" cellpadding=\"2\">";
- html += "<tr><td>Longitude</td><td><a href=\"http://edu.kde.org/marble\">%1</a></td></tr>";
- html += "<tr><td>Latitude</td><td><a href=\"http://edu.kde.org/marble\">%2</a></td></tr>";
- html += "<tr><td>Altitude</td><td>%3</td></tr>";
- html += "<tr><td>Speed</td><td>%4</td></tr>";
- html += "<tr><td>Distance</td><td>%5</td></tr>";
- html += "</table>";
- html += "</body></html>";
+ QString html = QLatin1String("<html><body>"
+ "<table cellspacing=\"2\" cellpadding=\"2\">"
+ "<tr><td>Longitude</td><td><a href=\"http://edu.kde.org/marble\">%1</a></td></tr>"
+ "<tr><td>Latitude</td><td><a href=\"http://edu.kde.org/marble\">%2</a></td></tr>"
+ "<tr><td>Altitude</td><td>%3</td></tr>"
+ "<tr><td>Speed</td><td>%4</td></tr>"
+ "<tr><td>Distance</td><td>%5</td></tr>"
+ "</table>"
+ "</body></html>");
switch ( MarbleGlobal::getInstance()->locale()->measurementSystem() ) {
case MarbleLocale::MetricSystem:
@@ -373,13 +373,13 @@ void CurrentLocationWidgetPrivate::saveTrack()
{
QString suggested = m_lastSavePath;
QString fileName = QFileDialog::getSaveFileName(m_widget, QObject::tr("Save Track"), // krazy:exclude=qclasses
- suggested.append('/' + QDateTime::currentDateTime().toString("yyyy-MM-dd_hhmmss") + ".kml"),
+ suggested.append(QLatin1Char('/') + QDateTime::currentDateTime().toString("yyyy-MM-dd_hhmmss") + QLatin1String(".kml")),
QObject::tr("KML File (*.kml)"));
if ( fileName.isEmpty() ) {
return;
}
if ( !fileName.endsWith(QLatin1String( ".kml" ), Qt::CaseInsensitive) ) {
- fileName.append( ".kml" );
+ fileName += QLatin1String(".kml");
}
QFileInfo file( fileName );
m_lastSavePath = file.absolutePath();
diff --git a/src/lib/marble/DiscCache.cpp b/src/lib/marble/DiscCache.cpp
index c7bcc0d..0c97f60 100644
--- a/src/lib/marble/DiscCache.cpp
+++ b/src/lib/marble/DiscCache.cpp
@@ -22,7 +22,7 @@ using namespace Marble;
static QString indexFileName( const QString &cacheDirectory )
{
- return cacheDirectory + "/cache_index.idx";
+ return cacheDirectory + QLatin1String("/cache_index.idx");
}
DiscCache::DiscCache( const QString &cacheDirectory )
diff --git a/src/lib/marble/ExternalEditorDialog.cpp b/src/lib/marble/ExternalEditorDialog.cpp
index 6da3ffa..7589cb6 100644
--- a/src/lib/marble/ExternalEditorDialog.cpp
+++ b/src/lib/marble/ExternalEditorDialog.cpp
@@ -90,14 +90,14 @@ void ExternalEditorDialog::updateDefaultEditor( int index )
d->m_defaultEditor = merkaartor;
description = tr( "Merkaartor is an OpenStreetMap editor that is powerful and easy to use. It integrates well into the used workspace." );
if ( !d->m_installedEditors[d->m_defaultEditor] ) {
- description += " <b>" + tr( "Please ask your system administrator to install %1 on your system." ).arg( "Merkaartor") + "</b>";
+ description += QLatin1String(" <b>") + tr("Please ask your system administrator to install %1 on your system.").arg(QStringLiteral("Merkaartor")) + QLatin1String("</b>");
}
break;
case 2:
d->m_defaultEditor = josm;
description = tr( "JOSM is a powerful OpenStreetMap editor which is more complex to use than other editors. It is built on the Java platform and therefor runs on all systems for which Java is available but does not integrate well into the workspace. A Java SE-compatible runtime is required." );
if ( !d->m_installedEditors[d->m_defaultEditor] ) {
- description += " <b>" + tr( "Please ask your system administrator to install %1 on your system." ).arg( "JOSM" ) + "</b>";
+ description += QLatin1String(" <b>") + tr("Please ask your system administrator to install %1 on your system.").arg(QStringLiteral("JOSM")) + QLatin1String("</b>");
}
break;
default:
@@ -106,7 +106,7 @@ void ExternalEditorDialog::updateDefaultEditor( int index )
break;
}
- screenshotLabel->setPixmap( QPixmap( ":/data/editors/" + d->m_defaultEditor + ".png" ) );
+ screenshotLabel->setPixmap(QPixmap(QLatin1String(":/data/editors/") + d->m_defaultEditor + QLatin1String(".png")));
descriptionLabel->setText( description );
}
diff --git a/src/lib/marble/FileLoader.cpp b/src/lib/marble/FileLoader.cpp
index 28379e4..a4e0226 100644
--- a/src/lib/marble/FileLoader.cpp
+++ b/src/lib/marble/FileLoader.cpp
@@ -152,14 +152,14 @@ void FileLoader::run()
// _relative_ path: "maps/mars/viking/patrick.kml"
defaultSourceName = MarbleDirs::path( path + '/' + name + '.' + suffix );
if ( !QFile::exists( defaultSourceName ) ) {
- defaultSourceName = MarbleDirs::path( path + '/' + name + ".cache" );
+ defaultSourceName = MarbleDirs::path(path + QLatin1Char('/') + name + QLatin1String(".cache"));
}
}
else {
// _standard_ shared placemarks: "placemarks/patrick.kml"
- defaultSourceName = MarbleDirs::path( "placemarks/" + path + name + '.' + suffix );
+ defaultSourceName = MarbleDirs::path(QLatin1String("placemarks/") + path + name + QLatin1Char('.') + suffix);
if ( !QFile::exists( defaultSourceName ) ) {
- defaultSourceName = MarbleDirs::path( "placemarks/" + path + name + ".cache" );
+ defaultSourceName = MarbleDirs::path(QLatin1String("placemarks/") + path + name + QLatin1String(".cache"));
}
}
diff --git a/src/lib/marble/FileStoragePolicy.cpp b/src/lib/marble/FileStoragePolicy.cpp
index 6307046..1e14286 100644
--- a/src/lib/marble/FileStoragePolicy.cpp
+++ b/src/lib/marble/FileStoragePolicy.cpp
@@ -30,7 +30,7 @@ FileStoragePolicy::FileStoragePolicy( const QString &dataDirectory, QObject *par
m_dataDirectory( dataDirectory )
{
if ( m_dataDirectory.isEmpty() )
- m_dataDirectory = MarbleDirs::localPath() + "/cache/";
+ m_dataDirectory = MarbleDirs::localPath() + QLatin1String("/cache/");
if ( !QDir( m_dataDirectory ).exists() )
QDir::root().mkpath( m_dataDirectory );
@@ -63,7 +63,7 @@ bool FileStoragePolicy::updateFile( const QString &fileName, const QByteArray &d
// ... and save the file content
QFile file( fullName );
if ( !file.open( QIODevice::WriteOnly ) ) {
- m_errorMsg = QString( "%1: %2" ).arg( fullName ).arg( file.errorString() );
+ m_errorMsg = fullName + QLatin1String(": ") + file.errorString();
qCritical() << "file.open" << m_errorMsg;
return false;
}
@@ -71,7 +71,7 @@ bool FileStoragePolicy::updateFile( const QString &fileName, const QByteArray &d
quint64 oldSize = file.size();
if ( !file.write( data ) ) {
- m_errorMsg = QString( "%1: %2" ).arg( fullName ).arg( file.errorString() );
+ m_errorMsg = fullName + QLatin1String(": ") + file.errorString();
qCritical() << "file.write" << m_errorMsg;
emit sizeChanged( file.size() - oldSize );
return false;
@@ -91,7 +91,7 @@ void FileStoragePolicy::clearCache()
return;
}
- QString cachedMapsDirectory = m_dataDirectory + "/maps";
+ const QString cachedMapsDirectory = m_dataDirectory + QLatin1String("/maps");
QDirIterator it( cachedMapsDirectory, QDir::NoDotAndDotDot | QDir::Dirs );
mDebug() << cachedMapsDirectory;
diff --git a/src/lib/marble/FileStorageWatcher.cpp b/src/lib/marble/FileStorageWatcher.cpp
index 742864e..0bd7222 100644
--- a/src/lib/marble/FileStorageWatcher.cpp
+++ b/src/lib/marble/FileStorageWatcher.cpp
@@ -90,7 +90,7 @@ void FileStorageWatcherThread::getCurrentCacheSize()
{
mDebug() << "FileStorageWatcher: Creating cache size";
quint64 dataSize = 0;
- QString basePath = m_dataDirectory + "/maps";
+ const QString basePath = m_dataDirectory + QLatin1String("/maps");
QDirIterator it( basePath,
QDir::Files | QDir::Writable,
QDirIterator::Subdirectories );
@@ -186,7 +186,7 @@ FileStorageWatcher::FileStorageWatcher( const QString &dataDirectory, QObject *
m_dataDirectory( dataDirectory )
{
if ( m_dataDirectory.isEmpty() )
- m_dataDirectory = MarbleDirs::localPath() + "/cache/";
+ m_dataDirectory = MarbleDirs::localPath() + QLatin1String("/cache/");
if ( ! QDir( m_dataDirectory ).exists() )
QDir::root().mkpath( m_dataDirectory );
diff --git a/src/lib/marble/GeoDataTreeModel.cpp b/src/lib/marble/GeoDataTreeModel.cpp
index 393eddd..a99cfcf 100644
--- a/src/lib/marble/GeoDataTreeModel.cpp
+++ b/src/lib/marble/GeoDataTreeModel.cpp
@@ -267,7 +267,7 @@ QVariant GeoDataTreeModel::data( const QModelIndex &index, int role ) const
if ( placemark->countryCode().isEmpty() ) {
return QVariant( placemark->name() );
} else {
- return QVariant( QString( "%1 (%2)" ).arg( placemark->name() ).arg( placemark->countryCode() ) );
+ return QVariant(placemark->name() + QLatin1String(" (") + placemark->countryCode() + QLatin1Char(')'));
}
}
diff --git a/src/lib/marble/MapThemeDownloadDialog.cpp b/src/lib/marble/MapThemeDownloadDialog.cpp
index 534ef1d..3cca4a2 100644
--- a/src/lib/marble/MapThemeDownloadDialog.cpp
+++ b/src/lib/marble/MapThemeDownloadDialog.cpp
@@ -76,9 +76,9 @@ MapThemeDownloadDialog::MapThemeDownloadDialog( MarbleWidget* marbleWidget ) :
{
d->setupUi( this );
- d->m_model.setTargetDirectory( MarbleDirs::localPath() + "/maps" );
+ d->m_model.setTargetDirectory(MarbleDirs::localPath() + QLatin1String("/maps"));
d->m_model.setProvider( "https://marble.kde.org/maps-v3.xml" );
- d->m_model.setRegistryFile( MarbleDirs::localPath() + "/newstuff/marble-map-themes.knsregistry", Marble::NewstuffModel::NameTag );
+ d->m_model.setRegistryFile(MarbleDirs::localPath() + QLatin1String("/newstuff/marble-map-themes.knsregistry"), Marble::NewstuffModel::NameTag);
d->listView->setIconSize( QSize( 130, 130 ) );
d->listView->setAlternatingRowColors( true );
diff --git a/src/lib/marble/MapThemeManager.cpp b/src/lib/marble/MapThemeManager.cpp
index e0bc6ee..8c52275 100644
--- a/src/lib/marble/MapThemeManager.cpp
+++ b/src/lib/marble/MapThemeManager.cpp
@@ -175,7 +175,7 @@ GeoSceneDocument* MapThemeManager::loadMapTheme( const QString& mapThemeStringID
void MapThemeManager::deleteMapTheme( const QString &mapThemeId )
{
- QString dgmlPath = MarbleDirs::localPath() + "/maps/" + mapThemeId;
+ const QString dgmlPath = MarbleDirs::localPath() + QLatin1String("/maps/") + mapThemeId;
QFileInfo dgmlFile(dgmlPath);
QString themeDir = dgmlFile.dir().absolutePath();
@@ -385,15 +385,15 @@ QList<QStandardItem *> MapThemeManager::Private::createMapThemeRow( QString cons
QIcon mapThemeIcon = QIcon( themeIconPixmap );
QString name = mapTheme->head()->name();
- const QByteArray description = mapTheme->head()->description().toUtf8();
+ const QString translatedDescription = QCoreApplication::translate("DGML", mapTheme->head()->description().toUtf8().constData());
+ const QString toolTip = QLatin1String("<span style=\" max-width: 150 px;\"> ") + translatedDescription + QLatin1String(" </span>");
QStandardItem *item = new QStandardItem( name );
item->setData(QCoreApplication::translate("DGML", name.toUtf8().constData()), Qt::DisplayRole);
item->setData( mapThemeIcon, Qt::DecorationRole );
- item->setData( QString( "<span style=\" max-width: 150 px;\"> "
- + QCoreApplication::translate("DGML", description.constData()) + " </span>"), Qt::ToolTipRole );
+ item->setData(toolTip, Qt::ToolTipRole);
item->setData( mapThemeID, Qt::UserRole + 1 );
- item->setData(QCoreApplication::translate("DGML", description.constData()), Qt::UserRole + 2);
+ item->setData(translatedDescription, Qt::UserRole + 2);
itemList << item;
diff --git a/src/lib/marble/MapThemeSortFilterProxyModel.cpp b/src/lib/marble/MapThemeSortFilterProxyModel.cpp
index e716d86..8babb74 100644
--- a/src/lib/marble/MapThemeSortFilterProxyModel.cpp
+++ b/src/lib/marble/MapThemeSortFilterProxyModel.cpp
@@ -51,7 +51,7 @@ bool MapThemeSortFilterProxyModel::isFavorite( const QModelIndex& index )
{
const QAbstractItemModel *model = index.model();
QModelIndex columnIndex = model->index( index.row(), 0, QModelIndex() );
- QString const key = "Favorites/" + model->data( columnIndex ).toString();
+ QString const key = QLatin1String("Favorites/") + model->data(columnIndex).toString();
return QSettings().contains( key );
}
@@ -59,7 +59,7 @@ QDateTime MapThemeSortFilterProxyModel::favoriteDateTime( const QModelIndex& ind
{
const QAbstractItemModel *model = index.model();
QModelIndex columnIndex = model->index( index.row(), 0, QModelIndex() );
- QString const key = "Favorites/" + model->data( columnIndex ).toString();
+ QString const key = QLatin1String("Favorites/") + model->data(columnIndex).toString();
return QSettings().value( key ).toDateTime();
}
diff --git a/src/lib/marble/MapViewItemDelegate.cpp b/src/lib/marble/MapViewItemDelegate.cpp
index 941f6ef..2dc1d9b 100644
--- a/src/lib/marble/MapViewItemDelegate.cpp
+++ b/src/lib/marble/MapViewItemDelegate.cpp
@@ -61,7 +61,7 @@ void MapViewItemDelegate::paint( QPainter *painter, const QStyleOptionViewItem &
int const padding = 5;
QString const name = index.data().toString();
- const bool isFavorite = QSettings().contains( "Favorites/" + name );
+ const bool isFavorite = QSettings().contains(QLatin1String("Favorites/") + name);
QSize const bookmarkSize( 16, 16 );
QRect bookmarkRect( iconRect.bottomRight(), bookmarkSize );
bookmarkRect.translate( QPoint( -bookmarkSize.width() - padding, -bookmarkSize.height() - padding ) );
diff --git a/src/lib/marble/MapViewWidget.cpp b/src/lib/marble/MapViewWidget.cpp
index 5c7fd5b..d8a81e6 100644
--- a/src/lib/marble/MapViewWidget.cpp
+++ b/src/lib/marble/MapViewWidget.cpp
@@ -632,7 +632,7 @@ QString MapViewWidget::Private::currentThemePath() const
QString MapViewWidget::Private::favoriteKey(const QModelIndex &index) const
{
- return "Favorites/" + m_mapSortProxy.data(index).toString();
+ return QLatin1String("Favorites/") + m_mapSortProxy.data(index).toString();
}
void MapViewWidget::Private::showContextMenu( const QPoint& pos )
@@ -648,8 +648,9 @@ void MapViewWidget::Private::showContextMenu( const QPoint& pos )
menu.addSeparator();
menu.addAction(QIcon(QStringLiteral(":/icons/create-new-map.png")), tr("&Create a New Map..."), q, SIGNAL(showMapWizard()));
- if( QFileInfo( MarbleDirs::localPath() + "/maps/" + currentThemePath() ).exists() )
+ if (QFileInfo(MarbleDirs::localPath() + QLatin1String("/maps/") + currentThemePath()).exists()) {
menu.addAction( tr( "&Delete Map Theme" ), q, SLOT(deleteMap()) );
+ }
menu.addAction( tr( "&Upload Map..." ), q, SIGNAL(showUploadDialog()) );
menu.exec( m_mapViewUi.marbleThemeSelectView->mapToGlobal( pos ) );
}
diff --git a/src/lib/marble/MapWizard.cpp b/src/lib/marble/MapWizard.cpp
index ab683a3..9c8b6df 100644
--- a/src/lib/marble/MapWizard.cpp
+++ b/src/lib/marble/MapWizard.cpp
@@ -137,7 +137,7 @@ PreviewDialog::PreviewDialog( QWidget* parent, const QString& mapThemeId ) : QDi
void PreviewDialog::closeEvent(QCloseEvent* e)
{
- QString dgmlPath = MarbleDirs::localPath() + "/maps/" + m_mapThemeId;
+ const QString dgmlPath = MarbleDirs::localPath() + QLatin1String("/maps/") + m_mapThemeId;
QString directory = dgmlPath.left( dgmlPath.lastIndexOf("/") );
this->deleteTheme( directory );
QDialog::closeEvent( e );
@@ -292,12 +292,12 @@ void MapWizard::parseServerCapabilities( QNetworkReply* reply )
void MapWizard::createWmsLegend( QNetworkReply* reply )
{
QByteArray result( reply->readAll() );
- QDir map( QString( "%1/maps/earth/%2" ).arg( MarbleDirs::localPath() ).arg( d->mapTheme ) );
+ QDir map(MarbleDirs::localPath() + QLatin1String("/maps/earth/") + d->mapTheme);
if( !map.exists( "legend" ) ) {
map.mkdir( "legend" );
}
- QFile image( QString( "%1/legend/legend.png" ).arg( map.absolutePath() ) );
+ QFile image(map.absolutePath() + QLatin1String("/legend/legend.png"));
image.open( QIODevice::ReadWrite );
image.write( result );
image.close();
@@ -340,7 +340,7 @@ void MapWizard::autoFillDetails()
bool MapWizard::createFiles( const GeoSceneDocument* document )
{
// Create directories
- QDir maps( MarbleDirs::localPath() + "/maps/earth/" );
+ QDir maps(MarbleDirs::localPath() + QLatin1String("/maps/earth/"));
if( !maps.exists( document->head()->theme() ) )
{
maps.mkdir( document->head()->theme() );
@@ -429,9 +429,9 @@ QString MapWizard::createLegendHtml( const QString& image )
void MapWizard::createLegendFile( const QString& legendHtml )
{
- QDir map( QString( "%1/maps/earth/%2" ).arg( MarbleDirs::localPath() ).arg( d->mapTheme ) );
-
- QFile html( QString( "%1/legend.html" ).arg( map.absolutePath() ) );
+ QDir map(MarbleDirs::localPath() + QLatin1String("/maps/earth/") + d->mapTheme);
+
+ QFile html(map.absolutePath() + QLatin1String("/legend.html"));
html.open( QIODevice::ReadWrite );
html.write( legendHtml.toLatin1().data() );
html.close();
@@ -520,14 +520,14 @@ void MapWizard::createLevelZero( QNetworkReply* reply )
void MapWizard::createLegend()
{
- QDir map( QString( "%1/maps/earth/%2" ).arg( MarbleDirs::localPath() ).arg( d->mapTheme ) );
+ QDir map(MarbleDirs::localPath() + QLatin1String("/maps/earth/") + d->mapTheme);
if( !map.exists( "legend" ) ) {
map.mkdir( "legend" );
}
QFile image;
image.setFileName( d->uiWidget.lineEditLegend_2->text() );
- image.copy( QString( "%1/legend/legend.png" ).arg( map.absolutePath() ) );
+ image.copy(map.absolutePath() + QLatin1String("/legend/legend.png"));
const QString legendHtml = createLegendHtml();
createLegendFile( legendHtml );
@@ -610,7 +610,7 @@ QString MapWizard::createArchive( QWidget *parent, const QString& mapId )
}
QStringList sourceImgFilters;
- sourceImgFilters << QString( "%1.jpg" ).arg( theme ) << QString( "%1.png" ).arg( theme ) << QString( "%1.jpeg" ).arg( theme );
+ sourceImgFilters << theme + QLatin1String(".jpg") << theme + QLatin1String(".png") << theme + QLatin1String(".jpeg");
QStringList sourceImg = themeDir.entryList( sourceImgFilters );
if( !sourceImg.isEmpty() ) {
tarArgs.append( QString( "%1/%2/%3" ).arg( body ).arg( theme ).arg( sourceImg[0] ) );
@@ -775,7 +775,7 @@ GeoSceneDocument* MapWizard::createDocument()
GeoSceneTileDataset *texture = new GeoSceneTileDataset( "map" );
texture->setExpire( 31536000 );
- texture->setSourceDir( "earth/" + document->head()->theme() );
+ texture->setSourceDir(QLatin1String("earth/") + document->head()->theme());
if( d->mapProviderType == MapWizardPrivate::WmsMap )
{
texture->setFileFormat( d->format );
diff --git a/src/lib/marble/MarbleAboutDialog.cpp b/src/lib/marble/MarbleAboutDialog.cpp
index 58a5071..bd10ca9 100644
--- a/src/lib/marble/MarbleAboutDialog.cpp
+++ b/src/lib/marble/MarbleAboutDialog.cpp
@@ -379,14 +379,14 @@ void MarbleAboutDialogPrivate::loadPageContents( int idx )
void MarbleAboutDialog::setApplicationTitle( const QString &title )
{
- QString const titleHtml = "<b>" + title + "</b>";
+ QString const titleHtml = QLatin1String("<b>") + title + QLatin1String("</b>");
d->uiWidget.m_pMarbleTitleLabel->setText( titleHtml );
QString const applicationVersion = tr( "Using Marble Library version %1" ).arg( MARBLE_VERSION_STRING );
d->uiWidget.m_pMarbleVersionLabel->setText( applicationVersion );
QTextBrowser* browser = d->uiWidget.m_pMarbleAboutBrowser;
QString text;
if( MarbleGlobal::getInstance()->profiles() & MarbleGlobal::SmallScreen ) {
- text = titleHtml + "<br />" + applicationVersion + "<br />";
+ text = titleHtml + QLatin1String("<br />") + applicationVersion + QLatin1String("<br />");
}
browser->setHtml( text + tr("<br />(c) 2007-%1 by the authors of Marble Virtual Globe<br /><br /><a href=\"http://edu.kde.org/marble\">http://edu.kde.org/marble</a>").arg( 2015 ) );
QTextFrameFormat format = browser->document()->rootFrame()->frameFormat();
diff --git a/src/lib/marble/MarbleDirs.cpp b/src/lib/marble/MarbleDirs.cpp
index 0f5f0a3..83980e9 100644
--- a/src/lib/marble/MarbleDirs.cpp
+++ b/src/lib/marble/MarbleDirs.cpp
@@ -127,7 +127,7 @@ QString MarbleDirs::systemPath()
QString systempath;
#ifdef Q_OS_WIN
- return QCoreApplication::applicationDirPath() + QDir::separator() + "data";
+ return QCoreApplication::applicationDirPath() + QDir::separator() + QLatin1String("data");
#endif
#ifdef Q_OS_MACX
@@ -145,7 +145,7 @@ QString MarbleDirs::systemPath()
//marble was not built as a bundle
if (myPath.contains(".app")) //its a bundle!
{
- systempath = myPath + "/Contents/Resources/data";
+ systempath = myPath + QLatin1String("/Contents/Resources/data");
}
if ( QFile::exists( systempath ) ){
@@ -199,7 +199,7 @@ QString MarbleDirs::pluginSystemPath()
//marble was not built as a bundle
if (myPath.contains(".app")) //its a bundle!
{
- systempath = myPath + "/Contents/Resources/plugins";
+ systempath = myPath + QLatin1String("/Contents/Resources/plugins");
}
if ( QFile::exists( systempath ) ){
@@ -208,7 +208,7 @@ QString MarbleDirs::pluginSystemPath()
#endif // mac bundle
#ifdef Q_OS_WIN
- return QCoreApplication::applicationDirPath() + QDir::separator() + "plugins";
+ return QCoreApplication::applicationDirPath() + QDir::separator() + QLatin1String("plugins");
#endif
#ifdef Q_OS_ANDROID
@@ -238,11 +238,11 @@ QString MarbleDirs::localPath()
#ifndef Q_OS_WIN
QString dataHome = getenv( "XDG_DATA_HOME" );
if( dataHome.isEmpty() )
- dataHome = QDir::homePath() + "/.local/share";
+ dataHome = QDir::homePath() + QLatin1String("/.local/share");
- return dataHome + "/marble"; // local path
+ return dataHome + QLatin1String("/marble"); // local path
#else
- return QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/.marble/data";
+ return QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1String("/.marble/data");
#endif
}
@@ -251,14 +251,14 @@ QStringList MarbleDirs::oldLocalPaths()
QStringList possibleOldPaths;
#ifndef Q_OS_WIN
- QString oldDefault = QDir::homePath() + "/.marble/data";
+ const QString oldDefault = QDir::homePath() + QLatin1String("/.marble/data");
possibleOldPaths.append( oldDefault );
- QString xdgDefault = QDir::homePath() + "/.local/share/marble";
+ const QString xdgDefault = QDir::homePath() + QLatin1String("/.local/share/marble");
possibleOldPaths.append( xdgDefault );
QString xdg = getenv( "XDG_DATA_HOME" );
- xdg += "/marble/";
+ xdg += QLatin1String("/marble/");
possibleOldPaths.append( xdg );
#endif
@@ -269,7 +269,7 @@ QStringList MarbleDirs::oldLocalPaths()
SHGetSpecialFolderPathW(hwnd, appdata_path, CSIDL_APPDATA, 0);
QString appdata = QString::fromUtf16(reinterpret_cast<ushort*>(appdata_path));
delete[] appdata_path;
- possibleOldPaths << QString(QDir::fromNativeSeparators(appdata) + "/.marble/data"); // local path
+ possibleOldPaths << QString(QDir::fromNativeSeparators(appdata) + QLatin1String("/.marble/data")); // local path
#endif
QString currentLocalPath = QDir( MarbleDirs::localPath() ).canonicalPath();
@@ -293,9 +293,9 @@ QStringList MarbleDirs::oldLocalPaths()
QString MarbleDirs::pluginLocalPath()
{
#ifndef Q_OS_WIN
- return QString( QDir::homePath() + "/.marble/plugins" ); // local path
+ return QDir::homePath() + QLatin1String("/.marble/plugins"); // local path
#else
- return QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/.marble/plugins";
+ return QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1String("/.marble/plugins");
#endif
}
diff --git a/src/lib/marble/MarbleLegendBrowser.cpp b/src/lib/marble/MarbleLegendBrowser.cpp
index c3038dd..dc89632 100644
--- a/src/lib/marble/MarbleLegendBrowser.cpp
+++ b/src/lib/marble/MarbleLegendBrowser.cpp
@@ -145,9 +145,9 @@ void MarbleLegendBrowser::loadLegend()
if (d->m_marbleModel->mapTheme() != 0 ) {
const GeoSceneDocument *currentMapTheme = d->m_marbleModel->mapTheme();
- legendPath = MarbleDirs::path( "maps/" +
- currentMapTheme->head()->target() + '/' +
- currentMapTheme->head()->theme() + "/legend.html" );
+ legendPath = MarbleDirs::path(QLatin1String("maps/") +
+ currentMapTheme->head()->target() + QLatin1Char('/') +
+ currentMapTheme->head()->theme() + QLatin1String("/legend.html"));
}
if ( legendPath.isEmpty() ) {
legendPath = MarbleDirs::path( "legend.html" );
@@ -189,7 +189,7 @@ void MarbleLegendBrowser::injectCheckBoxChecker()
void MarbleLegendBrowser::openLinkExternally( const QUrl &url )
{
if (url.scheme() == QLatin1String("tour")) {
- emit tourLinkClicked( "maps/"+url.host() + url.path() );
+ emit tourLinkClicked(QLatin1String("maps/") + url.host() + url.path());
} else {
QDesktopServices::openUrl( url );
}
@@ -262,9 +262,9 @@ void MarbleLegendBrowser::reverseSupportCheckboxes(QString &html)
if (d->m_checkBoxMap["cities"])
checked = "checked";
- const QString repair = ""
+ const QString repair = QLatin1String(
"<input type=\"checkbox\" "
- "onchange=\"Marble.setCheckedProperty(this.name, this.checked);\" " + checked + " name=\"cities\"/>";
+ "onchange=\"Marble.setCheckedProperty(this.name, this.checked);\" ") + checked + QLatin1String(" name=\"cities\"/>");
html.replace(old, repair);
}
@@ -290,7 +290,7 @@ QString MarbleLegendBrowser::generateSectionsHtml()
foreach ( const GeoSceneSection *section, currentMapTheme->legend()->sections() ) {
// Each section is divided into the "well"
// Well is like a block of data with rounded corners
- customLegendString += "<div class=\"well well-small well-legend\">";
+ customLegendString += QLatin1String("<div class=\"well well-small well-legend\">");
QString checkBoxString;
@@ -303,27 +303,27 @@ QString MarbleLegendBrowser::generateSectionsHtml()
* Marble.setCheckedProperty is a function that does it
*/
if(!section->radio().isEmpty()) {
- checkBoxString = ""
+ checkBoxString = QLatin1String(
"<label class=\"section-head\">"
"<input type=\"radio\" "
- "onchange=\"Marble.setRadioCheckedProperty(this.value, this.name ,this.checked);\" " +
- checked + " value=\"" + section->connectTo() + "\" name=\"" + section->radio() + "\" /><span>"
+ "onchange=\"Marble.setRadioCheckedProperty(this.value, this.name ,this.checked);\" ") +
+ checked + QLatin1String(" value=\"") + section->connectTo() + QLatin1String("\" name=\"") + section->radio() + QLatin1String("\" /><span>")
+ section->heading() +
- "</span></label>";
+ QLatin1String("</span></label>");
} else {
- checkBoxString = ""
+ checkBoxString = QLatin1String(
"<label class=\"section-head\">"
"<input type=\"checkbox\" "
- "onchange=\"Marble.setCheckedProperty(this.name, this.checked);\" "+checked+" name=\"" + section->connectTo() + "\" /><span>"
+ "onchange=\"Marble.setCheckedProperty(this.name, this.checked);\" ") + checked + QLatin1String(" name=\"") + section->connectTo() + QLatin1String("\" /><span>")
+ section->heading() +
- "</span></label>";
+ QLatin1String("</span></label>");
}
customLegendString += checkBoxString;
} else {
- customLegendString += "<h4 class=\"section-head\">"+section->heading()+"</h4>";
+ customLegendString += QLatin1String("<h4 class=\"section-head\">") + section->heading() + QLatin1String("</h4>");
}
foreach (const GeoSceneItem *item, section->items()) {
@@ -332,10 +332,10 @@ QString MarbleLegendBrowser::generateSectionsHtml()
QString checkBoxString;
if (item->checkable()) {
QString const checked = d->m_checkBoxMap[item->connectTo()] ? "checked" : "";
- checkBoxString = ""
+ checkBoxString = QLatin1String(
"<input type=\"checkbox\" "
- "onchange=\"Marble.setCheckedProperty(this.name, this.checked);\" "
- + checked + " name=\"" + item->connectTo() + "\" />";
+ "onchange=\"Marble.setCheckedProperty(this.name, this.checked);\" ")
+ + checked + QLatin1String(" name=\"") + item->connectTo() + QLatin1String("\" />");
}
@@ -350,8 +350,8 @@ QString MarbleLegendBrowser::generateSectionsHtml()
pixmapWidth = oncePixmap.width();
pixmapHeight = oncePixmap.height();
src = QUrl::fromLocalFile( path ).toString();
- styleDiv = "width: " + QString::number(pixmapWidth) + "px; height: " +
- QString::number(pixmapHeight) + "px;";
+ styleDiv = QLatin1String("width: ") + QString::number(pixmapWidth) + QLatin1String("px; height: ") +
+ QString::number(pixmapHeight) + QLatin1String("px;");
}
@@ -359,19 +359,19 @@ QString MarbleLegendBrowser::generateSectionsHtml()
// create just a plain rectangle with set color
QColor color = item->icon()->color();
if ( color.isValid() ) {
- styleDiv = "width: " + QString::number(pixmapWidth) + "px; height: " +
- QString::number(pixmapHeight) + "px; background-color: " + color.name() + ';';
+ styleDiv = QLatin1String("width: ") + QString::number(pixmapWidth) + QLatin1String("px; height: ") +
+ QString::number(pixmapHeight) + QLatin1String("px; background-color: ") + color.name() + QLatin1Char(';');
}
- QString html = ""
+ QString html = QLatin1String(
"<div class=\"legend-entry\">"
- " <label>" + checkBoxString +
- " <img class=\"image-pic\" src=\"" + src + "\" style=\"" + styleDiv + "\"/>"
- " <span class=\"notation\">" + item->text() + "</span>"
+ " <label>") + checkBoxString + QLatin1String(
+ " <img class=\"image-pic\" src=\"") + src + QLatin1String("\" style=\"") + styleDiv + QLatin1String("\"/>"
+ " <span class=\"notation\">") + item->text() + QLatin1String("</span>"
" </label>"
- "</div>";
+ "</div>");
customLegendString += html;
}
- customLegendString += "</div>"; // <div class="well">
+ customLegendString += QLatin1String("</div>"); // <div class="well">
}
return customLegendString;
@@ -380,7 +380,7 @@ QString MarbleLegendBrowser::generateSectionsHtml()
void MarbleLegendBrowser::setCheckedProperty( const QString& name, bool checked )
{
#ifndef MARBLE_NO_WEBKITWIDGETS
- QWebElement box = page()->mainFrame()->findFirstElement("input[name="+name+']');
+ QWebElement box = page()->mainFrame()->findFirstElement(QLatin1String("input[name=") + name + QLatin1Char(']'));
if (!box.isNull()) {
if (checked != d->m_checkBoxMap[name]) {
d->m_checkBoxMap[name] = checked;
@@ -395,8 +395,8 @@ void MarbleLegendBrowser::setCheckedProperty( const QString& name, bool checked
void MarbleLegendBrowser::setRadioCheckedProperty( const QString& value, const QString& name , bool checked )
{
#ifndef MARBLE_NO_WEBKITWIDGETS
- QWebElement box = page()->mainFrame()->findFirstElement("input[value="+value+']');
- QWebElementCollection boxes = page()->mainFrame()->findAllElements("input[name="+name+']');
+ QWebElement box = page()->mainFrame()->findFirstElement(QLatin1String("input[value=") + value + QLatin1Char(']'));
+ QWebElementCollection boxes = page()->mainFrame()->findAllElements(QLatin1String("input[name=") + name + QLatin1Char(']'));
QString currentValue;
for(int i=0; i<boxes.count(); ++i) {
currentValue = boxes.at(i).attribute("value");
diff --git a/src/lib/marble/MarbleWidget.cpp b/src/lib/marble/MarbleWidget.cpp
index ff1134a..ebcfcd7 100644
--- a/src/lib/marble/MarbleWidget.cpp
+++ b/src/lib/marble/MarbleWidget.cpp
@@ -1074,7 +1074,7 @@ QList<RenderPlugin *> MarbleWidget::renderPlugins() const
void MarbleWidget::readPluginSettings( QSettings& settings )
{
foreach( RenderPlugin *plugin, renderPlugins() ) {
- settings.beginGroup( QString( "plugin_" ) + plugin->nameId() );
+ settings.beginGroup(QLatin1String("plugin_") + plugin->nameId());
QHash<QString,QVariant> hash;
@@ -1091,7 +1091,7 @@ void MarbleWidget::readPluginSettings( QSettings& settings )
void MarbleWidget::writePluginSettings( QSettings& settings ) const
{
foreach( RenderPlugin *plugin, renderPlugins() ) {
- settings.beginGroup( QString( "plugin_" ) + plugin->nameId() );
+ settings.beginGroup(QLatin1String("plugin_") + plugin->nameId());
QHash<QString,QVariant> hash = plugin->settings();
diff --git a/src/lib/marble/MarbleWidgetPopupMenu.cpp b/src/lib/marble/MarbleWidgetPopupMenu.cpp
index c192ea2..36175fc 100644
--- a/src/lib/marble/MarbleWidgetPopupMenu.cpp
+++ b/src/lib/marble/MarbleWidgetPopupMenu.cpp
@@ -205,7 +205,7 @@ void MarbleWidgetPopupMenu::Private::setupDialogOsm( PopupLayer *popup, const Ge
QString natural = data.tagValue("natural");
natural[0] = natural[0].toUpper();
if (natural == QLatin1String("Peak") && data.containsTagKey("ele") && !data.tagValue("ele").isEmpty()) {
- doc["details"] = natural + " - " + data.tagValue("ele") + " m";
+ doc["details"] = natural + QLatin1String(" - ") + data.tagValue("ele") + QLatin1String(" m");
} else {
doc["details"] = natural;
}
@@ -219,13 +219,13 @@ void MarbleWidgetPopupMenu::Private::setupDialogOsm( PopupLayer *popup, const Ge
if (shop == QLatin1String("Clothes") && data.containsTagKey("clothes") && !data.tagValue("clothes").isEmpty()) {
QString clothes = data.tagValue("clothes");
clothes[0] = clothes[0].toUpper();
- doc["amenity"] = "Shop - " + shop + " (" + clothes + ")";
+ doc["amenity"] = QLatin1String("Shop - ") + shop + QLatin1String(" (") + clothes + QLatin1Char(')');
} else if (shop == QLatin1String("Clothes") && data.containsTagKey("designation") && !data.tagValue("designation").isEmpty()) {
QString designation = data.tagValue("designation");
designation[0] = designation[0].toUpper();
- doc["amenity"] = "Shop - " + shop + " (" + designation + ")";
+ doc["amenity"] = QLatin1String("Shop - ") + shop + QLatin1String(" (") + designation + QLatin1Char(')');
} else {
- doc["amenity"] = "Shop - " + shop;
+ doc["amenity"] = QLatin1String("Shop - ") + shop;
}
} else if (data.containsTagKey("amenity") && !data.tagValue("amenity").isEmpty()){
QString amenity = data.tagValue("amenity");
@@ -508,7 +508,7 @@ void MarbleWidgetPopupMenu::Private::setupDialogPhotoOverlay( PopupLayer *popup,
doc["width"] = QString::number(200);
doc["height"] = QString::number(100);
QString const basePath = index->resolvePath(".");
- QUrl const baseUrl = (basePath != QLatin1String(".")) ? QUrl::fromLocalFile( basePath + "/" ) : QUrl();
+ QUrl const baseUrl = (basePath != QLatin1String(".")) ? QUrl::fromLocalFile(basePath + QLatin1Char('/')) : QUrl();
popup->setContent(doc.finalText(), baseUrl );
}
@@ -717,7 +717,7 @@ void MarbleWidgetPopupMenu::slotInfoDialog()
content = content.replace("$[snippet]", placemark->snippet().text(), Qt::CaseInsensitive);
content = content.replace("$[id]", placemark->id(), Qt::CaseInsensitive);
QString const basePath = placemark->resolvePath(".");
- QUrl const baseUrl = (basePath != QLatin1String(".")) ? QUrl::fromLocalFile( basePath + "/" ) : QUrl();
+ QUrl const baseUrl = (basePath != QLatin1String(".")) ? QUrl::fromLocalFile(basePath + QLatin1Char('/')) : QUrl();
popup->setContent(content, baseUrl );
}
diff --git a/src/lib/marble/MergedLayerDecorator.cpp b/src/lib/marble/MergedLayerDecorator.cpp
index a1735a5..d2cd059 100644
--- a/src/lib/marble/MergedLayerDecorator.cpp
+++ b/src/lib/marble/MergedLayerDecorator.cpp
@@ -103,7 +103,7 @@ void MergedLayerDecorator::setTextureLayers( const QVector<const GeoSceneTexture
d->m_levelZeroColumns = firstTexture->levelZeroColumns();
d->m_levelZeroRows = firstTexture->levelZeroRows();
d->m_blendingFactory.setLevelZeroLayout( d->m_levelZeroColumns, d->m_levelZeroRows );
- d->m_themeId = "maps/" + firstTexture->sourceDir();
+ d->m_themeId = QLatin1String("maps/") + firstTexture->sourceDir();
}
d->m_textureLayers = textureLayers;
diff --git a/src/lib/marble/MovieCapture.cpp b/src/lib/marble/MovieCapture.cpp
index de852ed..962414b 100644
--- a/src/lib/marble/MovieCapture.cpp
+++ b/src/lib/marble/MovieCapture.cpp
@@ -118,7 +118,7 @@ QVector<MovieFormat> MovieCapture::availableFormats()
foreach ( const MovieFormat &format, m_supportedFormats ) {
QString type = format.type();
QStringList args;
- args << "-h" << "muxer=" + type;
+ args << "-h" << QLatin1String("muxer=") + type;
encoder.start( d->encoderExec, args );
encoder.waitForFinished();
QString output = encoder.readAll();
diff --git a/src/lib/marble/MovieCaptureDialog.cpp b/src/lib/marble/MovieCaptureDialog.cpp
index dd99047..8a5ab7e 100644
--- a/src/lib/marble/MovieCaptureDialog.cpp
+++ b/src/lib/marble/MovieCaptureDialog.cpp
@@ -58,10 +58,10 @@ void MovieCaptureDialog::loadDestinationFile()
QMessageBox::warning( this, tr( "Codecs are unavailable" ), tr( "Supported codecs are not found." ) );
return;
}
- QString filter = formats.first().name() + " (*." + formats.first().extension() + ')';
+ QString filter = formats.first().name() + QLatin1String(" (*.") + formats.first().extension() + QLatin1Char(')');
for( int i = 1; i < formats.size(); i++ )
{
- filter.append( ";;"+formats.at( i ).name() + " (*." + formats.at( i ).extension() + ')' );
+ filter += QLatin1String(";;") + formats.at(i).name() + QLatin1String(" (*.") + formats.at(i).extension() + QLatin1Char(')');
}
const QString defaultFileName =
ui->destinationEdit->text().isEmpty() ? "" : ui->destinationEdit->text();
@@ -84,7 +84,7 @@ void MovieCaptureDialog::loadDestinationFile()
QString formatsExtensions = '.' + formats.at( 0 ).extension();
for( int i = 1; i < formats.size(); ++i )
{
- formatsExtensions.append( ", ."+formats.at( i ).extension() );
+ formatsExtensions += QLatin1String(", .") + formats.at(i).extension();
}
QMessageBox::warning(this, tr("Filename is not valid"),
tr("This file format is not supported. "
diff --git a/src/lib/marble/NewstuffModel.cpp b/src/lib/marble/NewstuffModel.cpp
index f8abbaf..0fd4fee 100644
--- a/src/lib/marble/NewstuffModel.cpp
+++ b/src/lib/marble/NewstuffModel.cpp
@@ -477,7 +477,7 @@ void NewstuffModelPrivate::readValue( const QDomNode &node, const QString &key,
NewstuffModel::NewstuffModel( QObject *parent ) :
QAbstractListModel( parent ), d( new NewstuffModelPrivate( this ) )
{
- setTargetDirectory( MarbleDirs::localPath() + "/maps" );
+ setTargetDirectory(MarbleDirs::localPath() + QLatin1String("/maps"));
// no default registry file
connect( &d->m_networkAccessManager, SIGNAL(finished(QNetworkReply*)),
@@ -903,7 +903,7 @@ void NewstuffModelPrivate::processQueue()
if ( m_currentAction.second == Install ) {
if ( !m_currentFile ) {
QFileInfo const file = m_items.at( m_currentAction.first ).m_payloadUrl.path();
- m_currentFile = new QTemporaryFile( QDir::tempPath() + "/marble-XXXXXX-" + file.fileName() );
+ m_currentFile = new QTemporaryFile(QDir::tempPath() + QLatin1String("/marble-XXXXXX-") + file.fileName());
}
if ( m_currentFile->open() ) {
diff --git a/src/lib/marble/PluginAboutDialog.cpp b/src/lib/marble/PluginAboutDialog.cpp
index fba5bd8..60b60b8 100644
--- a/src/lib/marble/PluginAboutDialog.cpp
+++ b/src/lib/marble/PluginAboutDialog.cpp
@@ -79,12 +79,9 @@ void PluginAboutDialog::setAuthors(const QVector<PluginAuthor>& authors)
{
QString string;
foreach ( const PluginAuthor& author, authors ) {
- string += author.name;
- string += "\n ";
- string += author.email;
- string += "\n ";
- string += author.task;
- string += "\n\n";
+ string += author.name + QLatin1String("\n ") +
+ author.email + QLatin1String("\n ") +
+ author.task + QLatin1String("\n\n");
}
setAuthorsText( string );
@@ -117,7 +114,7 @@ void PluginAboutDialog::setLicense( PluginAboutDialog::LicenseKey license )
filename = "lgpl2.txt";
}
- QString path = MarbleDirs::path( "licenses/" + filename );
+ const QString path = MarbleDirs::path(QLatin1String("licenses/") + filename );
QTextBrowser *browser = d->u_dialog.m_pMarbleLicenseBrowser;
browser->setText( QString() );
if( !path.isEmpty() )
diff --git a/src/lib/marble/PopupItem.cpp b/src/lib/marble/PopupItem.cpp
index b8eee53..c802d86 100644
--- a/src/lib/marble/PopupItem.cpp
+++ b/src/lib/marble/PopupItem.cpp
@@ -390,8 +390,8 @@ QPixmap PopupItem::pixmap( const QString &imageId ) const
{
QPixmap result;
if ( !QPixmapCache::find( imageId, result ) ) {
- QImage bottom = QImage( QString( ":/%1_shadow.png" ).arg( imageId) );
- QImage top = QImage( QString( ":/%1.png" ).arg( imageId) );
+ QImage bottom = QImage(QLatin1String(":/") + imageId + QLatin1String("_shadow.png"));
+ QImage top = QImage(QLatin1String(":/") + imageId + QLatin1String(".png"));
colorize( top, m_backColor );
QPainter painter( &bottom );
painter.drawImage( QPoint(0,0), top );
diff --git a/src/lib/marble/PositionTracking.cpp b/src/lib/marble/PositionTracking.cpp
index 289ddd7..94c76bd 100644
--- a/src/lib/marble/PositionTracking.cpp
+++ b/src/lib/marble/PositionTracking.cpp
@@ -270,7 +270,7 @@ bool PositionTracking::saveTrack( const QString& fileName )
document->addStyleMap( map );
}
GeoDataPlacemark *track = new GeoDataPlacemark( *d->m_currentTrackPlacemark );
- track->setName( "Track " + name );
+ track->setName(QLatin1String("Track ") + name);
document->append( track );
bool const result = GeoDataDocumentWriter::write(fileName, *document);
diff --git a/src/lib/marble/RemoteIconLoader.cpp b/src/lib/marble/RemoteIconLoader.cpp
index 7b18135..824c15e 100644
--- a/src/lib/marble/RemoteIconLoader.cpp
+++ b/src/lib/marble/RemoteIconLoader.cpp
@@ -34,7 +34,7 @@ class RemoteIconLoaderPrivate
{
public:
RemoteIconLoaderPrivate()
- : m_storagePolicy( MarbleDirs::localPath().append("/cache/icons/") ),
+ : m_storagePolicy(MarbleDirs::localPath() + QLatin1String("/cache/icons/")),
m_downloadManager( &m_storagePolicy )
{
}
@@ -81,7 +81,7 @@ QImage RemoteIconLoaderPrivate::cachedIcon( const QUrl& url ) const
bool RemoteIconLoaderPrivate::loadFromDiskCache( const QUrl& url )
{
- QString path = MarbleDirs::localPath().append("/cache/icons/") + cacheFileName( url );
+ QString path = MarbleDirs::localPath() + QLatin1String("/cache/icons/") + cacheFileName(url);
QImage icon = QFile::exists( path ) ? QImage( path ) : QImage();
if ( !icon.isNull() ) {
m_iconCache.insert( url, icon );
diff --git a/src/lib/marble/ServerLayout.cpp b/src/lib/marble/ServerLayout.cpp
index 4971b6d..87522bc 100644
--- a/src/lib/marble/ServerLayout.cpp
+++ b/src/lib/marble/ServerLayout.cpp
@@ -134,7 +134,7 @@ QUrl WmsServerLayout::downloadUrl( const QUrl &prototypeUrl, const Marble::TileI
if (m_textureLayer->fileFormat().toLower() == QLatin1String("jpg"))
url.addQueryItem( "format", "image/jpeg" );
else
- url.addQueryItem( "format", "image/" + m_textureLayer->fileFormat().toLower() );
+ url.addQueryItem("format", QLatin1String("image/") + m_textureLayer->fileFormat().toLower());
}
if ( !url.hasQueryItem( "srs" ) ) {
url.addQueryItem( "srs", epsgCode() );
diff --git a/src/lib/marble/StyleBuilder.cpp b/src/lib/marble/StyleBuilder.cpp
index 4bd3f60..dcf6124 100644
--- a/src/lib/marble/StyleBuilder.cpp
+++ b/src/lib/marble/StyleBuilder.cpp
@@ -220,21 +220,21 @@ GeoDataStyle::Ptr StyleBuilder::Private::createPOIStyle(const QFont &font, const
GeoDataStyle::Ptr StyleBuilder::Private::createOsmPOIStyle( const QFont &font, const QString &imagePath,
const QColor &textColor, const QColor &color, const QColor &outline)
{
- QString const path = MarbleDirs::path( "svg/osmcarto/svg/" + imagePath + ".svg" );
+ QString const path = MarbleDirs::path(QLatin1String("svg/osmcarto/svg/") + imagePath + QLatin1String(".svg"));
return createPOIStyle(font, path, textColor, color, outline, false, false);
}
GeoDataStyle::Ptr StyleBuilder::Private::createOsmPOIRingStyle( const QFont &font, const QString &imagePath,
const QColor &textColor, const QColor &color, const QColor &outline)
{
- QString const path = MarbleDirs::path( "svg/osmcarto/svg/" + imagePath + ".svg" );
+ QString const path = MarbleDirs::path(QLatin1String("svg/osmcarto/svg/") + imagePath + QLatin1String(".svg"));
return createPOIStyle(font, path, textColor, color, outline, false, true);
}
GeoDataStyle::Ptr StyleBuilder::Private::createOsmPOIAreaStyle( const QFont &font, const QString &imagePath,
const QColor &textColor, const QColor &color, const QColor &outline)
{
- QString const path = MarbleDirs::path( "svg/osmcarto/svg/" + imagePath + ".svg" );
+ QString const path = MarbleDirs::path(QLatin1String("svg/osmcarto/svg/") + imagePath + QLatin1String(".svg"));
return createPOIStyle(font, path, textColor, color, outline, true, false);
}
@@ -906,7 +906,7 @@ GeoDataStyle::ConstPtr StyleBuilder::createStyle(const StyleParameters &paramete
if (!season.isEmpty()) {
GeoDataIconStyle iconStyle = style->iconStyle();
- QString const image = QString("svg/osmcarto/svg/individual/tree-29-%1.svg").arg(season);
+ QString const image = QLatin1String("svg/osmcarto/svg/individual/tree-29-") + season + QLatin1String(".svg");
iconStyle.setIconPath(MarbleDirs::path(image));
GeoDataStyle::Ptr newStyle(new GeoDataStyle(*style));
diff --git a/src/lib/marble/TemplateDocument.cpp b/src/lib/marble/TemplateDocument.cpp
index 2dfb953..6e1a32d 100644
--- a/src/lib/marble/TemplateDocument.cpp
+++ b/src/lib/marble/TemplateDocument.cpp
@@ -44,9 +44,9 @@ void TemplateDocumentPrivate::processTemplateIncludes(QString &input)
}
foreach (const QString &include, includes) {
- QFile includeFile(":/htmlfeatures/includes/"+include+".inc");
+ QFile includeFile(QLatin1String(":/htmlfeatures/includes/") + include + QLatin1String(".inc"));
if (includeFile.open(QIODevice::ReadOnly)) {
- input.replace("%!{" + include + "}%", includeFile.readAll());
+ input.replace(QLatin1String("%!{") + include + QLatin1String("}%"), includeFile.readAll());
} else {
mDebug() << "[WARNING] Can't process template include" << include;
}
diff --git a/src/lib/marble/TileCreator.cpp b/src/lib/marble/TileCreator.cpp
index fba962f..4a1e154 100644
--- a/src/lib/marble/TileCreator.cpp
+++ b/src/lib/marble/TileCreator.cpp
@@ -175,10 +175,9 @@ TileCreator::TileCreator(const QString& sourceDir, const QString& installMap,
mDebug() << "Trying absolute path*:" << sourcePath;
}
else {
- sourcePath = MarbleDirs::path( "maps/" + sourceDir
- + '/' + installMap );
+ sourcePath = MarbleDirs::path(QLatin1String("maps/") + sourceDir + QLatin1Char('/') + installMap);
mDebug() << "Trying relative path*:"
- << "maps/" + sourceDir + '/' + installMap;
+ << QLatin1String("maps/") + sourceDir + QLatin1Char('/') + installMap;
}
mDebug() << "Creating tiles from*: " << sourcePath;
@@ -186,7 +185,7 @@ TileCreator::TileCreator(const QString& sourceDir, const QString& installMap,
d->m_source = new TileCreatorSourceImage( sourcePath );
if ( d->m_targetDir.isNull() )
- d->m_targetDir = MarbleDirs::localPath() + "/maps/"
+ d->m_targetDir = MarbleDirs::localPath() + QLatin1String("/maps/")
+ sourcePath.section( '/', -3, -2 ) + '/';
setTerminationEnabled( true );
diff --git a/src/lib/marble/TileCreatorDialog.cpp b/src/lib/marble/TileCreatorDialog.cpp
index be51d2a..639ba0f 100644
--- a/src/lib/marble/TileCreatorDialog.cpp
+++ b/src/lib/marble/TileCreatorDialog.cpp
@@ -84,7 +84,7 @@ void TileCreatorDialog::setProgress( int progress )
void TileCreatorDialog::setSummary( const QString& name,
const QString& description )
{
- const QString summary = "<b>" + QCoreApplication::translate("DGML", name.toUtf8().constData()) + "</b><br>" + QCoreApplication::translate("DGML", description.toUtf8().constData());
+ const QString summary = QLatin1String("<b>") + QCoreApplication::translate("DGML", name.toUtf8().constData()) + QLatin1String("</b><br>") + QCoreApplication::translate("DGML", description.toUtf8().constData());
d->uiWidget.descriptionLabel->setText( summary );
}
diff --git a/src/lib/marble/TinyWebBrowser.cpp b/src/lib/marble/TinyWebBrowser.cpp
index 295a5df..0900d88 100644
--- a/src/lib/marble/TinyWebBrowser.cpp
+++ b/src/lib/marble/TinyWebBrowser.cpp
@@ -38,7 +38,7 @@ static QString guessWikipediaDomain()
{
const QString code = MarbleLocale::languageCode();
- return QString ( "http://%1.m.wikipedia.org/" ).arg ( code );
+ return QLatin1String("https://") + code + QLatin1String(".m.wikipedia.org/");
}
TinyWebBrowser::TinyWebBrowser( QWidget* parent )
diff --git a/src/lib/marble/TourCaptureDialog.cpp b/src/lib/marble/TourCaptureDialog.cpp
index 5a780ce..60bd753 100644
--- a/src/lib/marble/TourCaptureDialog.cpp
+++ b/src/lib/marble/TourCaptureDialog.cpp
@@ -70,10 +70,10 @@ void TourCaptureDialog::loadDestinationFile()
QMessageBox::warning( this, tr( "Codecs are unavailable" ), tr( "Supported codecs are not found." ) );
return;
}
- QString filter = formats.first().name() + " (*."+formats.first().extension() + ')';
+ QString filter = formats.first().name() + QLatin1String(" (*.") + formats.first().extension() + QLatin1Char(')');
for( int i = 1; i < formats.size(); i++ )
{
- filter.append( ";;"+formats.at( i ).name() + " (*."+formats.at( i ).extension() + ')' );
+ filter += QLatin1String(";;") + formats.at(i).name() + QLatin1String(" (*.") + formats.at(i).extension() + QLatin1Char(')');
}
const QString defaultFileName =
ui->destinationEdit->text().isEmpty() ? m_defaultFileName : ui->destinationEdit->text();
@@ -96,7 +96,7 @@ void TourCaptureDialog::loadDestinationFile()
QString formatsExtensions = '.'+formats.at( 0 ).extension();
for( int i = 1; i < formats.size(); ++i )
{
- formatsExtensions.append( ", ."+formats.at( i ).extension() );
+ formatsExtensions += QLatin1String(", .") + formats.at(i).extension();
}
QMessageBox::warning(this, tr("Filename is not valid"),
tr("This file format is not supported. "
diff --git a/src/lib/marble/cloudsync/BookmarkSyncManager.cpp b/src/lib/marble/cloudsync/BookmarkSyncManager.cpp
index 350705c..ddb8084 100644
--- a/src/lib/marble/cloudsync/BookmarkSyncManager.cpp
+++ b/src/lib/marble/cloudsync/BookmarkSyncManager.cpp
@@ -213,8 +213,8 @@ BookmarkSyncManager::Private::Private(BookmarkSyncManager *parent, CloudSyncMana
m_bookmarkManager( 0 ),
m_bookmarkSyncEnabled( false )
{
- m_cachePath = QString( "%0/cloudsync/cache/bookmarks" ).arg( MarbleDirs::localPath() );
- m_localBookmarksPath = QString( "%0/bookmarks/bookmarks.kml" ).arg( MarbleDirs::localPath() );
+ m_cachePath = MarbleDirs::localPath() + QLatin1String("/cloudsync/cache/bookmarks");
+ m_localBookmarksPath = MarbleDirs::localPath() + QLatin1String("/bookmarks/bookmarks.kml");
m_downloadEndpoint = "bookmarks/kml";
m_uploadEndpoint = "bookmarks/update";
m_timestampEndpoint = "bookmarks/timestamp";
diff --git a/src/lib/marble/cloudsync/CloudRouteModel.cpp b/src/lib/marble/cloudsync/CloudRouteModel.cpp
index 920f0fc..f5a069a 100644
--- a/src/lib/marble/cloudsync/CloudRouteModel.cpp
+++ b/src/lib/marble/cloudsync/CloudRouteModel.cpp
@@ -45,7 +45,7 @@ CloudRouteModel::Private::Private() :
m_totalSize( -1 ),
m_downloadedSize( 0 )
{
- m_cacheDir = MarbleDirs::localPath() + "/cloudsync/cache/routes/";
+ m_cacheDir = MarbleDirs::localPath() + QLatin1String("/cloudsync/cache/routes/");
}
CloudRouteModel::CloudRouteModel( QObject* parent ) :
@@ -106,7 +106,7 @@ void CloudRouteModel::setItems( const QVector<RouteItem> &items )
bool CloudRouteModel::isCached( const QModelIndex &index ) const
{
- QFileInfo cacheDir( d->m_cacheDir + index.data( Timestamp ).toString() + ".kml" );
+ QFileInfo cacheDir(d->m_cacheDir + index.data(Timestamp).toString() + QLatin1String(".kml"));
return cacheDir.exists();
}
diff --git a/src/lib/marble/cloudsync/OwncloudSyncBackend.cpp b/src/lib/marble/cloudsync/OwncloudSyncBackend.cpp
index a66e41e..88612ef 100644
--- a/src/lib/marble/cloudsync/OwncloudSyncBackend.cpp
+++ b/src/lib/marble/cloudsync/OwncloudSyncBackend.cpp
@@ -66,7 +66,7 @@ class Q_DECL_HIDDEN OwncloudSyncBackend::Private {
};
OwncloudSyncBackend::Private::Private( CloudSyncManager* cloudSyncManager ) :
- m_cacheDir( MarbleDirs::localPath() + "/cloudsync/cache/routes/" ),
+ m_cacheDir(MarbleDirs::localPath() + QLatin1String("/cloudsync/cache/routes/")),
m_network(),
m_routeUploadReply(),
m_routeListReply(),
@@ -248,7 +248,7 @@ QPixmap OwncloudSyncBackend::createPreview( const QString &timestamp ) const
QPixmap pixmap = QPixmap::grabWidget( &mapWidget );
QDir( d->m_cacheDir.absolutePath() ).mkpath( "preview" );
- pixmap.save( d->m_cacheDir.absolutePath() + "/preview/" + timestamp + ".jpg" );
+ pixmap.save(d->m_cacheDir.absolutePath() + QLatin1String("/preview/") + timestamp + QLatin1String(".jpg"));
return pixmap;
}
diff --git a/src/lib/marble/cloudsync/RouteSyncManager.cpp b/src/lib/marble/cloudsync/RouteSyncManager.cpp
index d170fd6..0243f36 100644
--- a/src/lib/marble/cloudsync/RouteSyncManager.cpp
+++ b/src/lib/marble/cloudsync/RouteSyncManager.cpp
@@ -54,7 +54,7 @@ RouteSyncManager::Private::Private( CloudSyncManager *cloudSyncManager ) :
m_model( new CloudRouteModel() ),
m_owncloudBackend( cloudSyncManager )
{
- m_cacheDir = QDir( MarbleDirs::localPath() + "/cloudsync/cache/routes/" );
+ m_cacheDir = QDir(MarbleDirs::localPath() + QLatin1String("/cloudsync/cache/routes/"));
}
RouteSyncManager::RouteSyncManager(CloudSyncManager *cloudSyncManager) :
@@ -113,7 +113,7 @@ QString RouteSyncManager::saveDisplayedToCache() const
d->m_cacheDir.mkpath( d->m_cacheDir.absolutePath() );
const QString timestamp = generateTimestamp();
- const QString filename = d->m_cacheDir.absolutePath() + '/' + timestamp + ".kml";
+ const QString filename = d->m_cacheDir.absolutePath() + QLatin1Char('/') + timestamp + QLatin1String(".kml");
d->m_routingManager->saveRoute( filename );
return timestamp;
}
@@ -135,7 +135,7 @@ QVector<RouteItem> RouteSyncManager::cachedRouteList() const
GeoDataParser parser( GeoData_KML );
if( !parser.read( &file ) ) {
- mDebug() << "Could not read " + routeFilename;
+ mDebug() << QLatin1String("Could not read ") + routeFilename;
}
file.close();
@@ -146,8 +146,7 @@ QVector<RouteItem> RouteSyncManager::cachedRouteList() const
if ( container && container->size() > 0 ) {
GeoDataFolder *folder = container->folderList().at( 0 );
foreach ( GeoDataPlacemark *placemark, folder->placemarkList() ) {
- routeName.append( placemark->name() );
- routeName.append( " - " );
+ routeName += placemark->name() + QLatin1String(" - ");
}
}
diff --git a/src/lib/marble/declarative/OfflineDataModel.cpp b/src/lib/marble/declarative/OfflineDataModel.cpp
index 5445482..03709f9 100644
--- a/src/lib/marble/declarative/OfflineDataModel.cpp
+++ b/src/lib/marble/declarative/OfflineDataModel.cpp
@@ -17,7 +17,7 @@
OfflineDataModel::OfflineDataModel( QObject *parent ) : QSortFilterProxyModel( parent ),
m_vehicleTypeFilter( Any )
{
- m_newstuffModel.setTargetDirectory( Marble::MarbleDirs::localPath() + "/maps" );
+ m_newstuffModel.setTargetDirectory(Marble::MarbleDirs::localPath() + QLatin1String("/maps"));
m_newstuffModel.setRegistryFile( QDir::homePath() + "/.kde/share/apps/knewstuff3/marble-offline-data.knsregistry", Marble::NewstuffModel::NameTag );
m_newstuffModel.setProvider( "http://files.kde.org/marble/newstuff/maps-monav.xml" );
@@ -52,7 +52,7 @@ QVariant OfflineDataModel::data(const QModelIndex &index, int role) const
if ( data.size() > 1 ) {
QString result = data.at( 1 );
for ( int i=2; i<data.size(); ++i ) {
- result += " / " + data.at( i );
+ result += QLatin1String(" / ") + data.at(i);
}
result.remove( QLatin1String( " (Motorcar)" ) );
result.remove( QLatin1String( " (Pedestrian)" ) );
diff --git a/src/lib/marble/declarative/Placemark.cpp b/src/lib/marble/declarative/Placemark.cpp
index 4f2939e..a46cde8 100644
--- a/src/lib/marble/declarative/Placemark.cpp
+++ b/src/lib/marble/declarative/Placemark.cpp
@@ -220,13 +220,13 @@ QString Placemark::shop() const
if (shop == "Clothes" && data.containsTagKey("clothes") && !data.tagValue("clothes").isEmpty()){
QString clothes = data.tagValue("clothes");
clothes[0] = clothes[0].toUpper();
- m_shop = "Shop : " + shop + " (" + clothes + ")";
+ m_shop = QLatin1String("Shop : ") + shop + QLatin1String(" (") + clothes + QLatin1Char(')');
} else if (shop == "Clothes" && data.containsTagKey("designation") && !data.tagValue("designation").isEmpty()){
QString designation = data.tagValue("designation");
designation[0] = designation[0].toUpper();
- m_shop = "Shop : " + shop + " (" + designation + ")";
+ m_shop = QLatin1String("Shop : ") + shop + QLatin1String(" (") + designation + QLatin1Char(')');
} else {
- m_shop = "Shop : " + shop;
+ m_shop = QLatin1String("Shop : ") + shop;
}
}
@@ -267,7 +267,7 @@ void Placemark::addTagDescription(QString &target, const QString &key, const QSt
auto const & osmData = m_placemark.osmData();
if (osmData.containsTag(key, value)) {
if (!target.isEmpty()) {
- target += " · ";
+ target += QStringLiteral(" · "); // non-latin1
}
target += description;
}
diff --git a/src/lib/marble/geodata/data/GeoDataCoordinates.cpp b/src/lib/marble/geodata/data/GeoDataCoordinates.cpp
index f55c06f..da0afbb 100644
--- a/src/lib/marble/geodata/data/GeoDataCoordinates.cpp
+++ b/src/lib/marble/geodata/data/GeoDataCoordinates.cpp
@@ -392,7 +392,7 @@ QString GeoDataCoordinates::toString( GeoDataCoordinates::Notation notation, int
}
else{
coordString = lonToString( d->m_lon, notation, Radian, precision )
- + QString(", ")
+ + QLatin1String(", ")
+ latToString( d->m_lat, notation, Radian, precision );
}
diff --git a/src/lib/marble/geodata/data/LonLatParser.cpp b/src/lib/marble/geodata/data/LonLatParser.cpp
index e8f77b9..6729118 100644
--- a/src/lib/marble/geodata/data/LonLatParser.cpp
+++ b/src/lib/marble/geodata/data/LonLatParser.cpp
@@ -82,7 +82,7 @@ void LonLatParser::initAll()
// Sets "(north|east|south|west|[nesw])" in en, as translated names match untranslated ones
m_dirCapExp =
- QLatin1Char('(') + fullNamesExp + QLatin1Char('[') + simpleLetters + QStringLiteral("])");
+ QLatin1Char('(') + fullNamesExp + QLatin1Char('[') + simpleLetters + QLatin1String("])");
// expressions for symbols of degree, minutes and seconds
getLocaleList(m_degreeLocale, GeoDataCoordinates::tr("*", "Degree symbol terms, see http://techbase.kde.org/Projects/Marble/GeoDataCoordinatesTranslation"),
@@ -334,7 +334,7 @@ QString LonLatParser::createDecimalPointExp()
const QChar decimalPoint = QLocale::system().decimalPoint();
return (decimalPoint == QLatin1Char('.')) ? QStringLiteral("\\.") :
- QStringLiteral("[.") + decimalPoint + QLatin1Char(']');
+ QLatin1String("[.") + decimalPoint + QLatin1Char(']');
}
void LonLatParser::getLocaleList(QStringList& localeList, const QString& localeListString,
diff --git a/src/lib/marble/geodata/graphicsitem/GeoLineStringGraphicsItem.cpp b/src/lib/marble/geodata/graphicsitem/GeoLineStringGraphicsItem.cpp
index c00e22d..c7bdd52 100644
--- a/src/lib/marble/geodata/graphicsitem/GeoLineStringGraphicsItem.cpp
+++ b/src/lib/marble/geodata/graphicsitem/GeoLineStringGraphicsItem.cpp
@@ -31,9 +31,9 @@ GeoLineStringGraphicsItem::GeoLineStringGraphicsItem( const GeoDataFeature *feat
{
QString const category = StyleBuilder::visualCategoryName(feature->visualCategory());
QStringList paintLayers;
- paintLayers << QString("LineString/%1/outline").arg(category);
- paintLayers << QString("LineString/%1/inline").arg(category);
- paintLayers << QString("LineString/%1/label").arg(category);
+ paintLayers << QLatin1String("LineString/") + category + QLatin1String("/outline");
+ paintLayers << QLatin1String("LineString/") + category + QLatin1String("/inline");
+ paintLayers << QLatin1String("LineString/") + category + QLatin1String("/label");
setPaintLayers(paintLayers);
}
diff --git a/src/lib/marble/geodata/graphicsitem/GeoPhotoGraphicsItem.cpp b/src/lib/marble/geodata/graphicsitem/GeoPhotoGraphicsItem.cpp
index 6e43b40..1d3c56a 100644
--- a/src/lib/marble/geodata/graphicsitem/GeoPhotoGraphicsItem.cpp
+++ b/src/lib/marble/geodata/graphicsitem/GeoPhotoGraphicsItem.cpp
@@ -25,7 +25,7 @@ GeoPhotoGraphicsItem::GeoPhotoGraphicsItem( const GeoDataFeature *feature )
: GeoGraphicsItem( feature )
{
if (feature) {
- QString const paintLayer = QString("Photo/%1").arg(StyleBuilder::visualCategoryName(feature->visualCategory()));
+ QString const paintLayer = QLatin1String("Photo/") + StyleBuilder::visualCategoryName(feature->visualCategory());
setPaintLayers(QStringList() << paintLayer);
}
}
diff --git a/src/lib/marble/geodata/graphicsitem/GeoPointGraphicsItem.cpp b/src/lib/marble/geodata/graphicsitem/GeoPointGraphicsItem.cpp
index 4c9e96f..87c869b 100644
--- a/src/lib/marble/geodata/graphicsitem/GeoPointGraphicsItem.cpp
+++ b/src/lib/marble/geodata/graphicsitem/GeoPointGraphicsItem.cpp
@@ -21,7 +21,7 @@ GeoPointGraphicsItem::GeoPointGraphicsItem( const GeoDataFeature *feature )
: GeoGraphicsItem( feature )
{
if (feature) {
- QString const paintLayer = QString("Point/%1").arg(StyleBuilder::visualCategoryName(feature->visualCategory()));
+ QString const paintLayer = QLatin1String("Point/") + StyleBuilder::visualCategoryName(feature->visualCategory());
setPaintLayers(QStringList() << paintLayer);
}
}
diff --git a/src/lib/marble/geodata/graphicsitem/GeoPolygonGraphicsItem.cpp b/src/lib/marble/geodata/graphicsitem/GeoPolygonGraphicsItem.cpp
index 5d1df9b..e3f1be6 100644
--- a/src/lib/marble/geodata/graphicsitem/GeoPolygonGraphicsItem.cpp
+++ b/src/lib/marble/geodata/graphicsitem/GeoPolygonGraphicsItem.cpp
@@ -49,12 +49,12 @@ GeoPolygonGraphicsItem::GeoPolygonGraphicsItem(const GeoDataFeature *feature, co
else if (visualCategory == GeoDataFeature::Bathymetry) {
int elevation = extractBathymetryElevation(feature);
setZValue(this->zValue() + elevation);
- const QString paintLayer = QString("Polygon/%1").arg(StyleBuilder::visualCategoryName(visualCategory));
+ const QString paintLayer = QLatin1String("Polygon/") + StyleBuilder::visualCategoryName(visualCategory);
setPaintLayers(QStringList() << paintLayer);
}
else
{
- const QString paintLayer = QString("Polygon/%1").arg(StyleBuilder::visualCategoryName(visualCategory));
+ const QString paintLayer = QLatin1String("Polygon/") + StyleBuilder::visualCategoryName(visualCategory);
setPaintLayers(QStringList() << paintLayer);
}
}
@@ -81,12 +81,12 @@ GeoPolygonGraphicsItem::GeoPolygonGraphicsItem(const GeoDataFeature *feature, co
else if (visualCategory == GeoDataFeature::Bathymetry) {
int elevation = extractBathymetryElevation(feature);
setZValue(this->zValue() + elevation);
- const QString paintLayer = QString("Polygon/%1").arg(StyleBuilder::visualCategoryName(visualCategory));
+ const QString paintLayer = QLatin1String("Polygon/") + StyleBuilder::visualCategoryName(visualCategory);
setPaintLayers(QStringList() << paintLayer);
}
else
{
- const QString paintLayer = QString("Polygon/%1").arg(StyleBuilder::visualCategoryName(visualCategory));
+ const QString paintLayer = QLatin1String("Polygon/") + StyleBuilder::visualCategoryName(visualCategory);
setPaintLayers(QStringList() << paintLayer);
}
}
diff --git a/src/lib/marble/geodata/graphicsitem/GeoTrackGraphicsItem.cpp b/src/lib/marble/geodata/graphicsitem/GeoTrackGraphicsItem.cpp
index fb8bf16..289d9e9 100644
--- a/src/lib/marble/geodata/graphicsitem/GeoTrackGraphicsItem.cpp
+++ b/src/lib/marble/geodata/graphicsitem/GeoTrackGraphicsItem.cpp
@@ -23,7 +23,7 @@ GeoTrackGraphicsItem::GeoTrackGraphicsItem( const GeoDataFeature *feature, const
{
setTrack( track );
if (feature) {
- QString const paintLayer = QString("Track/%1").arg(StyleBuilder::visualCategoryName(feature->visualCategory()));
+ QString const paintLayer = QLatin1String("Track/") + StyleBuilder::visualCategoryName(feature->visualCategory());
setPaintLayers(QStringList() << paintLayer);
}
}
diff --git a/src/lib/marble/geodata/handlers/kml/KmlWhenTagHandler.cpp b/src/lib/marble/geodata/handlers/kml/KmlWhenTagHandler.cpp
index 2918d96..400b010 100644
--- a/src/lib/marble/geodata/handlers/kml/KmlWhenTagHandler.cpp
+++ b/src/lib/marble/geodata/handlers/kml/KmlWhenTagHandler.cpp
@@ -64,10 +64,10 @@ GeoDataTimeStamp::TimeResolution KmlwhenTagHandler::modify( QString& whenString
switch( whenString.length() )
{
case 4:
- whenString.append( "-01-01" );
+ whenString += QLatin1String("-01-01");
return GeoDataTimeStamp::YearResolution;
case 7:
- whenString.append( "-01" );
+ whenString += QLatin1String("-01");
return GeoDataTimeStamp::MonthResolution;
case 10:
return GeoDataTimeStamp::DayResolution;
diff --git a/src/lib/marble/geodata/parser/GeoParser.cpp b/src/lib/marble/geodata/parser/GeoParser.cpp
index 71c948f..c48d9fe 100644
--- a/src/lib/marble/geodata/parser/GeoParser.cpp
+++ b/src/lib/marble/geodata/parser/GeoParser.cpp
@@ -62,11 +62,11 @@ static void dumpParentStack( const QString& name, int size, bool close )
if ( close ) {
depth--;
- result += "</";
+ result += QLatin1String("</");
} else
result += '<';
- result += name + "> stack size " + QString::number( size );
+ result += name + QLatin1String("> stack size ") + QString::number(size);
fprintf( stderr, "%s\n", qPrintable( result ));
}
#endif
@@ -186,10 +186,10 @@ void GeoParser::parseDocument()
else {
// This is only used for debugging purposes.
m_nodeStack.push( stackItem );
- dumpParentStack( name().toString() + "-discarded", m_nodeStack.size(), false );
+ dumpParentStack(name().toString() + QLatin1String("-discarded"), m_nodeStack.size(), false);
m_nodeStack.pop();
- dumpParentStack( name().toString() + "-discarded", m_nodeStack.size(), true );
+ dumpParentStack(name().toString() + QLatin1String("-discarded"), m_nodeStack.size(), true);
}
#endif
}
diff --git a/src/lib/marble/geodata/scene/GeoSceneHead.cpp b/src/lib/marble/geodata/scene/GeoSceneHead.cpp
index 0297766..20b7552 100644
--- a/src/lib/marble/geodata/scene/GeoSceneHead.cpp
+++ b/src/lib/marble/geodata/scene/GeoSceneHead.cpp
@@ -115,7 +115,7 @@ QString GeoSceneHead::theme() const
QString GeoSceneHead::mapThemeId() const
{
- return d->m_target + '/' + d->m_theme + '/' + d->m_theme + ".dgml";
+ return d->m_target + QLatin1Char('/') + d->m_theme + QLatin1Char('/') + d->m_theme + QLatin1String(".dgml");
}
void GeoSceneHead::setTheme( const QString& theme )
diff --git a/src/lib/marble/geodata/scene/GeoSceneTileDataset.cpp b/src/lib/marble/geodata/scene/GeoSceneTileDataset.cpp
index 636daed..1658e0f 100644
--- a/src/lib/marble/geodata/scene/GeoSceneTileDataset.cpp
+++ b/src/lib/marble/geodata/scene/GeoSceneTileDataset.cpp
@@ -224,9 +224,7 @@ QUrl GeoSceneTileDataset::downloadUrl( const TileId &id ) const
{
// default download url
if ( m_downloadUrls.empty() ) {
- QUrl const defaultUrl = QUrl(QString("%1/%2")
- .arg("https://maps.kde.org")
- .arg(m_serverLayout->sourceDir()));
+ QUrl const defaultUrl = QUrl(QLatin1String("https://maps.kde.org/") + m_serverLayout->sourceDir());
mDebug() << "No download URL specified for tiles stored in "
<< m_sourceDir << ", falling back to " << defaultUrl.toString();
return m_serverLayout->downloadUrl(defaultUrl, id);
@@ -290,7 +288,7 @@ QString GeoSceneTileDataset::relativeTileFileName( const TileId &id ) const
QString GeoSceneTileDataset::themeStr() const
{
QFileInfo const dirInfo( sourceDir() );
- return dirInfo.isAbsolute() ? sourceDir() : "maps/" + sourceDir();
+ return dirInfo.isAbsolute() ? sourceDir() : QLatin1String("maps/") + sourceDir();
}
QList<const DownloadPolicy *> GeoSceneTileDataset::downloadPolicies() const
diff --git a/src/lib/marble/osm/OsmRelationManagerWidget_p.cpp b/src/lib/marble/osm/OsmRelationManagerWidget_p.cpp
index 878937c..1b9aef4 100644
--- a/src/lib/marble/osm/OsmRelationManagerWidget_p.cpp
+++ b/src/lib/marble/osm/OsmRelationManagerWidget_p.cpp
@@ -88,7 +88,7 @@ void OsmRelationManagerWidgetPrivate::populateDropMenu()
// Suggesting existing relations
foreach ( const OsmPlacemarkData &relationData, m_allRelations->values() ) {
- QString relationText = QString( "%1 (%2)" ).arg( relationData.tagValue( "name" ) ).arg( relationData.tagValue( "type" ) );
+ const QString relationText = relationData.tagValue("name") + QLatin1String(" (") + relationData.tagValue("type") + QLatin1Char(')');
// Don't suggest relations the placemark is already part of
if ( m_placemark->hasOsmData() && m_placemark->osmData().containsRelation( relationData.id() ) ) {
diff --git a/src/lib/marble/routing/RoutingManager.cpp b/src/lib/marble/routing/RoutingManager.cpp
index 5e0b115..8151785 100644
--- a/src/lib/marble/routing/RoutingManager.cpp
+++ b/src/lib/marble/routing/RoutingManager.cpp
@@ -505,10 +505,10 @@ void RoutingManager::setGuidanceModeEnabled( bool enabled )
d->saveRoute( d->stateFile( "guidance.kml" ) );
if ( d->m_guidanceModeWarning ) {
- QString text = "<p>" + tr( "Caution: Driving instructions may be incomplete or wrong." );
- text += ' ' + tr( "Road construction, weather and other unforeseen variables can result in the suggested route not to be the most expedient or safest route to your destination." );
- text += ' ' + tr( "Please use common sense while navigating." ) + "</p>";
- text += "<p>" + tr( "The Marble development team wishes you a pleasant and safe journey." ) + "</p>";
+ QString text = QLatin1String("<p>") + tr("Caution: Driving instructions may be incomplete or wrong.") +
+ QLatin1Char(' ') + tr("Road construction, weather and other unforeseen variables can result in the suggested route not to be the most expedient or safest route to your destination.") +
+ QLatin1Char(' ') + tr("Please use common sense while navigating.") + QLatin1String("</p>") +
+ QLatin1String("<p>") + tr("The Marble development team wishes you a pleasant and safe journey.") + QLatin1String("</p>");
QPointer<QMessageBox> messageBox = new QMessageBox(QMessageBox::Information, tr("Guidance Mode"), text, QMessageBox::Ok);
QCheckBox *showAgain = new QCheckBox( tr( "Show again" ) );
showAgain->setChecked( true );
diff --git a/src/lib/marble/routing/RoutingModel.cpp b/src/lib/marble/routing/RoutingModel.cpp
index 234893f..14f8ac8 100644
--- a/src/lib/marble/routing/RoutingModel.cpp
+++ b/src/lib/marble/routing/RoutingModel.cpp
@@ -171,15 +171,14 @@ void RoutingModel::setRoute( const Route &route )
void RoutingModel::exportGpx( QIODevice *device ) const
{
- QString content( "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\" ?>\n" );
- content += "<gpx xmlns=\"http://www.topografix.com/GPX/1/1\" creator=\"Marble\" version=\"1.1\" ";
- content += "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ";
- content += "xsi:schemaLocation=\"http://www.topografix.com/GPX/1/1 ";
- content += "http://www.topografix.com/GPX/1/1/gpx.xsd\">\n";
- content += "<metadata>\n <link href=\"http://edu.kde.org/marble\">\n ";
- content += "<text>Marble Virtual Globe</text>\n </link>\n</metadata>\n";
-
- content += " <rte>\n <name>Route</name>\n";
+ QString content = QLatin1String("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\" ?>\n"
+ "<gpx xmlns=\"http://www.topografix.com/GPX/1/1\" creator=\"Marble\" version=\"1.1\" "
+ "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "
+ "xsi:schemaLocation=\"http://www.topografix.com/GPX/1/1 "
+ "http://www.topografix.com/GPX/1/1/gpx.xsd\">\n"
+ "<metadata>\n <link href=\"http://edu.kde.org/marble\">\n "
+ "<text>Marble Virtual Globe</text>\n </link>\n</metadata>\n"
+ " <rte>\n <name>Route</name>\n");
bool hasAltitude = false;
for ( int i=0; !hasAltitude && i<d->m_route.size(); ++i ) {
hasAltitude = d->m_route.at( i ).maneuver().position().altitude() != 0.0;
@@ -196,9 +195,8 @@ void RoutingModel::exportGpx( QIODevice *device ) const
}
content += QString( " </rtept>\n" );
}
- content += " </rte>\n";
-
- content += "<trk>\n <name>Route</name>\n <trkseg>\n";
+ content += QLatin1String(" </rte>\n"
+ "<trk>\n <name>Route</name>\n <trkseg>\n");
GeoDataLineString points = d->m_route.path();
hasAltitude = false;
for ( int i=0; !hasAltitude && i<points.size(); ++i ) {
@@ -214,8 +212,8 @@ void RoutingModel::exportGpx( QIODevice *device ) const
}
content += QString( " </trkpt>\n" );
}
- content += " </trkseg>\n </trk>\n";
- content += "</gpx>\n";
+ content += QLatin1String(" </trkseg>\n </trk>\n"
+ "</gpx>\n");
device->write( content.toUtf8() );
}
diff --git a/src/lib/marble/routing/RoutingWidget.cpp b/src/lib/marble/routing/RoutingWidget.cpp
index 1effe3d..349cdc7 100644
--- a/src/lib/marble/routing/RoutingWidget.cpp
+++ b/src/lib/marble/routing/RoutingWidget.cpp
@@ -476,7 +476,7 @@ void RoutingWidget::handleSearchResult( RoutingInputWidget *widget )
activatePlacemark( model->index( 0, 0 ) );
} else {
QString const results = tr( "No placemark found" );
- d->m_ui.resultLabel->setText( "<font color=\"red\">" + results + "</font>" );
+ d->m_ui.resultLabel->setText(QLatin1String("<font color=\"red\">") + results + QLatin1String("</font>"));
d->m_ui.resultLabel->setVisible( true );
}
@@ -593,7 +593,7 @@ void RoutingWidget::updateRouteState( RoutingManager::State state )
d->m_ui.searchButton->setIcon( QIcon() );
if ( d->m_routingManager->routingModel()->rowCount() == 0 ) {
const QString results = tr( "No route found" );
- d->m_ui.resultLabel->setText( "<font color=\"red\">" + results + "</font>" );
+ d->m_ui.resultLabel->setText(QLatin1String("<font color=\"red\">") + results + QLatin1String("</font>"));
d->m_ui.resultLabel->setVisible( true );
}
}
@@ -736,7 +736,7 @@ void RoutingWidget::saveRoute()
if ( !fileName.isEmpty() ) {
// maemo 5 file dialog does not append the file extension
if ( !fileName.endsWith(QLatin1String( ".kml" ), Qt::CaseInsensitive) ) {
- fileName.append( ".kml" );
+ fileName += QLatin1String(".kml");
}
d->m_routingManager->setLastSavePath( QFileInfo( fileName ).absolutePath() );
d->m_routingManager->saveRoute( fileName );
@@ -900,7 +900,8 @@ void RoutingWidget::initializeTour()
QList<WaypointInfo> waypoints;
double totalDistance = 0.0;
for( int i=0; i<route.size(); ++i ){
- waypoints << WaypointInfo( i, totalDistance, route.at(i).path().first(), route.at(i).maneuver(), QString("start ") + QString( i ) );
+ // TODO: QString( i )?
+ waypoints << WaypointInfo(i, totalDistance, route.at(i).path().first(), route.at(i).maneuver(), QLatin1String("start ") + QString(i));
totalDistance += route.at( i ).distance();
}
diff --git a/src/lib/marble/routing/SpeakersModel.cpp b/src/lib/marble/routing/SpeakersModel.cpp
index a6ee362..0c79fac 100644
--- a/src/lib/marble/routing/SpeakersModel.cpp
+++ b/src/lib/marble/routing/SpeakersModel.cpp
@@ -61,7 +61,7 @@ bool SpeakersModelItem::lessThan( const SpeakersModelItem& one, const SpeakersMo
SpeakersModelPrivate::SpeakersModelPrivate( SpeakersModel* parent ) :
m_parent( parent )
{
- m_newstuffModel.setTargetDirectory( MarbleDirs::localPath() + "/audio/speakers" );
+ m_newstuffModel.setTargetDirectory(MarbleDirs::localPath() + QLatin1String("/audio/speakers"));
m_newstuffModel.setProvider( "http://edu.kde.org/marble/newstuff/speakers.xml" );
QObject::connect( &m_newstuffModel, SIGNAL(modelReset()), m_parent, SLOT(fillModel()) );
QObject::connect( &m_newstuffModel, SIGNAL(installationProgressed(int,qreal)),
@@ -75,7 +75,7 @@ void SpeakersModelPrivate::fillModel()
QStringList const baseDirs = QStringList() << MarbleDirs::systemPath() << MarbleDirs::localPath();
foreach ( const QString &baseDir, baseDirs ) {
- QString base = baseDir + "/audio/speakers/";
+ const QString base = baseDir + QLatin1String("/audio/speakers/");
QDir::Filters filter = QDir::Readable | QDir::Dirs | QDir::NoDotAndDotDot;
QFileInfoList subdirs = QDir( base ).entryInfoList( filter, QDir::Name );
diff --git a/src/lib/marble/routing/VoiceNavigationModel.cpp b/src/lib/marble/routing/VoiceNavigationModel.cpp
index 985cf07..b2508fb 100644
--- a/src/lib/marble/routing/VoiceNavigationModel.cpp
+++ b/src/lib/marble/routing/VoiceNavigationModel.cpp
@@ -228,7 +228,7 @@ void VoiceNavigationModelPrivate::updateInstruction( RouteSegment segment, qreal
if (!m_announcementText.isEmpty() && distance < 75 && nextSegmentDistance != 0 && nextSegmentDistance < 75) {
QString nextSegmentAnnouncementText = announcementText(nextSegmentDirection, nextSegmentDistance);
if (!nextSegmentAnnouncementText.isEmpty()) {
- m_announcementText += QStringLiteral(", then ") + nextSegmentAnnouncementText;
+ m_announcementText += QLatin1String(", then ") + nextSegmentAnnouncementText;
}
}
emit m_parent->instructionChanged();
@@ -303,7 +303,7 @@ void VoiceNavigationModel::setSpeaker(const QString &speaker)
if ( speaker != d->m_speaker ) {
QFileInfo speakerDir = QFileInfo( speaker );
if ( !speakerDir.exists() ) {
- d->m_speaker = MarbleDirs::path( "/audio/speakers/" + speaker );
+ d->m_speaker = MarbleDirs::path(QLatin1String("/audio/speakers/") + speaker);
} else {
d->m_speaker = speaker;
}
diff --git a/src/plugins/render/annotate/EditPolygonDialog.cpp b/src/plugins/render/annotate/EditPolygonDialog.cpp
index b6427ca..4305fc7 100644
--- a/src/plugins/render/annotate/EditPolygonDialog.cpp
+++ b/src/plugins/render/annotate/EditPolygonDialog.cpp
@@ -234,7 +234,7 @@ void EditPolygonDialog::handleChangingStyle()
style->lineStyle().setWidth( d->m_linesWidth->value() );
// 0 corresponds to "Filled" and 1 corresponds to "Not Filled".
style->polyStyle().setFill( !d->m_filledColor->currentIndex() );
- style->setId( d->m_placemark->id() + "Style" );
+ style->setId(d->m_placemark->id() + QLatin1String("Style"));
// Adjust the lines/polygon colors.
diff --git a/src/plugins/render/annotate/EditPolylineDialog.cpp b/src/plugins/render/annotate/EditPolylineDialog.cpp
index f936bc3..4820795 100644
--- a/src/plugins/render/annotate/EditPolylineDialog.cpp
+++ b/src/plugins/render/annotate/EditPolylineDialog.cpp
@@ -206,7 +206,7 @@ void EditPolylineDialog::handleChangingStyle()
GeoDataStyle::Ptr newStyle(new GeoDataStyle( *d->m_placemark->style() ));
newStyle->lineStyle().setColor( d->m_linesDialog->currentColor() );
newStyle->lineStyle().setWidth( d->m_linesWidth->value() );
- newStyle->setId( d->m_placemark->id() + "Style" );
+ newStyle->setId(d->m_placemark->id() + QLatin1String("Style"));
d->m_placemark->setStyle( newStyle );
updatePolyline();
diff --git a/src/plugins/render/annotate/GroundOverlayFrame.cpp b/src/plugins/render/annotate/GroundOverlayFrame.cpp
index 02181d1..42044ca 100644
--- a/src/plugins/render/annotate/GroundOverlayFrame.cpp
+++ b/src/plugins/render/annotate/GroundOverlayFrame.cpp
@@ -41,56 +41,56 @@ GroundOverlayFrame::GroundOverlayFrame( GeoDataPlacemark *placemark,
{
m_resizeIcons.reserve(16);
// NorthWest
- m_resizeIcons.append( QImage( MarbleDirs::systemPath() + "/bitmaps/editarrows/arrow-diagonal-topleft.png" ) );
- m_resizeIcons.append( QImage( MarbleDirs::systemPath() + "/bitmaps/editarrows/arrow-diagonal-topleft-active.png" ) );
+ m_resizeIcons.append(QImage(MarbleDirs::systemPath() + QLatin1String("/bitmaps/editarrows/arrow-diagonal-topleft.png")));
+ m_resizeIcons.append(QImage(MarbleDirs::systemPath() + QLatin1String("/bitmaps/editarrows/arrow-diagonal-topleft-active.png")));
// SouthWest
- m_resizeIcons.append( QImage( MarbleDirs::systemPath() + "/bitmaps/editarrows/arrow-diagonal-topright.png" ) );
- m_resizeIcons.append( QImage( MarbleDirs::systemPath() + "/bitmaps/editarrows/arrow-diagonal-topright-active.png" ) );
+ m_resizeIcons.append(QImage(MarbleDirs::systemPath() + QLatin1String("/bitmaps/editarrows/arrow-diagonal-topright.png")));
+ m_resizeIcons.append(QImage(MarbleDirs::systemPath() + QLatin1String("/bitmaps/editarrows/arrow-diagonal-topright-active.png")));
// SouthEast
- m_resizeIcons.append( QImage( MarbleDirs::systemPath() + "/bitmaps/editarrows/arrow-diagonal-topleft.png" ) );
- m_resizeIcons.append( QImage( MarbleDirs::systemPath() + "/bitmaps/editarrows/arrow-diagonal-topleft-active.png" ) );
+ m_resizeIcons.append(QImage(MarbleDirs::systemPath() + QLatin1String("/bitmaps/editarrows/arrow-diagonal-topleft.png")));
+ m_resizeIcons.append(QImage(MarbleDirs::systemPath() + QLatin1String("/bitmaps/editarrows/arrow-diagonal-topleft-active.png")));
// NorthEast
- m_resizeIcons.append( QImage( MarbleDirs::systemPath() + "/bitmaps/editarrows/arrow-diagonal-topright.png" ) );
- m_resizeIcons.append( QImage( MarbleDirs::systemPath() + "/bitmaps/editarrows/arrow-diagonal-topright-active.png" ) );
+ m_resizeIcons.append(QImage(MarbleDirs::systemPath() + QLatin1String("/bitmaps/editarrows/arrow-diagonal-topright.png")));
+ m_resizeIcons.append(QImage(MarbleDirs::systemPath() + QLatin1String("/bitmaps/editarrows/arrow-diagonal-topright-active.png")));
// North
- m_resizeIcons.append( QImage( MarbleDirs::systemPath() + "/bitmaps/editarrows/arrow-vertical.png" ) );
- m_resizeIcons.append( QImage( MarbleDirs::systemPath() + "/bitmaps/editarrows/arrow-vertical-active.png" ) );
+ m_resizeIcons.append(QImage(MarbleDirs::systemPath() + QLatin1String("/bitmaps/editarrows/arrow-vertical.png")));
+ m_resizeIcons.append(QImage(MarbleDirs::systemPath() + QLatin1String("/bitmaps/editarrows/arrow-vertical-active.png")));
// South
- m_resizeIcons.append( QImage( MarbleDirs::systemPath() + "/bitmaps/editarrows/arrow-vertical.png" ) );
- m_resizeIcons.append( QImage( MarbleDirs::systemPath() + "/bitmaps/editarrows/arrow-vertical-active.png" ) );
+ m_resizeIcons.append(QImage(MarbleDirs::systemPath() + QLatin1String("/bitmaps/editarrows/arrow-vertical.png")));
+ m_resizeIcons.append(QImage(MarbleDirs::systemPath() + QLatin1String("/bitmaps/editarrows/arrow-vertical-active.png")));
// East
- m_resizeIcons.append( QImage( MarbleDirs::systemPath() + "/bitmaps/editarrows/arrow-horizontal.png" ) );
- m_resizeIcons.append( QImage( MarbleDirs::systemPath() + "/bitmaps/editarrows/arrow-horizontal-active.png" ) );
+ m_resizeIcons.append(QImage(MarbleDirs::systemPath() + QLatin1String("/bitmaps/editarrows/arrow-horizontal.png")));
+ m_resizeIcons.append(QImage(MarbleDirs::systemPath() + QLatin1String("/bitmaps/editarrows/arrow-horizontal-active.png")));
// West
- m_resizeIcons.append( QImage( MarbleDirs::systemPath() + "/bitmaps/editarrows/arrow-horizontal.png" ) );
- m_resizeIcons.append( QImage( MarbleDirs::systemPath() + "/bitmaps/editarrows/arrow-horizontal-active.png" ) );
+ m_resizeIcons.append(QImage(MarbleDirs::systemPath() + QLatin1String("/bitmaps/editarrows/arrow-horizontal.png")));
+ m_resizeIcons.append(QImage(MarbleDirs::systemPath() + QLatin1String("/bitmaps/editarrows/arrow-horizontal-active.png")));
m_rotateIcons.reserve(16);
// NorthWest
- m_rotateIcons.append( QImage( MarbleDirs::systemPath() + "/bitmaps/editarrows/arrow-rotation-topleft.png" ) );
- m_rotateIcons.append( QImage( MarbleDirs::systemPath() + "/bitmaps/editarrows/arrow-rotation-topleft-active.png" ) );
+ m_rotateIcons.append(QImage(MarbleDirs::systemPath() + QLatin1String("/bitmaps/editarrows/arrow-rotation-topleft.png")));
+ m_rotateIcons.append(QImage(MarbleDirs::systemPath() + QLatin1String("/bitmaps/editarrows/arrow-rotation-topleft-active.png")));
// SouthWest
- m_rotateIcons.append( QImage( MarbleDirs::systemPath() + "/bitmaps/editarrows/arrow-rotation-bottomleft.png" ) );
- m_rotateIcons.append( QImage( MarbleDirs::systemPath() + "/bitmaps/editarrows/arrow-rotation-bottomleft-active.png" ) );
+ m_rotateIcons.append(QImage(MarbleDirs::systemPath() + QLatin1String("/bitmaps/editarrows/arrow-rotation-bottomleft.png")));
+ m_rotateIcons.append(QImage(MarbleDirs::systemPath() + QLatin1String("/bitmaps/editarrows/arrow-rotation-bottomleft-active.png")));
// SouthEast
- m_rotateIcons.append( QImage( MarbleDirs::systemPath() + "/bitmaps/editarrows/arrow-rotation-bottomright.png" ) );
- m_rotateIcons.append( QImage( MarbleDirs::systemPath() + "/bitmaps/editarrows/arrow-rotation-bottomright-active.png" ) );
+ m_rotateIcons.append(QImage(MarbleDirs::systemPath() + QLatin1String("/bitmaps/editarrows/arrow-rotation-bottomright.png")));
+ m_rotateIcons.append(QImage(MarbleDirs::systemPath() + QLatin1String("/bitmaps/editarrows/arrow-rotation-bottomright-active.png")));
// NorthEast
- m_rotateIcons.append( QImage( MarbleDirs::systemPath() + "/bitmaps/editarrows/arrow-rotation-topright.png" ) );
- m_rotateIcons.append( QImage( MarbleDirs::systemPath() + "/bitmaps/editarrows/arrow-rotation-topright-active.png" ) );
+ m_rotateIcons.append(QImage(MarbleDirs::systemPath() + QLatin1String("/bitmaps/editarrows/arrow-rotation-topright.png")));
+ m_rotateIcons.append(QImage(MarbleDirs::systemPath() + QLatin1String("/bitmaps/editarrows/arrow-rotation-topright-active.png")));
// North
- m_rotateIcons.append( QImage( MarbleDirs::systemPath() + "/bitmaps/editarrows/arrow-horizontal.png" ) );
- m_rotateIcons.append( QImage( MarbleDirs::systemPath() + "/bitmaps/editarrows/arrow-horizontal-active.png" ) );
+ m_rotateIcons.append(QImage(MarbleDirs::systemPath() + QLatin1String("/bitmaps/editarrows/arrow-horizontal.png")));
+ m_rotateIcons.append(QImage(MarbleDirs::systemPath() + QLatin1String("/bitmaps/editarrows/arrow-horizontal-active.png")));
// South
- m_rotateIcons.append( QImage( MarbleDirs::systemPath() + "/bitmaps/editarrows/arrow-horizontal.png" ) );
- m_rotateIcons.append( QImage( MarbleDirs::systemPath() + "/bitmaps/editarrows/arrow-horizontal-active.png" ) );
+ m_rotateIcons.append(QImage(MarbleDirs::systemPath() + QLatin1String("/bitmaps/editarrows/arrow-horizontal.png")));
+ m_rotateIcons.append(QImage(MarbleDirs::systemPath() + QLatin1String("/bitmaps/editarrows/arrow-horizontal-active.png")));
// East
- m_rotateIcons.append( QImage( MarbleDirs::systemPath() + "/bitmaps/editarrows/arrow-vertical.png" ) );
- m_rotateIcons.append( QImage( MarbleDirs::systemPath() + "/bitmaps/editarrows/arrow-vertical-active.png" ) );
+ m_rotateIcons.append(QImage(MarbleDirs::systemPath() + QLatin1String("/bitmaps/editarrows/arrow-vertical.png")));
+ m_rotateIcons.append(QImage(MarbleDirs::systemPath() + QLatin1String("/bitmaps/editarrows/arrow-vertical-active.png")));
// West
- m_rotateIcons.append( QImage( MarbleDirs::systemPath() + "/bitmaps/editarrows/arrow-vertical.png" ) );
- m_rotateIcons.append( QImage( MarbleDirs::systemPath() + "/bitmaps/editarrows/arrow-vertical-active.png" ) );
+ m_rotateIcons.append(QImage(MarbleDirs::systemPath() + QLatin1String("/bitmaps/editarrows/arrow-vertical.png")));
+ m_rotateIcons.append(QImage(MarbleDirs::systemPath() + QLatin1String("/bitmaps/editarrows/arrow-vertical-active.png")));
update();
setPaintLayers(QStringList() << "GroundOverlayFrame");
diff --git a/src/plugins/render/aprs/AprsPlugin.cpp b/src/plugins/render/aprs/AprsPlugin.cpp
index 2c015c2..a005f76 100644
--- a/src/plugins/render/aprs/AprsPlugin.cpp
+++ b/src/plugins/render/aprs/AprsPlugin.cpp
@@ -413,7 +413,7 @@ bool AprsPlugin::render( GeoPainter *painter, ViewportParams *viewport, const QS
if ( !( viewport->viewLatLonAltBox() == m_lastBox ) ) {
m_lastBox = viewport->viewLatLonAltBox();
- QString towrite = "#filter a/" +
+ 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 ) ) +'/' +
diff --git a/src/plugins/render/earthquake/EarthquakeItem.cpp b/src/plugins/render/earthquake/EarthquakeItem.cpp
index 1f3b153..b2c789e 100644
--- a/src/plugins/render/earthquake/EarthquakeItem.cpp
+++ b/src/plugins/render/earthquake/EarthquakeItem.cpp
@@ -122,14 +122,15 @@ void EarthquakeItem::setDepth( double depth )
void EarthquakeItem::updateTooltip()
{
- QString html = "<table cellpadding=\"2\">";
+ QString html = QLatin1String("<table cellpadding=\"2\">");
if ( m_dateTime.isValid() ) {
- html += "<tr><td align=\"right\">Date</td>";
- html += "<td>" + m_dateTime.toString( Qt::SystemLocaleShortDate ) + "</td></tr>";
+ html += QLatin1String("<tr><td align=\"right\">Date</td>") +
+ QLatin1String("<td>") + m_dateTime.toString(Qt::SystemLocaleShortDate) + QLatin1String("</td></tr>");
}
- html += "<tr><td align=\"right\">Magnitude</td><td>" + QString::number( m_magnitude ) + "</td></tr>";
- html += "<tr><td align=\"right\">Depth</td><td>" + QString::number( m_depth ) + " km</td></tr>";
- html += "</table>";
+ html +=
+ QLatin1String("<tr><td align=\"right\">Magnitude</td><td>") + QString::number(m_magnitude) + QLatin1String("</td></tr>") +
+ QLatin1String("<tr><td align=\"right\">Depth</td><td>") + QString::number(m_depth) + QLatin1String(" km</td></tr>") +
+ QLatin1String("</table>");
setToolTip( html );
}
diff --git a/src/plugins/render/earthquake/EarthquakeModel.cpp b/src/plugins/render/earthquake/EarthquakeModel.cpp
index 83f5ada..088ff37 100644
--- a/src/plugins/render/earthquake/EarthquakeModel.cpp
+++ b/src/plugins/render/earthquake/EarthquakeModel.cpp
@@ -60,15 +60,15 @@ void EarthquakeModel::getAdditionalItems( const GeoDataLatLonAltBox& box, qint32
return;
}
- QString geonamesUrl( "http://ws.geonames.org/earthquakesJSON" );
- geonamesUrl += "?north=" + QString::number( box.north() * RAD2DEG );
- geonamesUrl += "&south=" + QString::number( box.south() * RAD2DEG );
- geonamesUrl += "&east=" + QString::number( box.east() * RAD2DEG );
- geonamesUrl += "&west=" + QString::number( box.west() * RAD2DEG );
- geonamesUrl += "&date=" + m_endDate.toString( "yyyy-MM-dd" );
- geonamesUrl += "&maxRows=" + QString::number( number );
- geonamesUrl += "&username=marble";
- geonamesUrl += "&formatted=true";
+ const QString geonamesUrl( QLatin1String("http://ws.geonames.org/earthquakesJSON") +
+ QLatin1String("?north=") + QString::number(box.north() * RAD2DEG) +
+ QLatin1String("&south=") + QString::number(box.south() * RAD2DEG) +
+ QLatin1String("&east=") + QString::number(box.east() * RAD2DEG) +
+ QLatin1String("&west=") + QString::number(box.west() * RAD2DEG) +
+ QLatin1String("&date=") + m_endDate.toString("yyyy-MM-dd") +
+ QLatin1String("&maxRows=") + QString::number(number) +
+ QLatin1String("&username=marble") +
+ QLatin1String("&formatted=true"));
downloadDescriptionFile( QUrl( geonamesUrl ) );
}
diff --git a/src/plugins/render/elevationprofilefloatitem/ElevationProfileDataSource.cpp b/src/plugins/render/elevationprofilefloatitem/ElevationProfileDataSource.cpp
index 9327928..05dcf19 100644
--- a/src/plugins/render/elevationprofilefloatitem/ElevationProfileDataSource.cpp
+++ b/src/plugins/render/elevationprofilefloatitem/ElevationProfileDataSource.cpp
@@ -162,7 +162,7 @@ void ElevationProfileTrackDataSource::handleObjectAdded(GeoDataObject *object)
QList<const GeoDataTrack *> list = i.value();
for (int i = 0; i<list.size(); ++i) {
m_trackList << list[i];
- m_trackChooserList << QString(filename + ": " + QString::number(i));
+ m_trackChooserList << QString(filename + QLatin1String(": ") + QString::number(i));
}
}
if (selectedTrack) {
diff --git a/src/plugins/render/elevationprofilefloatitem/ElevationProfileFloatItem.cpp b/src/plugins/render/elevationprofilefloatitem/ElevationProfileFloatItem.cpp
index 2d4c8ef..881acbc 100644
--- a/src/plugins/render/elevationprofilefloatitem/ElevationProfileFloatItem.cpp
+++ b/src/plugins/render/elevationprofilefloatitem/ElevationProfileFloatItem.cpp
@@ -233,7 +233,7 @@ void ElevationProfileFloatItem::paintContent( QPainter *painter )
dashedPen.setColor( Oxygen::aluminumGray4 );
QRect labelRect( 0, 0, m_leftGraphMargin - 1, m_fontHeight + 2 );
lastStringEnds = m_eleGraphHeight + m_fontHeight;
-// painter->drawText( m_leftGraphMargin + 1, m_fontHeight, "[" + m_axisY.unit() + "]" );
+// painter->drawText(m_leftGraphMargin + 1, m_fontHeight, QLatin1Char('[') + m_axisY.unit() + QLatin1Char(']'));
foreach ( const AxisTick &tick, m_axisY.ticks() ) {
const int posY = m_eleGraphHeight - tick.position;
painter->setPen( dashedPen );
diff --git a/src/plugins/render/foursquare/FoursquareModel.cpp b/src/plugins/render/foursquare/FoursquareModel.cpp
index 97b4448..84af7d5 100644
--- a/src/plugins/render/foursquare/FoursquareModel.cpp
+++ b/src/plugins/render/foursquare/FoursquareModel.cpp
@@ -52,20 +52,20 @@ void FoursquareModel::getAdditionalItems( const GeoDataLatLonAltBox& box, qint32
qreal const area = distanceLon * distanceLat;
if ( area > 10 * 1000 * KM2METER * KM2METER ) {
// Large area (> 10.000 km^2) => too large for bbox queries
- apiUrl += "?ll=" + QString::number( box.center().latitude(Marble::GeoDataCoordinates::Degree) );
- apiUrl += ',' + QString::number( box.center().longitude(Marble::GeoDataCoordinates::Degree) );
- apiUrl += "&intent=checkin";
+ apiUrl += QLatin1String("?ll=") + QString::number(box.center().latitude(Marble::GeoDataCoordinates::Degree)) +
+ QLatin1Char(',') + QString::number(box.center().longitude(Marble::GeoDataCoordinates::Degree)) +
+ QLatin1String("&intent=checkin");
} else {
- apiUrl += "?ne=" + QString::number( box.north(Marble::GeoDataCoordinates::Degree) );
- apiUrl += ',' + QString::number( box.east(Marble::GeoDataCoordinates::Degree) );
- apiUrl += "&sw=" + QString::number( box.south(Marble::GeoDataCoordinates::Degree) );
- apiUrl += ',' + QString::number( box.west(Marble::GeoDataCoordinates::Degree) );
- apiUrl += "&intent=browse";
+ apiUrl += QLatin1String("?ne=") + QString::number(box.north(Marble::GeoDataCoordinates::Degree)) +
+ QLatin1Char(',') + QString::number(box.east(Marble::GeoDataCoordinates::Degree)) +
+ QLatin1String("&sw=") + QString::number(box.south(Marble::GeoDataCoordinates::Degree)) +
+ QLatin1Char(',') + QString::number(box.west(Marble::GeoDataCoordinates::Degree)) +
+ QLatin1String("&intent=browse");
}
- apiUrl += "&limit=" + QString::number( number );
- apiUrl += "&client_id=" + clientId;
- apiUrl += "&client_secret=" + clientSecret;
- apiUrl += "&v=20120601";
+ apiUrl += QLatin1String("&limit=") + QString::number(number) +
+ QLatin1String("&client_id=") + clientId +
+ QLatin1String("&client_secret=") + clientSecret +
+ QLatin1String("&v=20120601");
downloadDescriptionFile( QUrl( apiUrl ) );
}
@@ -99,11 +99,11 @@ void FoursquareModel::parseFile( const QByteArray& file )
QString largeIconUrl;
if ( categoryIcon.isValid() ) {
iconUrl = categoryIcon.property( "prefix" ).toString()
- + "32" // That's the icon size hardcoded
+ + QLatin1String("32") // That's the icon size hardcoded
+ categoryIcon.property( "name" ).toString();
largeIconUrl = categoryIcon.property( "prefix" ).toString()
- + "64" // Larger icon
+ + QLatin1String("64") // Larger icon
+ categoryIcon.property( "name" ).toString();
}
diff --git a/src/plugins/render/mapscale/MapScaleFloatItem.cpp b/src/plugins/render/mapscale/MapScaleFloatItem.cpp
index 6282d3b..b15f74a 100644
--- a/src/plugins/render/mapscale/MapScaleFloatItem.cpp
+++ b/src/plugins/render/mapscale/MapScaleFloatItem.cpp
@@ -204,7 +204,7 @@ void MapScaleFloatItem::paintContent( QPainter *painter )
}
iRatio *= power;
m_ratioString.setNum(iRatio);
- m_ratioString = m_ratioString = "1 : " + m_ratioString;
+ m_ratioString = QLatin1String("1 : ") + m_ratioString;
painter->setPen( QColor( Qt::darkGray ) );
painter->setBrush( QColor( Qt::darkGray ) );
@@ -282,8 +282,9 @@ void MapScaleFloatItem::paintContent( QPainter *painter )
painter->setFont( font() );
if ( j == 0 ) {
- painter->drawText( 0, fontHeight, "0 " + unit );
- lastStringEnds = QFontMetrics( font() ).width( "0 " + unit );
+ const QString text = QLatin1String("0 ") + unit;
+ painter->drawText(0, fontHeight, text);
+ lastStringEnds = QFontMetrics(font()).width(text);
continue;
}
diff --git a/src/plugins/render/measure/MeasureToolPlugin.cpp b/src/plugins/render/measure/MeasureToolPlugin.cpp
index 4ab8f45..e49cc5b 100644
--- a/src/plugins/render/measure/MeasureToolPlugin.cpp
+++ b/src/plugins/render/measure/MeasureToolPlugin.cpp
@@ -553,9 +553,9 @@ void MeasureToolPlugin::drawInfobox( GeoPainter *painter ) const
QString boxContent;
if (m_paintMode == Polygon) {
- boxContent += "<strong>" + tr("Polygon Ruler") + ":</strong><br/>\n";
+ boxContent += QLatin1String("<strong>") + tr("Polygon Ruler") + QLatin1String(":</strong><br/>\n");
} else /* Circular */ {
- boxContent += "<strong>" + tr("Circle Ruler") + ":</strong><br/>\n";
+ boxContent += QLatin1String("<strong>") + tr("Circle Ruler") + QLatin1String(":</strong><br/>\n");
}
if (m_paintMode == Polygon) {
boxContent += tr("Total Distance: %1<br/>\n").arg( meterToPreferredUnit(m_totalDistance) );
diff --git a/src/plugins/render/navigation/ArrowDiscWidget.cpp b/src/plugins/render/navigation/ArrowDiscWidget.cpp
index 7530711..476ff73 100644
--- a/src/plugins/render/navigation/ArrowDiscWidget.cpp
+++ b/src/plugins/render/navigation/ArrowDiscWidget.cpp
@@ -56,7 +56,7 @@ QPixmap ArrowDiscWidget::pixmap( const QString &id )
{
QPixmap result;
if ( !QPixmapCache::find( id, result ) ) {
- result = QPixmap( QString( ":/%1.png" ).arg( id ) );
+ result = QPixmap(QLatin1String(":/") + id + QLatin1String(".png"));
QPixmapCache::insert( id, result );
}
return result;
diff --git a/src/plugins/render/navigation/NavigationFloatItem.cpp b/src/plugins/render/navigation/NavigationFloatItem.cpp
index 1e0939e..9ca47f0 100644
--- a/src/plugins/render/navigation/NavigationFloatItem.cpp
+++ b/src/plugins/render/navigation/NavigationFloatItem.cpp
@@ -230,7 +230,7 @@ QPixmap NavigationFloatItem::pixmap( const QString &id )
{
QPixmap result;
if ( !QPixmapCache::find( id, result ) ) {
- result = QPixmap( QString( ":/%1.png" ).arg( id ) );
+ result = QPixmap(QLatin1String(":/") + id + QLatin1String(".png"));
QPixmapCache::insert( id, result );
}
return result;
diff --git a/src/plugins/render/navigation/NavigationSlider.cpp b/src/plugins/render/navigation/NavigationSlider.cpp
index e87930f..bea4af6 100644
--- a/src/plugins/render/navigation/NavigationSlider.cpp
+++ b/src/plugins/render/navigation/NavigationSlider.cpp
@@ -40,7 +40,7 @@ QPixmap NavigationSlider::pixmap( const QString &id )
{
QPixmap result;
if ( !QPixmapCache::find( id, result ) ) {
- result = QPixmap( QString( ":/%1.png" ).arg( id ) );
+ result = QPixmap(QLatin1String(":/") + id + QLatin1String(".png"));
QPixmapCache::insert( id, result );
}
return result;
diff --git a/src/plugins/render/opencaching/OpenCachingItem.cpp b/src/plugins/render/opencaching/OpenCachingItem.cpp
index ebb959a..72b5cca 100644
--- a/src/plugins/render/opencaching/OpenCachingItem.cpp
+++ b/src/plugins/render/opencaching/OpenCachingItem.cpp
@@ -30,7 +30,7 @@ OpenCachingItem::OpenCachingItem( const OpenCachingCache& cache, QObject *parent
setSize( QSize( m_cache.difficulty() * 10, m_cache.difficulty() * 10 ) );
s_font.setBold( true );
updateTooltip();
- setId( QString( "opencache-%1" ).arg( cache.id() ) );
+ setId(QLatin1String("opencache-") + cache.id());
setCoordinate( GeoDataCoordinates( cache.longitude(), cache.latitude(), 0.0, GeoDataCoordinates::Degree ) );
setTarget( "earth" );
connect( m_action, SIGNAL(triggered()),
@@ -94,7 +94,7 @@ QDialog *OpenCachingItem::infoDialog()
OpenCachingCacheLog log = m_cache.log();
if( log.size() > 0 ) {
m_ui->m_logText->setHtml( log[m_logIndex].text() );
- m_ui->m_logCount->setText( "1 / " + QString::number( log.size() ) );
+ m_ui->m_logCount->setText(QLatin1String("1 / ") + QString::number(log.size()));
connect( m_ui->m_nextButton, SIGNAL(clicked()),
this, SLOT(nextLogEntry()) );
connect( m_ui->m_previousButton, SIGNAL(clicked()),
@@ -176,17 +176,18 @@ void OpenCachingItem::paint( GeoPainter *painter, ViewportParams *viewport,
void OpenCachingItem::updateTooltip()
{
- QString html = "<table cellpadding=\"2\">";
+ QString html = QLatin1String("<table cellpadding=\"2\">");
if ( m_cache.id() != 0 ) {
- html += tr( "<tr><td align=\"right\">Cache name</td>" );
- html += "<td>" + m_cache.cacheName() + "</td></tr>";
- html += tr( "<tr><td align=\"right\">User name</td><td>" ) + m_cache.userName() + "</td></tr>";
+ html += tr("<tr><td align=\"right\">Cache name</td>") +
+ QLatin1String("<td>") + m_cache.cacheName() + QLatin1String("</td></tr>") +
+ tr("<tr><td align=\"right\">User name</td><td>") + m_cache.userName() + QLatin1String("</td></tr>");
if ( !m_cache.cacheName().isEmpty() ) {
- html += tr( "<tr><td align=\"right\">Date hidden</td><td>" ) + m_cache.dateHidden().toString( Qt::SystemLocaleShortDate ) + "</td></tr>";
+ html += tr("<tr><td align=\"right\">Date hidden</td><td>") + m_cache.dateHidden().toString(Qt::SystemLocaleShortDate) + QLatin1String("</td></tr>");
}
- html += tr( "<tr><td align=\"right\">Difficulty</td><td>" ) + QString::number( m_cache.difficulty() ) + "</td></tr>";
- html += tr( "<tr><td align=\"right\">Size</td><td>" ) + m_cache.sizeString() + "</td></tr>";
- html += "</table>";
+ html +=
+ tr("<tr><td align=\"right\">Difficulty</td><td>") + QString::number(m_cache.difficulty()) + QLatin1String("</td></tr>") +
+ tr("<tr><td align=\"right\">Size</td><td>") + m_cache.sizeString() + QLatin1String("</td></tr>") +
+ QLatin1String("</table>");
setToolTip( html );
}
}
@@ -194,9 +195,9 @@ void OpenCachingItem::updateTooltip()
void OpenCachingItem::updateDescriptionLanguage( const QString& language )
{
QHash<QString, OpenCachingCacheDescription> descriptions = m_cache.description();
- QString text = descriptions[language].shortDescription() + "\n\n" +
- descriptions[language].description() + "\n\n" +
- descriptions[language].hint() + "\n\n";
+ const QString text = descriptions[language].shortDescription() + QLatin1String("\n\n") +
+ descriptions[language].description() + QLatin1String("\n\n") +
+ descriptions[language].hint() + QLatin1String("\n\n");
m_ui->m_descriptionText->setHtml( text );
}
@@ -206,7 +207,7 @@ void OpenCachingItem::nextLogEntry()
if( m_logIndex + 1 < log.size() ) {
m_logIndex++;
m_ui->m_logText->setHtml( log[m_logIndex].text() );
- m_ui->m_logCount->setText( QString::number( m_logIndex + 1 ) + " / " + QString::number( log.size() ) );
+ m_ui->m_logCount->setText(QString::number(m_logIndex + 1) + QLatin1String(" / ") + QString::number(log.size()));
m_ui->m_previousButton->setEnabled( true );
if( m_logIndex == log.size() - 1 ) {
m_ui->m_nextButton->setEnabled( false );
@@ -220,7 +221,7 @@ void OpenCachingItem::previousLogEntry()
if( m_logIndex - 1 >= 0 ) {
m_logIndex--;
m_ui->m_logText->setHtml( log[m_logIndex].text() );
- m_ui->m_logCount->setText( QString::number( m_logIndex + 1 ) + " / " + QString::number( log.size() ) );
+ m_ui->m_logCount->setText(QString::number(m_logIndex + 1) + QLatin1String(" / ") + QString::number(log.size()));
m_ui->m_nextButton->setEnabled( true );
if( m_logIndex == 0 ) {
m_ui->m_previousButton->setEnabled( false );
diff --git a/src/plugins/render/opencaching/OpenCachingModel.cpp b/src/plugins/render/opencaching/OpenCachingModel.cpp
index c7b37cf..c9c357c 100644
--- a/src/plugins/render/opencaching/OpenCachingModel.cpp
+++ b/src/plugins/render/opencaching/OpenCachingModel.cpp
@@ -148,13 +148,13 @@ void OpenCachingModel::getAdditionalItems( const GeoDataLatLonAltBox& box, const
}
// http://www.opencaching.de/doc/xml/xml11.htm
- QString openCachingUrl( "http://www.opencaching.de/xml/ocxml11.php" );
- openCachingUrl += "?modifiedsince=" + m_startDate.toString( "yyyyMMddhhmmss" );
- openCachingUrl += "&cache=1&cachedesc=1&picture=0&cachelog=1&removedobject=0";
- openCachingUrl += "&lat=" + QString::number( box.center().latitude() * RAD2DEG );
- openCachingUrl += "&lon=" + QString::number( box.center().longitude() * RAD2DEG );
- openCachingUrl += "&distance=" + QString::number( m_maxDistance );
- openCachingUrl += "&charset=utf-8&cdata=0&session=0&zip=0";
+ const QString openCachingUrl(QLatin1String("http://www.opencaching.de/xml/ocxml11.php") +
+ QLatin1String("?modifiedsince=") + m_startDate.toString("yyyyMMddhhmmss") +
+ QLatin1String("&cache=1&cachedesc=1&picture=0&cachelog=1&removedobject=0") +
+ QLatin1String("&lat=") + QString::number(box.center().latitude() * RAD2DEG) +
+ QLatin1String("&lon=") + QString::number(box.center().longitude() * RAD2DEG) +
+ QLatin1String("&distance=") + QString::number(m_maxDistance) +
+ QLatin1String("&charset=utf-8&cdata=0&session=0&zip=0"));
downloadDescriptionFile( QUrl( openCachingUrl ) );
}
diff --git a/src/plugins/render/opencachingcom/OpenCachingComItem.cpp b/src/plugins/render/opencachingcom/OpenCachingComItem.cpp
index afadc34..526fe36 100644
--- a/src/plugins/render/opencachingcom/OpenCachingComItem.cpp
+++ b/src/plugins/render/opencachingcom/OpenCachingComItem.cpp
@@ -84,24 +84,24 @@ void OpenCachingComItem::showInfoDialog()
dialog.setWindowTitle( tr("Cache Details for %1").arg(id() ));
- m_ui->labelIcon->setPixmap(QPixmap(":/" + iconName() + ".png"));
- m_ui->labelHeader->setText(QString("<big><strong>" + m_cache["name"].toString() + "</strong></big>"));
+ m_ui->labelIcon->setPixmap(QPixmap(QLatin1String(":/") + iconName() + QLatin1String(".png")));
+ m_ui->labelHeader->setText(QLatin1String("<big><strong>") + m_cache["name"].toString() + QLatin1String("</strong></big>"));
m_ui->buttonWww->setIcon(QIcon(QStringLiteral(":/internet.png")));
m_ui->buttonWww->setToolTip( tr("Click to open this cache's page in a browser") );
connect( m_ui->buttonWww, SIGNAL(clicked()), SLOT(openWww()) );
// basic details
- QString details = "<table><tr><td colspan=\"2\" valign=\"middle\">"
- + tr(m_cache["type"].toString().toUtf8().constData())
- + "<br/>" + id() + "<br/>" + coordinate().toString() + "</td></tr>"
- + "<tr><td align=\"right\">" + tr("Size:") + " </td><td>" + ratingNumberString(m_cache["size"]) + "</td></tr>"
- + "<tr><td align=\"right\">" + tr("Difficulty:") + " </td><td>" + ratingNumberString(m_cache["difficulty"]) + "</td></tr>"
- + "<tr><td align=\"right\">" + tr("Terrain:") + " </td><td>" + ratingNumberString(m_cache["terrain"]) + "</td></tr>"
- + "<tr><td align=\"right\">" + tr("Awsomeness:") + " </td><td>" + ratingNumberString(m_cache["awsomeness"]) + "</td></tr>"
- + "<tr><td align=\"right\">" + tr("Hidden by:") + " </td><td>" + m_cache["hidden_by"].toMap()["name"].toString() + "</td></tr>"
- + "<tr><td align=\"right\">" + tr("Hidden:") + " </td><td>" + dateString(m_cache["hidden"]) + "</td></tr>"
- + "<tr><td align=\"right\">" + tr("Last found:") + " </td><td>" + dateString(m_cache["last_found"]) + "</td></tr>";
+ QString details = QLatin1String("<table><tr><td colspan=\"2\" valign=\"middle\">") +
+ tr(m_cache["type"].toString().toUtf8().constData()) +
+ QLatin1String("<br/>") + id() + QLatin1String("<br/>") + coordinate().toString() + QLatin1String("</td></tr>"
+ "<tr><td align=\"right\">") + tr("Size:") + QLatin1String(" </td><td>") + ratingNumberString(m_cache["size"]) + QLatin1String("</td></tr>"
+ "<tr><td align=\"right\">") + tr("Difficulty:") + QLatin1String(" </td><td>") + ratingNumberString(m_cache["difficulty"]) + QLatin1String("</td></tr>"
+ "<tr><td align=\"right\">") + tr("Terrain:") + QLatin1String(" </td><td>") + ratingNumberString(m_cache["terrain"]) + QLatin1String("</td></tr>"
+ "<tr><td align=\"right\">") + tr("Awsomeness:") + QLatin1String(" </td><td>") + ratingNumberString(m_cache["awsomeness"]) + QLatin1String("</td></tr>"
+ "<tr><td align=\"right\">") + tr("Hidden by:") + QLatin1String(" </td><td>") + m_cache["hidden_by"].toMap()["name"].toString() + QLatin1String("</td></tr>"
+ "<tr><td align=\"right\">") + tr("Hidden:") + QLatin1String(" </td><td>") + dateString(m_cache["hidden"]) + QLatin1String("</td></tr>"
+ "<tr><td align=\"right\">") + tr("Last found:") + QLatin1String(" </td><td>") + dateString(m_cache["last_found"]) + QLatin1String("</td></tr>");
// list of tags
// ### cache the translated cache string. Necessary??
@@ -113,7 +113,7 @@ void OpenCachingComItem::showInfoDialog()
{
if (i)
{
- strTags += ", ";
+ strTags += QLatin1String(", ");
}
strTags += tr(tags[i].toUtf8().constData());
}
@@ -122,14 +122,14 @@ void OpenCachingComItem::showInfoDialog()
QString strTags = m_cache["strTags"].toString();
if (!strTags.isEmpty())
{
- details += "<tr><td align=\"right\">" + tr("Tags:") + " </td><td>" + strTags + "</td></tr>";
+ details += QLatin1String("<tr><td align=\"right\">") + tr("Tags:") + QLatin1String(" </td><td>") + strTags + QLatin1String("</td></tr>");
}
// "series" - name of a series that this cache belongs to
QString series = m_cache["series"].toString();
if (!series.isEmpty())
{
- details += "<tr><td align=\"right\">" + tr("Series:") + " </td><td>" + series + "</td></tr>";
+ details += QLatin1String("<tr><td align=\"right\">") + tr("Series:") + QLatin1String(" </td><td>") + series + QLatin1String("</td></tr>");
}
// verification options translated
@@ -147,7 +147,7 @@ void OpenCachingComItem::showInfoDialog()
if (verifyOpts["code_phrase"].isValid())
verifyOptsStrings << tr("code phrase");
- details += "<tr><td align=\"right\">" + tr("Verification:") + " </td><td>" + verifyOptsStrings.join(", ") + "</td></tr>";
+ details += QLatin1String("<tr><td align=\"right\">") + tr("Verification:") + QLatin1String(" </td><td>") + verifyOptsStrings.join(QStringLiteral(", ")) + QLatin1String("</td></tr>");
}
// show a distance to the cache, either from current position if we know,
@@ -160,7 +160,7 @@ void OpenCachingComItem::showInfoDialog()
if (location.isValid())
{
QString dist = formatDistance( distanceSphere(location, coordinate()) );
- details += "<tr><td align=\"right\">" + tr("Distance:") + " </td><td>" + dist + "</td></tr>";
+ details += QLatin1String("<tr><td align=\"right\">") + tr("Distance:") + QLatin1String(" </td><td>") + dist + QLatin1String("</td></tr>");
hasposition = true;
}
}
@@ -170,7 +170,7 @@ void OpenCachingComItem::showInfoDialog()
if ( homelocation.isValid() )
{
QString dist = formatDistance( distanceSphere(homelocation, coordinate()) );
- details += "<tr><td align=\"right\">" + tr("Distance from home:") + " </td><td>" + dist + "</td></tr>";
+ details += QLatin1String("<tr><td align=\"right\">") + tr("Distance from home:") + QLatin1String(" </td><td>") + dist + QLatin1String("</td></tr>");
}
}
@@ -185,11 +185,11 @@ void OpenCachingComItem::showInfoDialog()
QString tagiconshtml;
for (int i=0; i<numtags;i++)
{
- tagiconshtml += QString("<img src=\":/%1.png\" alt=\"%2\">")
+ tagiconshtml += QStringLiteral("<img src=\":/%1.png\" alt=\"%2\">")
.arg(tags.at(i).toLower().replace(QLatin1Char(' '),QLatin1Char('-'))).arg(tags.at(i));
if (0 == (i+1)%tagrows)
{
- tagiconshtml += "<br/>";
+ tagiconshtml += QLatin1String("<br/>");
}
}
ui.labelTagIcons->setText(tagiconshtml);
@@ -199,7 +199,7 @@ void OpenCachingComItem::showInfoDialog()
QString description = m_cache["description"].toString();
if ( description.isEmpty() )
{
- QUrl url("http://www.opencaching.com/api/geocache/" + id() + "?Authorization=" + AUTHKEY);
+ const QUrl url(QLatin1String("http://www.opencaching.com/api/geocache/") + id() + QLatin1String("?Authorization=") + AUTHKEY);
m_model->fetchData( url, "description_and_logs", this );
} else {
fillDialogTabs();
@@ -216,7 +216,7 @@ void OpenCachingComItem::showInfoDialog()
void OpenCachingComItem::paint( QPainter *painter )
{
- QPixmap pm(":/" + iconName() + "-m.png");
+ QPixmap pm(QLatin1String(":/") + iconName() + QLatin1String("-m.png"));
painter->drawPixmap( 0, 0, pm );
}
@@ -247,22 +247,22 @@ void OpenCachingComItem::updateTooltip()
// }
// }
- QString html = "<table cellpadding=\"2\">";
- html += "<tr><td colspan=\"2\"><table cellpadding=\"3\"><tr><td><img src=\":/" + iconName() + "\"></td>"
- + "<td valign=\"middle\"><big><strong>" + m_cache["name"].toString() + "</strong></big></td></tr></table></td></tr>"
- + "<tr><td align=\"left\">"
- + tr(m_cache["type"].toString().toUtf8().constData())
- + "<br/>" + tr( "by <em>" ) + m_cache["hidden_by"].toMap()["name"].toString() + "</em>"
- + "<br/>" + coordinate().lonToString()
- + "<br/>" + coordinate().latToString()
- + "</td><td align=\"right\">"
- + tr( "Difficulty") + ": <span style=\"background:#1e4381;color:white;\">&nbsp;" + ratingNumberString(m_cache["difficulty"]) + "&nbsp;</span>"
- + "<br/>" + tr( "Terrain" ) + ": <span style=\"background:#dda24d;color:white;\">&nbsp;" + ratingNumberString(m_cache["terrain"]) + "&nbsp;</span>"
- + "<br/>" + tr( "Awsomeness" ) + ": <span style=\"background:#e27c31;color:white;\">&nbsp;" + ratingNumberString(m_cache["awsomeness"]) + "&nbsp;</span>"
- + "<br/>" + tr( "Size" ) + ": <span style=\"background:#807f39;color:white;\">&nbsp;" + ratingNumberString(m_cache["size"]) + "&nbsp;</span></td></tr>"
- + "<tr><td colspan=\"2\">" + tr("Last found: ") + dateString(m_cache["last_found"]) + "</td></tr>"
+ const QString html = QLatin1String("<table cellpadding=\"2\">"
+ "<tr><td colspan=\"2\"><table cellpadding=\"3\"><tr><td><img src=\":/") + iconName() + QLatin1String("\"></td>"
+ "<td valign=\"middle\"><big><strong>") + m_cache["name"].toString() + QLatin1String("</strong></big></td></tr></table></td></tr>"
+ "<tr><td align=\"left\">") +
+ tr(m_cache["type"].toString().toUtf8().constData()) +
+ QLatin1String("<br/>") + tr("by <em>") + m_cache["hidden_by"].toMap()["name"].toString() + QLatin1String("</em>"
+ "<br/>") + coordinate().lonToString() +
+ QLatin1String("<br/>") + coordinate().latToString() +
+ QLatin1String("</td><td align=\"right\">") +
+ tr( "Difficulty") + QLatin1String(": <span style=\"background:#1e4381;color:white;\">&nbsp;") + ratingNumberString(m_cache["difficulty"]) + QLatin1String("&nbsp;</span>"
+ "<br/>") + tr("Terrain") + QLatin1String(": <span style=\"background:#dda24d;color:white;\">&nbsp;") + ratingNumberString(m_cache["terrain"]) + QLatin1String("&nbsp;</span>"
+ "<br/>") + tr("Awsomeness") + QLatin1String(": <span style=\"background:#e27c31;color:white;\">&nbsp;") + ratingNumberString(m_cache["awsomeness"]) + QLatin1String("&nbsp;</span>"
+ "<br/>") + tr("Size") + QLatin1String(": <span style=\"background:#807f39;color:white;\">&nbsp;") + ratingNumberString(m_cache["size"]) + QLatin1String("&nbsp;</span></td></tr>"
+ "<tr><td colspan=\"2\">") + tr("Last found: ") + dateString(m_cache["last_found"]) + QLatin1String("</td></tr>"
// + "<tr><td colspan=\"2\">" + strDist + "</td></tr>"
- + "</table>";
+ "</table>");
setToolTip( html );
}
}
@@ -294,7 +294,7 @@ void OpenCachingComItem::addDownloadedFile( const QString &url, const QString &t
QVariantList images = m_cache["images"].toList();
for (int i = 0; i < images.size(); i++) {
QVariantMap image = images.at(i).toMap();
- QString url = "http://www.opencaching.com/api/geocache/" + id() + "/" + image["caption"].toString();
+ const QString url = QLatin1String("http://www.opencaching.com/api/geocache/") + id() + QLatin1Char('/') + image["caption"].toString();
// qDebug()<<"Adding image: "<<url;
m_images << url;
}
@@ -368,10 +368,10 @@ void OpenCachingComItem::fillDialogTabs()
if (m_images.size() > i)
{
// ### what about spoiler images? (don't display, but then what?)
- html.append(
- "<p><img src=\"" + m_images.at(i) + "\" width=\"100%\" height=\"auto\"/><br/>"
- + m_cache["images"].toList().at(i).toMap()["name"].toString()
- + "</p>");
+ html +=
+ QLatin1String("<p><img src=\"") + m_images.at(i) + QLatin1String("\" width=\"100%\" height=\"auto\"/><br/>") +
+ m_cache["images"].toList().at(i).toMap()["name"].toString() +
+ QLatin1String("</p>");
}
}
@@ -391,12 +391,13 @@ void OpenCachingComItem::fillDialogTabs()
QVariantMap log = logs.at(i).toMap();
if ( i )
{
- logtext += "<hr>";
+ logtext += QLatin1String("<hr>");
}
- logtext += tr("User: ") + log["user"].toMap()["name"].toString() + "<br/>";
- logtext += tr("Type: ") + log["type"].toString() + "<br/>";
- logtext += tr("Date: ") + dateString(log["log_time"]) + "<br/><br/>";
- logtext += log["comment"].toString() + "<br/>";
+ logtext +=
+ tr("User: ") + log["user"].toMap()["name"].toString() + QLatin1String("<br/>") +
+ tr("Type: ") + log["type"].toString() + QLatin1String("<br/>") +
+ tr("Date: ") + dateString(log["log_time"]) + QLatin1String("<br/><br/>") +
+ log["comment"].toString() + QLatin1String("<br/>");
// TODO images
}
@@ -406,7 +407,7 @@ void OpenCachingComItem::fillDialogTabs()
void OpenCachingComItem::openWww()
{
- QDesktopServices::openUrl( QUrl( "http://www.opencaching.com/#!geocache/" + m_cache["oxcode"].toString() ) );
+ QDesktopServices::openUrl(QUrl(QLatin1String("http://www.opencaching.com/#!geocache/") + m_cache[QStringLiteral("oxcode")].toString()));
}
} // namespace Marble
diff --git a/src/plugins/render/opencachingcom/OpenCachingComModel.cpp b/src/plugins/render/opencachingcom/OpenCachingComModel.cpp
index 55a2129..94756c5 100644
--- a/src/plugins/render/opencachingcom/OpenCachingComModel.cpp
+++ b/src/plugins/render/opencachingcom/OpenCachingComModel.cpp
@@ -78,7 +78,7 @@ void OpenCachingComModel::getAdditionalItems( const GeoDataLatLonAltBox& box, qi
.arg( m_previousbox.north(GeoDataCoordinates::Degree ) )
.arg( m_previousbox.east(GeoDataCoordinates::Degree ) );
}
- url += "&limit=" + QString::number( number );
+ url += QLatin1String("&limit=") + QString::number(number);
// TODO Limit to user set tags/types/difficulty - when there is a config dialog...
m_previousbox = box;
diff --git a/src/plugins/render/opendesktop/OpenDesktopItem.cpp b/src/plugins/render/opendesktop/OpenDesktopItem.cpp
index 203186d..4d975c2 100644
--- a/src/plugins/render/opendesktop/OpenDesktopItem.cpp
+++ b/src/plugins/render/opendesktop/OpenDesktopItem.cpp
@@ -70,17 +70,17 @@ void OpenDesktopItem::paint( QPainter *painter )
void OpenDesktopItem::updateToolTip()
{
- QString toolTip;
- toolTip += "<html><head><meta name='qrichtext' content='1' />";
- toolTip += "<style type='text/css'>";
- toolTip += "body { font-family:'Sans Serif'; font-size:9pt; font-weight:400; }";
- toolTip += "np, li { white-space: pre-wrap; }";
- toolTip += "p { margin: 0; -qt-block-indent:0; text-indent:0px }";
- toolTip += "</style></head><body><table>";
- toolTip += "<tr><td align='right'>Fullname:</td><td>%1</td></tr>";
- toolTip += "<tr><td align='right'>Location:</td><td>%2</td></tr>";
- toolTip += "<tr><td align='right'>Role:</td><td>%3</td></tr>";
- toolTip += "</table></body></html>";
+ const QString toolTip = QLatin1String(
+ "<html><head><meta name='qrichtext' content='1' />"
+ "<style type='text/css'>"
+ "body { font-family:'Sans Serif'; font-size:9pt; font-weight:400; }"
+ "np, li { white-space: pre-wrap; }"
+ "p { margin: 0; -qt-block-indent:0; text-indent:0px }"
+ "</style></head><body><table>"
+ "<tr><td align='right'>Fullname:</td><td>%1</td></tr>"
+ "<tr><td align='right'>Location:</td><td>%2</td></tr>"
+ "<tr><td align='right'>Role:</td><td>%3</td></tr>"
+ "</table></body></html>");
setToolTip( toolTip.arg( fullName() ).arg( location() ).arg( role() ) );
}
diff --git a/src/plugins/render/opendesktop/OpenDesktopModel.cpp b/src/plugins/render/opendesktop/OpenDesktopModel.cpp
index 19e5a55..ab25ee6 100644
--- a/src/plugins/render/opendesktop/OpenDesktopModel.cpp
+++ b/src/plugins/render/opendesktop/OpenDesktopModel.cpp
@@ -49,11 +49,11 @@ void OpenDesktopModel::getAdditionalItems( const GeoDataLatLonAltBox& box, qint3
}
GeoDataCoordinates coords = box.center();
-
- QString openDesktopUrl( "http://api.opendesktop.org/v1/person/data" );
- openDesktopUrl += "?latitude=" + QString::number(coords.latitude() * RAD2DEG);
- openDesktopUrl += "&longitude=" + QString::number(coords.longitude() * RAD2DEG);
- openDesktopUrl += "&format=json";
+
+ const QString openDesktopUrl(QLatin1String("http://api.opendesktop.org/v1/person/data") +
+ QLatin1String("?latitude=") + QString::number(coords.latitude() * RAD2DEG) +
+ QLatin1String("&longitude=") + QString::number(coords.longitude() * RAD2DEG) +
+ QLatin1String("&format=json"));
downloadDescriptionFile( QUrl( openDesktopUrl ) );
}
@@ -92,8 +92,8 @@ void OpenDesktopModel::parseFile( const QByteArray& file )
item->setMarbleWidget(m_marbleWidget);
item->setId( personid );
item->setCoordinate( coor );
- item->setFullName( QString( "%1 %2" ).arg( firstName ).arg( lastName ) );
- item->setLocation( QString( "%1, %2" ).arg( city ).arg( country ) );
+ item->setFullName(firstName + QLatin1Char(' ') + lastName);
+ item->setLocation(city + QLatin1String(", ") + country);
item->setRole( !role.isEmpty() ? role : QString( "nothing" ) );
downloadItem( avatarUrl, "avatar", item );
items << item;
diff --git a/src/plugins/render/overviewmap/OverviewMap.cpp b/src/plugins/render/overviewmap/OverviewMap.cpp
index 11e2353..6a102a1 100644
--- a/src/plugins/render/overviewmap/OverviewMap.cpp
+++ b/src/plugins/render/overviewmap/OverviewMap.cpp
@@ -319,7 +319,7 @@ void OverviewMap::setSettings( const QHash<QString,QVariant> &settings )
m_settings.insert( "height", settings.value( "height", m_defaultSize.toSize().height() ) );
foreach ( const QString& planet, PlanetFactory::planetList() ) {
- QString mapFile = MarbleDirs::path( QString( "svg/%1map.svg" ).arg( planet ) );
+ QString mapFile = MarbleDirs::path(QLatin1String("svg/") + planet + QLatin1String("map.svg"));
if (planet == QLatin1String("moon")) {
mapFile = MarbleDirs::path( "svg/lunarmap.svg" );
@@ -328,7 +328,8 @@ void OverviewMap::setSettings( const QHash<QString,QVariant> &settings )
mapFile = MarbleDirs::path( "svg/worldmap.svg" );
}
- m_settings.insert( "path_" + planet, settings.value( "path_" + planet, mapFile ) );
+ const QString id = QLatin1String("path_") + planet;
+ m_settings.insert(id, settings.value(id, mapFile));
}
m_settings.insert( "posColor", settings.value( "posColor", QColor( Qt::white ).name() ) );
@@ -363,7 +364,7 @@ void OverviewMap::writeSettings()
QStringList const planets = PlanetFactory::planetList();
foreach( const QString &planet, planets ) {
- m_settings.insert( "path_" + planet, m_svgPaths[planet] );
+ m_settings.insert(QLatin1String("path_") + planet, m_svgPaths[planet]);
}
m_settings.insert( "posColor", m_posColor.name() );
@@ -375,7 +376,7 @@ void OverviewMap::updateSettings()
{
QStringList const planets = PlanetFactory::planetList();
foreach( const QString &planet, planets ) {
- m_svgPaths.insert( planet, m_settings.value( "path_" + planet, QString() ).toString() );
+ m_svgPaths.insert(planet, m_settings.value(QLatin1String("path_") + planet, QString()).toString());
}
m_posColor = QColor( m_settings.value( "posColor" ).toString() );
diff --git a/src/plugins/render/panoramio/PanoramioModel.cpp b/src/plugins/render/panoramio/PanoramioModel.cpp
index 4d1ac78..a07c27b 100644
--- a/src/plugins/render/panoramio/PanoramioModel.cpp
+++ b/src/plugins/render/panoramio/PanoramioModel.cpp
@@ -43,17 +43,17 @@ void PanoramioModel::getAdditionalItems( const GeoDataLatLonAltBox &box, qint32
// FIXME: Download a list of constant number, because the parser doesn't support
// loading a file of an unknown length.
- QUrl jsonUrl( "http://www.panoramio.com/map/get_panoramas.php?from="
- + QString::number( 0 )
- + "&order=upload_date"
- + "&set=public"
- + "&to=" + QString::number( number )
-// + "&to=" + QString::number( number )
- + "&minx=" + QString::number( box.west() * RAD2DEG )
- + "&miny=" + QString::number( box.south() * RAD2DEG )
- + "&maxx=" + QString::number( box.east() * RAD2DEG )
- + "&maxy=" + QString::number( box.north() * RAD2DEG )
- + "&size=small");
+ const QUrl jsonUrl(QLatin1String("http://www.panoramio.com/map/get_panoramas.php?from=")
+ + QString::number(0)
+ + QLatin1String("&order=upload_date")
+ + QLatin1String("&set=public")
+ + QLatin1String("&to=") + QString::number(number)
+// + QLatin1String("&to=") + QString::number( number )
+ + QLatin1String("&minx=") + QString::number(box.west() * RAD2DEG)
+ + QLatin1String("&miny=") + QString::number(box.south() * RAD2DEG)
+ + QLatin1String("&maxx=") + QString::number(box.east() * RAD2DEG)
+ + QLatin1String("&maxy=") + QString::number(box.north() * RAD2DEG)
+ + QLatin1String("&size=small"));
downloadDescriptionFile( jsonUrl );
}
diff --git a/src/plugins/render/panoramio/PanoramioParser.cpp b/src/plugins/render/panoramio/PanoramioParser.cpp
index 7b0f218..8d153c2 100644
--- a/src/plugins/render/panoramio/PanoramioParser.cpp
+++ b/src/plugins/render/panoramio/PanoramioParser.cpp
@@ -26,7 +26,7 @@ PanoramioParser::~PanoramioParser()
panoramioDataStructure PanoramioParser::parseObjectOnPosition(const QString &content, int requiredObjectPosition)
{
- QString temp = "var myJSONObject =" + content;
+ QString temp = QLatin1String("var myJSONObject =") + content;
myEngine.evaluate(temp);
myEngine.evaluate(QString("function count(){ return myJSONObject.count };"));
myEngine.evaluate(QString("function height(x){return myJSONObject.photos[x].height};"));
diff --git a/src/plugins/render/photo/PhotoPluginItem.cpp b/src/plugins/render/photo/PhotoPluginItem.cpp
index 3b69e7b..bdcce8a 100644
--- a/src/plugins/render/photo/PhotoPluginItem.cpp
+++ b/src/plugins/render/photo/PhotoPluginItem.cpp
@@ -187,8 +187,7 @@ void PhotoPluginItem::openBrowser()
PopupLayer* popup = m_marbleWidget->popupLayer();
popup->setCoordinates( coordinate(), Qt::AlignRight | Qt::AlignVCenter );
popup->setSize( QSizeF( 700, 450 ) );
- popup->setUrl( QUrl( QString( "http://m.flickr.com/photos/%1/%2/" )
- .arg( owner() ).arg( id() ) ) );
+ popup->setUrl(QUrl(QLatin1String("http://m.flickr.com/photos/") + owner() + QLatin1Char('/') + id() + QLatin1Char('/')));
popup->popup();
} else {
if( !m_browser ) {
diff --git a/src/plugins/render/photo/PhotoPluginModel.cpp b/src/plugins/render/photo/PhotoPluginModel.cpp
index f4506b8..642054d 100644
--- a/src/plugins/render/photo/PhotoPluginModel.cpp
+++ b/src/plugins/render/photo/PhotoPluginModel.cpp
@@ -46,16 +46,14 @@ QUrl PhotoPluginModel::generateUrl( const QString& service,
QString url;
if (service == QLatin1String("flickr"))
- url += "https://www.flickr.com/services/rest/";
+ url += QLatin1String("https://www.flickr.com/services/rest/");
else
return QUrl();
-
- url += "?method=";
- url += method;
- url += "&format=rest";
- url += "&api_key=";
- url += flickrApiKey;
-
+
+ url += QLatin1String("?method=") + method +
+ QLatin1String("&format=rest") +
+ QLatin1String("&api_key=") + flickrApiKey;
+
QHash<QString,QString>::const_iterator it = options.constBegin();
QHash<QString,QString>::const_iterator const end = options.constEnd();
for (; it != end; ++it ) {
diff --git a/src/plugins/render/postalcode/PostalCodeModel.cpp b/src/plugins/render/postalcode/PostalCodeModel.cpp
index 49d11b0..7edfbac 100644
--- a/src/plugins/render/postalcode/PostalCodeModel.cpp
+++ b/src/plugins/render/postalcode/PostalCodeModel.cpp
@@ -90,7 +90,7 @@ void PostalCodeModel::parseFile( const QByteArray& file )
double const longitude = iterator.value().property( "lng" ).toNumber();
double const latitude = iterator.value().property( "lat" ).toNumber();
- QString const id = "postalCode_" + countryCode + postalCode;
+ QString const id = QLatin1String("postalCode_") + countryCode + postalCode;
if ( !id.isEmpty() ) {
QString tooltip;
diff --git a/src/plugins/render/routing/RoutingPlugin.cpp b/src/plugins/render/routing/RoutingPlugin.cpp
index 12a2c4a..526feac 100644
--- a/src/plugins/render/routing/RoutingPlugin.cpp
+++ b/src/plugins/render/routing/RoutingPlugin.cpp
@@ -114,7 +114,7 @@ RoutingPluginPrivate::RoutingPluginPrivate( RoutingPlugin *parent ) :
QString RoutingPluginPrivate::richText( const QString &source )
{
- return QString( "<font size=\"+1\" color=\"black\">%1</font>" ).arg( source );
+ return QLatin1String("<font size=\"+1\" color=\"black\">") + source + QLatin1String("</font>");
}
QString RoutingPluginPrivate::fuzzyDistance( qreal length )
diff --git a/src/plugins/render/satellites/TrackerPluginModel.cpp b/src/plugins/render/satellites/TrackerPluginModel.cpp
index 828e4a8..b74f3e5 100644
--- a/src/plugins/render/satellites/TrackerPluginModel.cpp
+++ b/src/plugins/render/satellites/TrackerPluginModel.cpp
@@ -31,7 +31,7 @@ public:
m_enabled( false ),
m_treeModel( treeModel ),
m_document( new GeoDataDocument() ),
- m_storagePolicy( MarbleDirs::localPath() + "/cache/" ),
+ m_storagePolicy(MarbleDirs::localPath() + QLatin1String("/cache/")),
m_downloadManager( 0 )
{
}
diff --git a/src/plugins/render/twitter/jsonparser.cpp b/src/plugins/render/twitter/jsonparser.cpp
index 7dcf67b..327b661 100644
--- a/src/plugins/render/twitter/jsonparser.cpp
+++ b/src/plugins/render/twitter/jsonparser.cpp
@@ -26,7 +26,7 @@ twitterDataStructure jsonParser::parseObjectOnPosition(const QString &content ,
QList <twitterDataStructure> jsonParser::parseAllObjects(const QString &content , int numberOfObjects)
{
- QString temp = "var myJSONObject = { \"twitter\":" + content + "}";
+ QString temp = QLatin1String("var myJSONObject = { \"twitter\":") + content + QLatin1Char('}');
int iterator = 0;//the count starts fom one
if (temp != QLatin1String("Twitter is down for database maintenance. It will return in about 30 minutes"))
{
@@ -61,7 +61,7 @@ QList <twitterDataStructure> jsonParser::parseAllObjects(const QString &content
googleMapDataStructure jsonParser::geoCodingAPIparseObject(QString content)
{
mDebug() << "in geoCodingAPIparseObject";
- QString temp = "var myJSONObject = " + content;
+ QString temp = QLatin1String("var myJSONObject = ") + content;
googleMapDataStructure returnStructure;
myEngine.evaluate("function lat(){return myJSONObject.Placemark[0].Point.coordinates[0]}");
diff --git a/src/plugins/render/twitter/twitterPlugin.cpp b/src/plugins/render/twitter/twitterPlugin.cpp
index 94e97ff..22f5e96 100644
--- a/src/plugins/render/twitter/twitterPlugin.cpp
+++ b/src/plugins/render/twitter/twitterPlugin.cpp
@@ -69,7 +69,7 @@ QIcon twitterPlugin::icon() const
void twitterPlugin::initialize()
{
privateFlagForRenderingTwitts = 0;
- m_storagePolicy = new CacheStoragePolicy(MarbleDirs::localPath() + "/cache/");
+ m_storagePolicy = new CacheStoragePolicy(MarbleDirs::localPath() + QLatin1String("/cache/"));
m_downloadManager = new HttpDownloadManager(QUrl("http://twiter.com"), m_storagePolicy);
downloadtwitter(0, 0, 0.0, 0.0, 0.0, 0.0);
mDebug() << "twitter plugin was started";
@@ -94,7 +94,7 @@ bool twitterPlugin::render(GeoPainter *painter, ViewportParams *viewport,
//painter->drawAnnotation(GeoDataCoordinates(0.0,0.0),"hiiiiiiiiii");
painter->drawAnnotation(twitsWithLocation[counter].location,
- parsedData[counter].user + " said \n"
+ parsedData[counter].user + QLatin1String(" said \n")
+ parsedData[counter].text,
QSize(140, 140)) ;
} else {
@@ -139,7 +139,7 @@ mDebug()<<"::::::downloading"<<rangeFrom ;
void twitterPlugin::findLatLonOfStreetAddress(QString streetAddress)
{
- m_downloadManager->addJob("http://maps.google.com/maps/geo?q=" + streetAddress + "&output=json&key=ABQIAAAASD_v8YRzG0tBD18730KjmRTxoHoIpYL45xcSRJH0O7cH64DuXRT7rQeRcgCLAhjkteQ8vkWAATM_JQ", streetAddress, streetAddress);
+ m_downloadManager->addJob(QLatin1String("http://maps.google.com/maps/geo?q=") + streetAddress + QLatin1String("&output=json&key=ABQIAAAASD_v8YRzG0tBD18730KjmRTxoHoIpYL45xcSRJH0O7cH64DuXRT7rQeRcgCLAhjkteQ8vkWAATM_JQ"), streetAddress, streetAddress);
mDebug() << "twitter added Geo Coding job for " << streetAddress;
}
diff --git a/src/plugins/render/weather/BBCWeatherItem.cpp b/src/plugins/render/weather/BBCWeatherItem.cpp
index 0f0759e..e89e157 100644
--- a/src/plugins/render/weather/BBCWeatherItem.cpp
+++ b/src/plugins/render/weather/BBCWeatherItem.cpp
@@ -70,7 +70,7 @@ quint32 BBCWeatherItem::bbcId() const
void BBCWeatherItem::setBbcId( quint32 id )
{
m_bbcId = id;
- setId( QString( "bbc" ) + QString::number( id ) );
+ setId(QLatin1String("bbc") + QString::number(id));
}
QUrl BBCWeatherItem::observationUrl() const
diff --git a/src/plugins/render/weather/GeoNamesWeatherService.cpp b/src/plugins/render/weather/GeoNamesWeatherService.cpp
index 1d66c00..19f6356 100644
--- a/src/plugins/render/weather/GeoNamesWeatherService.cpp
+++ b/src/plugins/render/weather/GeoNamesWeatherService.cpp
@@ -169,7 +169,7 @@ AbstractDataPluginItem *GeoNamesWeatherService::parse( const QScriptValue &value
data.setPublishingTime( date );
// ID
- id = "geonames_" + id;
+ id = QLatin1String("geonames_") + id;
GeoDataCoordinates coordinates( longitude, latitude, 0.0, GeoDataCoordinates::Degree );
GeoNamesWeatherItem *item = new GeoNamesWeatherItem( this );
diff --git a/src/plugins/render/weather/WeatherData.cpp b/src/plugins/render/weather/WeatherData.cpp
index ccab5e4..2ccfd4e 100644
--- a/src/plugins/render/weather/WeatherData.cpp
+++ b/src/plugins/render/weather/WeatherData.cpp
@@ -209,7 +209,7 @@ class WeatherDataPrivate
QString string = locale.toString( floor( fromKelvin( temp, format ) + 0.5 ) );
switch ( format ) {
case WeatherData::Kelvin:
- string += " K";
+ string += QLatin1String(" K");
break;
case WeatherData::Celsius:
string += QString::fromUtf8("°C");
diff --git a/src/plugins/render/weather/WeatherItem.cpp b/src/plugins/render/weather/WeatherItem.cpp
index c66bdff..e671564 100644
--- a/src/plugins/render/weather/WeatherItem.cpp
+++ b/src/plugins/render/weather/WeatherItem.cpp
@@ -502,7 +502,7 @@ QString WeatherItem::createFromTemplate(const QString &templateHtml)
if (!d->m_currentWeather.iconSource().isEmpty()) {
html.replace("%weather_situation%",
- "<img src=\"file://"+d->m_currentWeather.iconSource()+"\" />");
+ QLatin1String("<img src=\"file://") + d->m_currentWeather.iconSource() + QLatin1String("\" />"));
} else {
html.remove("%weather_situation%");
}
diff --git a/src/plugins/render/wikipedia/WikipediaItem.cpp b/src/plugins/render/wikipedia/WikipediaItem.cpp
index 978b966..7c1bd3e 100644
--- a/src/plugins/render/wikipedia/WikipediaItem.cpp
+++ b/src/plugins/render/wikipedia/WikipediaItem.cpp
@@ -224,20 +224,18 @@ void WikipediaItem::updateSize()
void WikipediaItem::updateToolTip()
{
- QString toolTip;
- toolTip += "<html><head><meta name=\"qrichtext\" content=\"1\" />";
- toolTip += "<style type=\"text/css\">\\np, li { white-space: pre-wrap; }\\n</style></head>";
- toolTip += "<body style=\" font-family:'Sans Serif'; font-size:9pt; font-weight:400; ";
- toolTip += "font-style:normal;\"><p style=\" margin-top:0px; margin-bottom:0px; ";
- toolTip += "margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">";
+ QString toolTip = QLatin1String(
+ "<html><head><meta name=\"qrichtext\" content=\"1\" />"
+ "<style type=\"text/css\">\\np, li { white-space: pre-wrap; }\\n</style></head>"
+ "<body style=\" font-family:'Sans Serif'; font-size:9pt; font-weight:400; "
+ "font-style:normal;\"><p style=\" margin-top:0px; margin-bottom:0px; "
+ "margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">");
if ( summary().isEmpty() ) {
- toolTip += "%1";
- toolTip += "</p></body></html>\n";
- setToolTip( toolTip.arg( name() ) );
+ toolTip += name() + QLatin1String("</p></body></html>\n");
+ setToolTip(toolTip);
}
else {
- toolTip += tr( "<b>%1</b><br>%2", "Title:\nSummary" );
- toolTip += "</p></body></html>\n";
+ toolTip += tr("<b>%1</b><br>%2", "Title:\nSummary") + QLatin1String("</p></body></html>\n");
setToolTip( toolTip.arg( name() ).arg( summary() ) );
}
}
diff --git a/src/plugins/runner/cyclestreets/CycleStreetsRunner.cpp b/src/plugins/runner/cyclestreets/CycleStreetsRunner.cpp
index 2d80049..770a632 100644
--- a/src/plugins/runner/cyclestreets/CycleStreetsRunner.cpp
+++ b/src/plugins/runner/cyclestreets/CycleStreetsRunner.cpp
@@ -205,7 +205,7 @@ GeoDataDocument *CycleStreetsRunner::parse( const QByteArray &content ) const
instructionName = "Straight";
}
if (name != QLatin1String("Short un-named link") && name != QLatin1String("Un-named link")) {
- instructionName.append( " into " + name );
+ instructionName.append(QLatin1String(" into ") + name);
}
instructions->setName( instructionName );
diff --git a/src/plugins/runner/gosmore-reversegeocoding/GosmoreReverseGeocodingPlugin.cpp b/src/plugins/runner/gosmore-reversegeocoding/GosmoreReverseGeocodingPlugin.cpp
index 283c5d5..6a229c9 100644
--- a/src/plugins/runner/gosmore-reversegeocoding/GosmoreReverseGeocodingPlugin.cpp
+++ b/src/plugins/runner/gosmore-reversegeocoding/GosmoreReverseGeocodingPlugin.cpp
@@ -70,7 +70,7 @@ ReverseGeocodingRunner* GosmorePlugin::newRunner() const
bool GosmorePlugin::canWork() const
{
- QDir mapDir( MarbleDirs::localPath() + "/maps/earth/gosmore/" );
+ QDir mapDir(MarbleDirs::localPath() + QLatin1String("/maps/earth/gosmore/"));
QFileInfo mapFile = QFileInfo ( mapDir, "gosmore.pak" );
return mapFile.exists();
}
diff --git a/src/plugins/runner/gosmore-reversegeocoding/GosmoreReverseGeocodingRunner.cpp b/src/plugins/runner/gosmore-reversegeocoding/GosmoreReverseGeocodingRunner.cpp
index ea89a37..e7ecd47 100644
--- a/src/plugins/runner/gosmore-reversegeocoding/GosmoreReverseGeocodingRunner.cpp
+++ b/src/plugins/runner/gosmore-reversegeocoding/GosmoreReverseGeocodingRunner.cpp
@@ -74,7 +74,7 @@ GosmoreRunner::GosmoreRunner( QObject *parent ) :
d( new GosmoreRunnerPrivate )
{
// Check installation
- QDir mapDir( MarbleDirs::localPath() + "/maps/earth/gosmore/" );
+ QDir mapDir(MarbleDirs::localPath() + QLatin1String("/maps/earth/gosmore/"));
d->m_gosmoreMapFile = QFileInfo ( mapDir, "gosmore.pak" );
}
diff --git a/src/plugins/runner/gosmore-routing/GosmoreRoutingPlugin.cpp b/src/plugins/runner/gosmore-routing/GosmoreRoutingPlugin.cpp
index 963b0c0..a82ed8f 100644
--- a/src/plugins/runner/gosmore-routing/GosmoreRoutingPlugin.cpp
+++ b/src/plugins/runner/gosmore-routing/GosmoreRoutingPlugin.cpp
@@ -70,7 +70,7 @@ RoutingRunner *GosmorePlugin::newRunner() const
bool GosmorePlugin::canWork() const
{
- QDir mapDir( MarbleDirs::localPath() + "/maps/earth/gosmore/" );
+ QDir mapDir(MarbleDirs::localPath() + QLatin1String("/maps/earth/gosmore/"));
QFileInfo mapFile = QFileInfo ( mapDir, "gosmore.pak" );
return mapFile.exists();
}
diff --git a/src/plugins/runner/gosmore-routing/GosmoreRoutingRunner.cpp b/src/plugins/runner/gosmore-routing/GosmoreRoutingRunner.cpp
index 7366eed..eb382b5 100644
--- a/src/plugins/runner/gosmore-routing/GosmoreRoutingRunner.cpp
+++ b/src/plugins/runner/gosmore-routing/GosmoreRoutingRunner.cpp
@@ -193,7 +193,7 @@ GosmoreRunner::GosmoreRunner( QObject *parent ) :
d( new GosmoreRunnerPrivate )
{
// Check installation
- QDir mapDir( MarbleDirs::localPath() + "/maps/earth/gosmore/" );
+ QDir mapDir(MarbleDirs::localPath() + QLatin1String("/maps/earth/gosmore/"));
d->m_gosmoreMapFile = QFileInfo ( mapDir, "gosmore.pak" );
}
diff --git a/src/plugins/runner/gpsbabel/GpsbabelRunner.cpp b/src/plugins/runner/gpsbabel/GpsbabelRunner.cpp
index 41a126f..2977c02 100644
--- a/src/plugins/runner/gpsbabel/GpsbabelRunner.cpp
+++ b/src/plugins/runner/gpsbabel/GpsbabelRunner.cpp
@@ -57,14 +57,15 @@ GeoDataDocument *GpsbabelRunner::parseFile(const QString &fileName, DocumentRole
}
// Set up temporary file to hold output KML from gpsbabel executable
- QTemporaryFile tempKmlFile( QDir::tempPath() + "/marble-gpsbabel-XXXXXX.kml" );
+ QTemporaryFile tempKmlFile(QDir::tempPath() + QLatin1String("/marble-gpsbabel-XXXXXX.kml"));
tempKmlFile.open();
QFile kmlFile( tempKmlFile.fileName() );
// Set up gpsbabel command line
- QString command = "gpsbabel -i " + inputFileType;
- command += " -f " + fileName + " -o kml -F ";
- command += tempKmlFile.fileName();
+ const QString command =
+ QLatin1String("gpsbabel -i ") + inputFileType +
+ QLatin1String(" -f ") + fileName + QLatin1String(" -o kml -F ") +
+ tempKmlFile.fileName();
// Execute gpsbabel to parse the input file
int const exitStatus = QProcess::execute( command );
diff --git a/src/plugins/runner/gpx/handlers/GPXcmtTagHandler.cpp b/src/plugins/runner/gpx/handlers/GPXcmtTagHandler.cpp
index 06cdd36..719f643 100644
--- a/src/plugins/runner/gpx/handlers/GPXcmtTagHandler.cpp
+++ b/src/plugins/runner/gpx/handlers/GPXcmtTagHandler.cpp
@@ -42,7 +42,7 @@ GeoNode* GPXcmtTagHandler::parse(GeoParser& parser) const
QString desc = placemark->description();
if (!desc.isEmpty())
{
- desc.append("<br/>");
+ desc += QLatin1String("<br/>");
}
placemark->setDescription(desc.append(cmt.replace(QLatin1Char('\n'),QLatin1String("\n<br/>"))));
placemark->setDescriptionCDATA(true);
diff --git a/src/plugins/runner/gpx/handlers/GPXdescTagHandler.cpp b/src/plugins/runner/gpx/handlers/GPXdescTagHandler.cpp
index 39fefed..98e9fce 100644
--- a/src/plugins/runner/gpx/handlers/GPXdescTagHandler.cpp
+++ b/src/plugins/runner/gpx/handlers/GPXdescTagHandler.cpp
@@ -40,7 +40,7 @@ GeoNode* GPXdescTagHandler::parse(GeoParser& parser) const
QString desc = placemark->description();
if (!desc.isEmpty())
{
- desc.append("<br/>");
+ desc += QLatin1String("<br/>");
}
placemark->setDescription(desc.append(parser.readElementText().trimmed().replace(QLatin1Char('\n'),QLatin1String("\n<br/>"))));
placemark->setDescriptionCDATA(true);
@@ -52,7 +52,7 @@ GeoNode* GPXdescTagHandler::parse(GeoParser& parser) const
QString desc = route->description();
if (!desc.isEmpty())
{
- desc.append("<br/>");
+ desc += QLatin1String("<br/>");
}
route->setDescription(desc.append(parser.readElementText().trimmed().replace(QLatin1Char('\n'),QLatin1String("\n<br/>"))));
route->setDescriptionCDATA(true);
diff --git a/src/plugins/runner/gpx/handlers/GPXlinkTagHandler.cpp b/src/plugins/runner/gpx/handlers/GPXlinkTagHandler.cpp
index 0b47d2b..9ccfb8c 100644
--- a/src/plugins/runner/gpx/handlers/GPXlinkTagHandler.cpp
+++ b/src/plugins/runner/gpx/handlers/GPXlinkTagHandler.cpp
@@ -53,7 +53,7 @@ GeoNode* GPXlinkTagHandler::parse(GeoParser& parser) const
QString desc = placemark->description();
if (!desc.isEmpty())
{
- desc.append("<br/>");
+ desc += QLatin1String("<br/>");
}
placemark->setDescription(desc.append(link));
diff --git a/src/plugins/runner/kml/KmzHandler.cpp b/src/plugins/runner/kml/KmzHandler.cpp
index a65e6d6..7724fe4 100644
--- a/src/plugins/runner/kml/KmzHandler.cpp
+++ b/src/plugins/runner/kml/KmzHandler.cpp
@@ -26,7 +26,7 @@ bool KmzHandler::open(const QString &kmz, QString &error)
}
QString const uuid = QUuid::createUuid().toString().mid(1, 8);
- QString const filename = QString("%1/marble-kmz-%2").arg(QDir::tempPath()).arg(uuid);
+ QString const filename = QDir::tempPath() + QLatin1String("/marble-kmz-") + uuid;
if (!QDir::root().mkpath(filename)) {
error = QString("Failed to create temporary storage %1 for extracting %2").arg(filename).arg(kmz);
mDebug() << error;
diff --git a/src/plugins/runner/local-osm-search/LocalOsmSearchPlugin.cpp b/src/plugins/runner/local-osm-search/LocalOsmSearchPlugin.cpp
index 72d61c7..133a2c8 100644
--- a/src/plugins/runner/local-osm-search/LocalOsmSearchPlugin.cpp
+++ b/src/plugins/runner/local-osm-search/LocalOsmSearchPlugin.cpp
@@ -25,7 +25,7 @@ LocalOsmSearchPlugin::LocalOsmSearchPlugin( QObject *parent ) :
setSupportedCelestialBodies(QStringList(QStringLiteral("earth")));
setCanWorkOffline( true );
- QString const path = MarbleDirs::localPath() + "/maps/earth/placemarks/";
+ QString const path = MarbleDirs::localPath() + QLatin1String("/maps/earth/placemarks/");
QFileInfo pathInfo( path );
if ( !pathInfo.exists() ) {
QDir("/").mkpath( pathInfo.absolutePath() );
@@ -108,7 +108,7 @@ void LocalOsmSearchPlugin::updateDatabase()
m_databaseFiles.clear();
QStringList const baseDirs = QStringList() << MarbleDirs::systemPath() << MarbleDirs::localPath();
foreach ( const QString &baseDir, baseDirs ) {
- QString base = baseDir + "/maps/earth/placemarks/";
+ const QString base = baseDir + QLatin1String("/maps/earth/placemarks/");
addDatabaseDirectory( base );
QDir::Filters filters = QDir::AllDirs | QDir::Readable | QDir::NoDotAndDotDot;
QDirIterator::IteratorFlags flags = QDirIterator::Subdirectories | QDirIterator::FollowSymlinks;
diff --git a/src/plugins/runner/local-osm-search/OsmDatabase.cpp b/src/plugins/runner/local-osm-search/OsmDatabase.cpp
index 7111390..501f186 100644
--- a/src/plugins/runner/local-osm-search/OsmDatabase.cpp
+++ b/src/plugins/runner/local-osm-search/OsmDatabase.cpp
@@ -94,7 +94,7 @@ QVector<OsmPlacemark> OsmDatabase::find( const DatabaseQuery &userQuery )
QTime regionTimer;
regionTimer.start();
// Nested set model to support region hierarchies, see http://en.wikipedia.org/wiki/Nested_set_model
- const QString regionsQueryString = "SELECT lft, rgt FROM regions WHERE name LIKE '%" + userQuery.region() + "%';";
+ const QString regionsQueryString = QLatin1String("SELECT lft, rgt FROM regions WHERE name LIKE '%") + userQuery.region() + QLatin1String("%';");
QSqlQuery regionsQuery( regionsQueryString, database );
if ( regionsQuery.lastError().isValid() ) {
qWarning() << regionsQuery.lastError() << "in" << databaseFile << "with query" << regionsQuery.lastQuery();
@@ -103,10 +103,10 @@ QVector<OsmPlacemark> OsmDatabase::find( const DatabaseQuery &userQuery )
int regionCount = 0;
while ( regionsQuery.next() ) {
if ( regionCount > 0 ) {
- regionRestriction += " OR ";
+ regionRestriction += QLatin1String(" OR ");
}
- regionRestriction += " (regions.lft >= " + regionsQuery.value( 0 ).toString();
- regionRestriction += " AND regions.lft <= " + regionsQuery.value( 1 ).toString() + ')';
+ regionRestriction += QLatin1String(" (regions.lft >= ") + regionsQuery.value( 0 ).toString() +
+ QLatin1String(" AND regions.lft <= ") + regionsQuery.value( 1 ).toString() + QLatin1Char(')');
regionCount++;
}
regionRestriction += ')';
@@ -127,18 +127,18 @@ QVector<OsmPlacemark> OsmDatabase::find( const DatabaseQuery &userQuery )
" FROM regions, places";
if ( userQuery.queryType() == DatabaseQuery::CategorySearch ) {
- queryString += " WHERE regions.id = places.region";
+ queryString += QLatin1String(" WHERE regions.id = places.region");
if( userQuery.category() == OsmPlacemark::UnknownCategory ) {
// search for all pois which are not street nor address
- queryString += " AND places.category <> 0 AND places.category <> 6";
+ queryString += QLatin1String(" AND places.category <> 0 AND places.category <> 6");
} else {
// search for specific category
- queryString += " AND places.category = %1";
+ queryString += QLatin1String(" AND places.category = %1");
queryString = queryString.arg( (qint32) userQuery.category() );
}
if ( userQuery.position().isValid() && userQuery.region().isEmpty() ) {
// sort by distance
- queryString += " ORDER BY ((places.lat-%1)*(places.lat-%1)+(places.lon-%2)*(places.lon-%2))";
+ queryString += QLatin1String(" ORDER BY ((places.lat-%1)*(places.lat-%1)+(places.lon-%2)*(places.lon-%2))");
GeoDataCoordinates position = userQuery.position();
queryString = queryString.arg( position.latitude( GeoDataCoordinates::Degree ), 0, 'f', 8 )
.arg( position.longitude( GeoDataCoordinates::Degree ), 0, 'f', 8 );
@@ -146,20 +146,20 @@ QVector<OsmPlacemark> OsmDatabase::find( const DatabaseQuery &userQuery )
queryString += regionRestriction;
}
} else if ( userQuery.queryType() == DatabaseQuery::BroadSearch ) {
- queryString += " WHERE regions.id = places.region"
- " AND places.name " + wildcardQuery( userQuery.searchTerm() );
+ queryString += QLatin1String(" WHERE regions.id = places.region"
+ " AND places.name ") + wildcardQuery(userQuery.searchTerm());
} else {
- queryString += " WHERE regions.id = places.region"
- " AND places.name " + wildcardQuery( userQuery.street() );
+ queryString += QLatin1String(" WHERE regions.id = places.region"
+ " AND places.name ") + wildcardQuery(userQuery.street());
if ( !userQuery.houseNumber().isEmpty() ) {
- queryString += " AND places.number " + wildcardQuery( userQuery.houseNumber() );
+ queryString += QLatin1String(" AND places.number ") + wildcardQuery(userQuery.houseNumber());
} else {
- queryString += " AND places.number IS NULL";
+ queryString += QLatin1String(" AND places.number IS NULL");
}
queryString += regionRestriction;
}
- queryString += " LIMIT 50;";
+ queryString += QLatin1String(" LIMIT 50;");
/** @todo: sort/filter results from several databases */
@@ -297,9 +297,9 @@ QString OsmDatabase::wildcardQuery( const QString &term )
{
QString result = term;
if ( term.contains( '*' ) ) {
- return " LIKE '" + result.replace( '*', '%' ) + '\'';
+ return QLatin1String(" LIKE '") + result.replace(QLatin1Char('*'), QLatin1Char('%')) + QLatin1Char('\'');
} else {
- return " = '" + result + '\'';
+ return QLatin1String(" = '") + result + QLatin1Char('\'');
}
}
diff --git a/src/plugins/runner/monav/MonavConfigWidget.cpp b/src/plugins/runner/monav/MonavConfigWidget.cpp
index b388798..3019e46 100644
--- a/src/plugins/runner/monav/MonavConfigWidget.cpp
+++ b/src/plugins/runner/monav/MonavConfigWidget.cpp
@@ -487,7 +487,7 @@ void MonavConfigWidgetPrivate::install()
{
if ( !m_currentDownload.isEmpty() ) {
int const index = m_currentDownload.lastIndexOf( "/");
- QString localFile = MarbleDirs::localPath() + "/maps" + m_currentDownload.mid( index );
+ const QString localFile = MarbleDirs::localPath() + QLatin1String("/maps") + m_currentDownload.mid(index);
m_currentFile.setFileName( localFile );
if ( m_currentFile.open( QFile::WriteOnly ) ) {
QFileInfo file( m_currentFile );
diff --git a/src/plugins/runner/monav/MonavMap.cpp b/src/plugins/runner/monav/MonavMap.cpp
index 3f56d2c..52dfb28 100644
--- a/src/plugins/runner/monav/MonavMap.cpp
+++ b/src/plugins/runner/monav/MonavMap.cpp
@@ -133,12 +133,12 @@ QList<QFileInfo> MonavMap::files() const
QList<QFileInfo> files;
QStringList fileNames = QStringList() << "config" << "edges" << "names" << "paths" << "types";
foreach( const QString & file, fileNames ) {
- files << QFileInfo( m_directory, QString( "Contraction Hierarchies_" ) + file );
+ files << QFileInfo(m_directory, QLatin1String("Contraction Hierarchies_") + file);
}
fileNames = QStringList() << "config" << "grid" << "index_1" << "index_2" << "index_3";
foreach( const QString & file, fileNames ) {
- files << QFileInfo( m_directory, QString( "GPSGrid_" ) + file );
+ files << QFileInfo(m_directory, QLatin1String("GPSGrid_") + file);
}
files << QFileInfo( m_directory, "plugins.ini" );
diff --git a/src/plugins/runner/monav/MonavPlugin.cpp b/src/plugins/runner/monav/MonavPlugin.cpp
index f7d6be5..e1ec98c 100644
--- a/src/plugins/runner/monav/MonavPlugin.cpp
+++ b/src/plugins/runner/monav/MonavPlugin.cpp
@@ -169,7 +169,7 @@ void MonavPluginPrivate::loadMaps()
if ( m_maps.isEmpty() ) {
QStringList const baseDirs = QStringList() << MarbleDirs::systemPath() << MarbleDirs::localPath();
foreach ( const QString &baseDir, baseDirs ) {
- QString base = baseDir + "/maps/earth/monav/";
+ const QString base = baseDir + QLatin1String("/maps/earth/monav/");
loadMap( base );
QDir::Filters filters = QDir::AllDirs | QDir::Readable | QDir::NoDotAndDotDot;
QDirIterator::IteratorFlags flags = QDirIterator::Subdirectories | QDirIterator::FollowSymlinks;
diff --git a/src/plugins/runner/nominatim-search/OsmNominatimSearchRunner.cpp b/src/plugins/runner/nominatim-search/OsmNominatimSearchRunner.cpp
index 91eebcf..7036c98 100644
--- a/src/plugins/runner/nominatim-search/OsmNominatimSearchRunner.cpp
+++ b/src/plugins/runner/nominatim-search/OsmNominatimSearchRunner.cpp
@@ -160,7 +160,7 @@ void OsmNominatimRunner::handleResult( QNetworkReply* reply )
QDomElement item = place.childNodes().at(i).toElement();
description += item.nodeName() + ':' + item.text() + '\n';
}
- description += "Category: " + key + '/' + value;
+ description += QLatin1String("Category: ") + key + QLatin1Char('/') + value;
if (!lon.isEmpty() && !lat.isEmpty() && !desc.isEmpty()) {
QString placemarkName;
@@ -171,27 +171,27 @@ void OsmNominatimRunner::handleResult( QNetworkReply* reply )
}
if (!road.isEmpty() && road != placemarkName ) {
if( !placemarkName.isEmpty() ) {
- placemarkName += ", ";
+ placemarkName += QLatin1String(", ");
}
placemarkName += road;
data.addTag("addr:street", road);
}
if (!city.isEmpty() && !placemarkName.contains(",") && city != placemarkName) {
if( !placemarkName.isEmpty() ) {
- placemarkName += ", ";
+ placemarkName += QLatin1String(", ");
}
placemarkName += city;
data.addTag("addr:city", city);
}
if (!administrative.isEmpty()&& !placemarkName.contains(",") && administrative != placemarkName) {
if( !placemarkName.isEmpty() ) {
- placemarkName += ", ";
+ placemarkName += QLatin1String(", ");
}
placemarkName += administrative;
}
if (!country.isEmpty()&& !placemarkName.contains(",") && country != placemarkName) {
if( !placemarkName.isEmpty() ) {
- placemarkName += ", ";
+ placemarkName += QLatin1String(", ");
}
placemarkName += country;
data.addTag("addr:country", country);
diff --git a/src/plugins/runner/openrouteservice/OpenRouteServiceRunner.cpp b/src/plugins/runner/openrouteservice/OpenRouteServiceRunner.cpp
index 663f447..6c30a9a 100644
--- a/src/plugins/runner/openrouteservice/OpenRouteServiceRunner.cpp
+++ b/src/plugins/runner/openrouteservice/OpenRouteServiceRunner.cpp
@@ -129,35 +129,35 @@ void OpenRouteServiceRunner::handleError( QNetworkReply::NetworkError error )
QString OpenRouteServiceRunner::xmlHeader()
{
- QString result = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
- result += "<xls:XLS xmlns:xls=\"http://www.opengis.net/xls\" xmlns:sch=\"http://www.ascc.net/xml/schematron\" ";
- result += "xmlns:gml=\"http://www.opengis.net/gml\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" ";
- result += "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ";
- result += "xsi:schemaLocation=\"http://www.opengis.net/xls ";
- result += "http://schemas.opengis.net/ols/1.1.0/RouteService.xsd\" version=\"1.1\" xls:lang=\"en\">\n";
- result += "<xls:RequestHeader/>\n";
+ const QString result = QLatin1String("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+ "<xls:XLS xmlns:xls=\"http://www.opengis.net/xls\" xmlns:sch=\"http://www.ascc.net/xml/schematron\" "
+ "xmlns:gml=\"http://www.opengis.net/gml\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" "
+ "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "
+ "xsi:schemaLocation=\"http://www.opengis.net/xls "
+ "http://schemas.opengis.net/ols/1.1.0/RouteService.xsd\" version=\"1.1\" xls:lang=\"en\">\n"
+ "<xls:RequestHeader/>\n");
return result;
}
QString OpenRouteServiceRunner::requestHeader( const QString &unit, const QString &routePreference )
{
- QString result = "<xls:Request methodName=\"RouteRequest\" requestID=\"123456789\" version=\"1.1\">\n";
- result += "<xls:DetermineRouteRequest distanceUnit=\"%1\">\n";
- result += "<xls:RoutePlan>\n";
- result += "<xls:RoutePreference>%2</xls:RoutePreference>\n";
- result += "<xls:WayPointList>\n";
+ const QString result = QLatin1String("<xls:Request methodName=\"RouteRequest\" requestID=\"123456789\" version=\"1.1\">\n"
+ "<xls:DetermineRouteRequest distanceUnit=\"%1\">\n"
+ "<xls:RoutePlan>\n"
+ "<xls:RoutePreference>%2</xls:RoutePreference>\n"
+ "<xls:WayPointList>\n");
return result.arg( unit ).arg( routePreference );
}
QString OpenRouteServiceRunner::requestPoint( PointType pointType, const GeoDataCoordinates &coordinates )
{
- QString result = "<xls:%1>\n";
- result += "<xls:Position>\n";
- result += "<gml:Point srsName=\"EPSG:4326\">\n";
- result += "<gml:pos>%2 %3</gml:pos>\n";
- result += "</gml:Point>\n";
- result += "</xls:Position>\n";
- result += "</xls:%1>\n";
+ QString result = QLatin1String("<xls:%1>\n"
+ "<xls:Position>\n"
+ "<gml:Point srsName=\"EPSG:4326\">\n"
+ "<gml:pos>%2 %3</gml:pos>\n"
+ "</gml:Point>\n"
+ "</xls:Position>\n"
+ "</xls:%1>\n");
result = result.arg( pointType == StartPoint ? "StartPoint" : ( pointType == ViaPoint ? "ViaPoint" : "EndPoint" ) );
result = result.arg( coordinates.longitude( GeoDataCoordinates::Degree ), 0, 'f', 14 );
@@ -167,24 +167,24 @@ QString OpenRouteServiceRunner::requestPoint( PointType pointType, const GeoData
QString OpenRouteServiceRunner::requestFooter( const QHash<QString, QVariant>& settings )
{
- QString result = "</xls:WayPointList>\n";
+ QString result = QLatin1String("</xls:WayPointList>\n");
if (settings["noMotorways"].toInt() || settings["noTollways"].toInt() ) {
- result += "<xls:AvoidList>\n";
+ result += QLatin1String("<xls:AvoidList>\n");
if ( settings["noTollways"].toInt() ) {
- result += "<xls:AvoidFeature>Tollway</xls:AvoidFeature>";
+ result += QLatin1String("<xls:AvoidFeature>Tollway</xls:AvoidFeature>");
}
if ( settings["noMotorways"].toInt() ) {
- result += "<xls:AvoidFeature>Highway</xls:AvoidFeature>";
+ result += QLatin1String("<xls:AvoidFeature>Highway</xls:AvoidFeature>");
}
- result += "</xls:AvoidList>\n";
+ result += QLatin1String("</xls:AvoidList>\n");
}
- result += "</xls:RoutePlan>\n";
- result += "<xls:RouteInstructionsRequest provideGeometry=\"true\" />\n";
- result += "<xls:RouteGeometryRequest/>\n";
- result += "</xls:DetermineRouteRequest>\n";
- result += "</xls:Request>\n";
+ result += QLatin1String("</xls:RoutePlan>\n"
+ "<xls:RouteInstructionsRequest provideGeometry=\"true\" />\n"
+ "<xls:RouteGeometryRequest/>\n"
+ "</xls:DetermineRouteRequest>\n"
+ "</xls:Request>\n");
return result;
}
diff --git a/src/plugins/runner/osm/OsmWay.cpp b/src/plugins/runner/osm/OsmWay.cpp
index f81ad10..04dd681 100644
--- a/src/plugins/runner/osm/OsmWay.cpp
+++ b/src/plugins/runner/osm/OsmWay.cpp
@@ -142,7 +142,7 @@ bool OsmWay::isAreaTag(const QString &keyValue)
s_areaTags.insert( "waterway=riverbank" );
foreach(const QString &value, OsmPresetLibrary::buildingValues() ) {
- s_areaTags.insert( QString("building=%1").arg(value) );
+ s_areaTags.insert(QLatin1String("building=") + value);
}
s_areaTags.insert( "man_made=bridge" );
diff --git a/src/plugins/runner/osm/writers/OsmTagWriter.cpp b/src/plugins/runner/osm/writers/OsmTagWriter.cpp
index d70e07e..5ab306d 100644
--- a/src/plugins/runner/osm/writers/OsmTagWriter.cpp
+++ b/src/plugins/runner/osm/writers/OsmTagWriter.cpp
@@ -28,7 +28,7 @@ bool OsmTagWriter::write( const GeoNode *node, GeoWriter& writer ) const
writer.writeStartElement( "osm" );
writer.writeAttribute( "version", osm::osmTag_version06 );
- writer.writeAttribute( "generator", "Marble " + Marble::MARBLE_VERSION_STRING );
+ writer.writeAttribute("generator", QLatin1String("Marble ") + Marble::MARBLE_VERSION_STRING);
return true;
}
diff --git a/src/plugins/runner/routino/RoutinoPlugin.cpp b/src/plugins/runner/routino/RoutinoPlugin.cpp
index 59be712..002d7f7 100644
--- a/src/plugins/runner/routino/RoutinoPlugin.cpp
+++ b/src/plugins/runner/routino/RoutinoPlugin.cpp
@@ -165,7 +165,7 @@ QHash< QString, QVariant > RoutinoPlugin::templateSettings(RoutingProfilesModel:
bool RoutinoPlugin::canWork() const
{
- QDir mapDir = QDir( MarbleDirs::localPath() + "/maps/earth/routino/" );
+ QDir mapDir = QDir(MarbleDirs::localPath() + QLatin1String("/maps/earth/routino/"));
return mapDir.exists();
}
diff --git a/src/plugins/runner/routino/RoutinoRunner.cpp b/src/plugins/runner/routino/RoutinoRunner.cpp
index 9daf919..5a6e78f 100644
--- a/src/plugins/runner/routino/RoutinoRunner.cpp
+++ b/src/plugins/runner/routino/RoutinoRunner.cpp
@@ -93,7 +93,7 @@ QByteArray RoutinoRunnerPrivate::retrieveWaypoints( const QStringList &params )
QStringList routinoParams;
routinoParams << params;
- routinoParams << "--dir=" + m_mapDir.absolutePath();
+ routinoParams << QLatin1String("--dir=") + m_mapDir.absolutePath();
routinoParams << "--output-text-all";
mDebug() << routinoParams;
routinoProcess.start( "routino-router", routinoParams );
@@ -105,9 +105,9 @@ QByteArray RoutinoRunnerPrivate::retrieveWaypoints( const QStringList &params )
if ( routinoProcess.waitForFinished(60 * 1000) ) {
mDebug() << routinoProcess.readAll();
mDebug() << "routino finished";
- QFile file( routinoProcess.workingDirectory() + "/shortest-all.txt" );
+ QFile file(routinoProcess.workingDirectory() + QLatin1String("/shortest-all.txt"));
if ( !file.exists() ) {
- file.setFileName( routinoProcess.workingDirectory() + "/quickest-all.txt" );
+ file.setFileName(routinoProcess.workingDirectory() + QLatin1String("/quickest-all.txt"));
}
if ( !file.exists() ) {
mDebug() << "Can't get results";
@@ -214,7 +214,7 @@ RoutinoRunner::RoutinoRunner( QObject *parent ) :
d( new RoutinoRunnerPrivate )
{
// Check installation
- d->m_mapDir = QDir( MarbleDirs::localPath() + "/maps/earth/routino/" );
+ d->m_mapDir = QDir(MarbleDirs::localPath() + QLatin1String("/maps/earth/routino/"));
}
RoutinoRunner::~RoutinoRunner()
diff --git a/src/plugins/runner/traveling-salesman/TravelingSalesmanRunner.cpp b/src/plugins/runner/traveling-salesman/TravelingSalesmanRunner.cpp
index e18cab7..9cc9262 100644
--- a/src/plugins/runner/traveling-salesman/TravelingSalesmanRunner.cpp
+++ b/src/plugins/runner/traveling-salesman/TravelingSalesmanRunner.cpp
@@ -142,7 +142,7 @@ TravelingSalesmanRunner::TravelingSalesmanRunner( QObject *parent ) :
d( new TravelingSalesmanRunnerPrivate )
{
// Check installation
- QDir mapDir( MarbleDirs::localPath() + "/maps/earth/traveling-salesman/" );
+ QDir mapDir(MarbleDirs::localPath() + QLatin1String("/maps/earth/traveling-salesman/"));
d->m_travelingsalesmanJar = QFileInfo ( mapDir, "traveling-salesman.jar" );
}
diff --git a/tools/maptheme-previewimage/main.cpp b/tools/maptheme-previewimage/main.cpp
index d267455..17c65f6 100644
--- a/tools/maptheme-previewimage/main.cpp
+++ b/tools/maptheme-previewimage/main.cpp
@@ -28,8 +28,8 @@ class Cheeeeze : private QThread { public: using QThread::msleep; };
QPixmap resize(const QPixmap &pixmap)
{
if ( QProcess::execute("convert -version") == 0 ) {
- QString const inputFile = QDir::tempPath() + "/marble-preview.png";
- QString const outputFile = QDir::tempPath() + "/marble-preview-scaled.png";
+ QString const inputFile = QDir::tempPath() + QLatin1String("/marble-preview.png");
+ QString const outputFile = QDir::tempPath() + QLatin1String("/marble-preview-scaled.png");
if ( pixmap.save( inputFile )
&& QProcess::execute( "convert", QStringList() << inputFile << "-resize" << "130x130"
<< "-sharpen" << "1x1" << outputFile ) == 0
diff --git a/tools/osm-sisyphus/job.cpp b/tools/osm-sisyphus/job.cpp
index b9ac7fb..7083a51 100644
--- a/tools/osm-sisyphus/job.cpp
+++ b/tools/osm-sisyphus/job.cpp
@@ -134,7 +134,7 @@ bool Job::download()
// arguments << "--transport" << m_transport;
// arguments << "--payload" << targetFile().fileName();
// arguments << m_parameters.base().absoluteFilePath("poly/" + m_region.polyFile());
-// arguments << monavDir().absoluteFilePath() + "/marble.kml";
+// arguments << monavDir().absoluteFilePath() + QLatin1String("/marble.kml");
// QProcess poly2kml;
// poly2kml.start("poly2kml", arguments);
// poly2kml.waitForFinished(1000 * 60 * 30); // wait up to half an hour for poly2kml to convert the data
@@ -153,13 +153,13 @@ bool Job::monav()
QString const status = QString("Generating offline routing map from %1 (%2).").arg(osmFile().fileName()).arg(Region::fileSize(osmFile()));
changeStatus(Routing, status);
QStringList arguments;
- arguments << "-s=" + m_monavSettings;
- arguments << "-i=" + osmFile().absoluteFilePath();
- arguments << "-o=" + monavDir().absoluteFilePath();
+ arguments << QLatin1String("-s=") + m_monavSettings;
+ arguments << QLatin1String("-i=") + osmFile().absoluteFilePath();
+ arguments << QLatin1String("-o=") + monavDir().absoluteFilePath();
arguments << "-pi=OpenStreetMap Importer" << "-pro=Contraction Hierarchies";
arguments << "-pg=GPS Grid" << "-di";
- arguments << "-dro=" + m_transport;
- arguments << "--profile=" + m_profile;
+ arguments << QLatin1String("-dro=") + m_transport;
+ arguments << QLatin1String("--profile=") + m_profile;
arguments << "-dd" /*<< "-dc"*/;
QProcess monav;
monav.start("monav-preprocessor", arguments);
@@ -172,13 +172,13 @@ bool Job::monav()
return false;
}
- QFile pluginsFile(monavDir().absoluteFilePath() + "/plugins.ini");
+ QFile pluginsFile(monavDir().absoluteFilePath() + QLatin1String("/plugins.ini"));
pluginsFile.open(QFile::WriteOnly | QFile::Truncate);
QTextStream pluginsStream(&pluginsFile);
pluginsStream << "[General]\nrouter=Contraction Hierarchies\nrenderer=Mapnik Renderer\ngpsLookup=GPS Grid\naddressLookup=Unicode Tournament Trie\n";
pluginsFile.close();
- QFileInfo subdir = QFileInfo(monavDir().absoluteFilePath() + "/routing_" + m_transport.toLower());
+ QFileInfo subdir = QFileInfo(monavDir().absoluteFilePath() + QLatin1String("/routing_") + m_transport.toLower());
if (subdir.exists() && subdir.isDir()) {
QFileInfoList files = QDir(subdir.absoluteFilePath()).entryInfoList(QDir::Files);
foreach(const QFileInfo &file, files) {
@@ -208,7 +208,7 @@ bool Job::search()
arguments << "--payload" << targetFile().fileName();
arguments << osmFile().absoluteFilePath();
arguments << searchFile().absoluteFilePath();
- QFileInfo kmlFile(monavDir().absoluteFilePath() + "/marble.kml");
+ QFileInfo kmlFile(monavDir().absoluteFilePath() + QLatin1String("/marble.kml"));
arguments << kmlFile.absoluteFilePath();
QProcess osmAddresses;
osmAddresses.start("osm-addresses", arguments);
@@ -246,7 +246,7 @@ bool Job::package()
QStringList arguments;
arguments << "czf" << targetFile().absoluteFilePath() << "earth/monav/" << "earth/placemarks";
QProcess tar;
- tar.setWorkingDirectory(m_parameters.base().absolutePath() + "/data/" + m_region.id());
+ tar.setWorkingDirectory(m_parameters.base().absolutePath() + QLatin1String("/data/") + m_region.id());
tar.start("tar", arguments);
tar.waitForFinished(1000 * 60 * 60); // wait up to 1 hour for tar to package things
if (tar.exitStatus() == QProcess::NormalExit && tar.exitCode() == 0) {
@@ -291,13 +291,13 @@ bool Job::cleanup()
QFileInfo Job::osmFile()
{
m_parameters.base().mkdir("download");
- QFileInfo result(m_parameters.base(), QString("download/") + m_region.id() + ".osm.pbf");
+ QFileInfo result(m_parameters.base(), QLatin1String("download/") + m_region.id() + QLatin1String(".osm.pbf"));
return result;
}
QFileInfo Job::monavDir()
{
- QString const subdir = "data/" + m_region.id() + "/earth/monav/" + m_transport.toLower() + '/' + m_region.path();
+ QString const subdir = QLatin1String("data/") + m_region.id() + QLatin1String("/earth/monav/") + m_transport.toLower() + QLatin1Char('/') + m_region.path();
m_parameters.base().mkpath(subdir);
QFileInfo result(m_parameters.base(), subdir);
return result;
@@ -306,15 +306,15 @@ QFileInfo Job::monavDir()
QFileInfo Job::targetFile()
{
m_parameters.base().mkdir("finished");
- QFileInfo result(m_parameters.base(), "finished/" + m_region.id() + '_' + m_transport.toLower() + ".tar.gz");
+ QFileInfo result(m_parameters.base(), QLatin1String("finished/") + m_region.id() + QLatin1Char('_') + m_transport.toLower() + QLatin1String(".tar.gz"));
return result;
}
QFileInfo Job::searchFile()
{
- QString const subdir = "data/" + m_region.id() + "/earth/placemarks/" + QFileInfo(m_region.path()).path();
+ QString const subdir = QLatin1String("data/") + m_region.id() + QLatin1String("/earth/placemarks/") + QFileInfo(m_region.path()).path();
m_parameters.base().mkpath(subdir);
- QFileInfo result(m_parameters.base(), subdir + '/' + m_region.id() + ".sqlite");
+ QFileInfo result(m_parameters.base(), subdir + QLatin1Char('/') + m_region.id() + QLatin1String(".sqlite"));
return result;
}
diff --git a/tools/osm-sisyphus/upload.cpp b/tools/osm-sisyphus/upload.cpp
index 8de9f6f..fea51c9 100644
--- a/tools/osm-sisyphus/upload.cpp
+++ b/tools/osm-sisyphus/upload.cpp
@@ -94,7 +94,7 @@ void Upload::deleteFile(const QFileInfo &file)
bool Upload::adjustNewstuffFile(const Package &package)
{
if (m_xml.isNull()) {
- QTemporaryFile tempFile(QDir::tempPath() + "/monav-maps-XXXXXX.xml");
+ QTemporaryFile tempFile(QDir::tempPath() + QLatin1String("/monav-maps-XXXXXX.xml"));
tempFile.setAutoRemove(false);
tempFile.open();
QString monavFilename = tempFile.fileName();
@@ -207,7 +207,7 @@ bool Upload::adjustNewstuffFile(const Package &package)
bool Upload::uploadNewstuff()
{
- QTemporaryFile outFile(QDir::tempPath() + "/monav-maps-out-XXXXXX.xml");
+ QTemporaryFile outFile(QDir::tempPath() + QLatin1String("/monav-maps-out-XXXXXX.xml"));
outFile.open();
QTextStream outStream(&outFile);
outStream << m_xml.toString(2);
diff --git a/tools/routing-instructions/main.cpp b/tools/routing-instructions/main.cpp
index 83b39e2..c259f8f 100644
--- a/tools/routing-instructions/main.cpp
+++ b/tools/routing-instructions/main.cpp
@@ -59,10 +59,10 @@ void loadTranslations( QCoreApplication &app, QTranslator &translator )
}
QString const i18nDir = "/usr/share/marble/translations";
- QString const relativeDir = app.applicationDirPath() + "/translations";
+ QString const relativeDir = app.applicationDirPath() + QLatin1String("/translations");
foreach( const QString &path, QStringList() << i18nDir << relativeDir << QDir::currentPath() ) {
foreach( const QString &lang, QStringList() << lang << code ) {
- QFileInfo translations = QFileInfo( path + "/routing-instructions_" + lang + ".qm" );
+ QFileInfo translations = QFileInfo( path + QLatin1String("/routing-instructions_") + lang + QLatin1String(".qm"));
if ( translations.exists() && translator.load( translations.absoluteFilePath() ) ) {
app.installTranslator( &translator );
return;
diff --git a/tools/sentineltile/tileprocessor.cpp b/tools/sentineltile/tileprocessor.cpp
index 103277a..3d178a3 100644
--- a/tools/sentineltile/tileprocessor.cpp
+++ b/tools/sentineltile/tileprocessor.cpp
@@ -36,11 +36,11 @@ void TileProcessor::parseFileList(const QString& fileListUrl) {
QStringList dirList = rootDir.entryList(QStringList(), QDir::AllDirs | QDir::NoDotAndDotDot);
for (int i = 0; i < dirList.length(); ++i) {
- QString urlPath = fileListUrl + "/" + dirList.at(i);
+ QString urlPath = fileListUrl + QLatin1Char('/') + dirList.at(i);
QDir columnDir = QDir(urlPath);
QStringList files = columnDir.entryList(QStringList() << "*.jpg", QDir::Files);
for (int j = 0; j < files.length(); ++j) {
- QString filePath = urlPath + "/" + files.at(j);
+ QString filePath = urlPath + QLatin1Char('/') + files.at(j);
m_fileList << filePath;
}
}
diff --git a/tools/speaker-files/main.cpp b/tools/speaker-files/main.cpp
index 0cbadee..a68291f 100644
--- a/tools/speaker-files/main.cpp
+++ b/tools/speaker-files/main.cpp
@@ -203,9 +203,9 @@ void convertToMarbleFormat( const QString &input, const QString &output )
void convertToTomTomFormat( const QString &input, const QString &output, const QString &nick, const QString &simpleNick, int index, bool male, const QString &lang )
{
QStringList arguments;
- QString const prefix = input + "/data" + QString::number( index );
- QString const vif = prefix + ".vif";
- QString const chk = prefix + ".chk";
+ QString const prefix = input + QLatin1String("/data") + QString::number( index );
+ QString const vif = prefix + QLatin1String(".vif");
+ QString const chk = prefix + QLatin1String(".chk");
arguments << "join" << QString::number( index ) << nick << vif;
QProcess viftool;
viftool.setWorkingDirectory( input );
@@ -228,7 +228,7 @@ void convertToTomTomFormat( const QString &input, const QString &output, const Q
files << vif << chk;
files << "AUTHORS.txt" << "LICENSE.txt";
QStringList zipArguments;
- zipArguments << "-q" << "-j" << ( output + '/' + lang + '-' + simpleNick + "-TomTom.zip" );
+ zipArguments << "-q" << "-j" << ( output + QLatin1Char('/') + lang + QLatin1Char('-') + simpleNick + QLatin1String("-TomTom.zip") );
foreach( const QString &file, files ) {
QString const filePath = inputDirectory.filePath( file );
zipArguments << filePath;
@@ -287,10 +287,10 @@ int process( const QDir &input, const QDir &output, const QString &xml )
extract( zip, extracted );
normalize( extracted );
createLegalFiles( extracted, name, email );
- QFile::copy( extracted + "/Marble.ogg", nickDir + '/' + lang + '-' + simpleNick + ".ogg" );
- convertToMarbleFormat( extracted, nickDir + '/' + lang + '-' + simpleNick + ".zip" );
+ QFile::copy(extracted + QLatin1String("/Marble.ogg"), nickDir + QLatin1Char('/') + lang + QLatin1Char('-') + simpleNick + QLatin1String(".ogg"));
+ convertToMarbleFormat(extracted, nickDir + QLatin1Char('/') + lang + QLatin1Char('-') + simpleNick + QLatin1String(".zip"));
convertToTomTomFormat(extracted, nickDir, nick, simpleNick, index, gender == QLatin1String("male"), lang);
- convertToNewStuffFormat( extracted, nickDir + '/' + lang + '-' + simpleNick + ".tar.gz" );
+ convertToNewStuffFormat(extracted, nickDir + QLatin1Char('/') + lang + QLatin1Char('-') + simpleNick + QLatin1String(".tar.gz"));
xmlOut << " <stuff category=\"marble/data/audio\">\n";
xmlOut << " <name lang=\"en\">" << language << " - " << nick << " (" << gender << ")" << "</name>\n";
diff --git a/tools/stars/stars.cpp b/tools/stars/stars.cpp
index 56054f2..9907fb0 100644
--- a/tools/stars/stars.cpp
+++ b/tools/stars/stars.cpp
@@ -626,20 +626,20 @@ void exportToKml()
}
if ( colorIdx == 0 ) {
- styleId += " blue";
+ styleId += QLatin1String(" blue");
} else if ( colorIdx == 1 ) {
- styleId += " bluewhite";
+ styleId += QLatin1String(" bluewhite");
} else if ( colorIdx == 3 ) {
- styleId += " yellow";
+ styleId += QLatin1String(" yellow");
} else if ( colorIdx == 4 ) {
- styleId += " orange";
+ styleId += QLatin1String(" orange");
} else if ( colorIdx == 5 ) {
- styleId += " red";
+ styleId += QLatin1String(" red");
} else if ( colorIdx == 6 ) {
- styleId += " garnetred";
+ styleId += QLatin1String(" garnetred");
} else {
// white and no color ID
- styleId += " white";
+ styleId += QLatin1String(" white");
}
out << " <Placemark> \n";
diff --git a/tools/tilecreator-srtm2/tccore.cpp b/tools/tilecreator-srtm2/tccore.cpp
index c45c927..b71d6cb 100644
--- a/tools/tilecreator-srtm2/tccore.cpp
+++ b/tools/tilecreator-srtm2/tccore.cpp
@@ -136,10 +136,10 @@ private:
.arg( EW ).arg( lng<0 ? lng*-1 : lng, 3, 10, QLatin1Char('0' ) );
//qDebug() << fileName;
- if ( !QFile::exists( fileName ) && QFile::exists( fileName + ".zip" ) ) {
+ if (!QFile::exists(fileName) && QFile::exists(fileName + QLatin1String(".zip"))) {
qDebug() << "zip found, unzipping";
QProcess p;
- p.execute("unzip", QStringList() << fileName + ".zip" );
+ p.execute("unzip", QStringList() << fileName + QLatin1String(".zip"));
p.waitForFinished();
QFile( QDir::currentPath() + '/' + QFileInfo( fileName ).fileName()).rename(fileName);
}