summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFriedrich W. H. Kossebau <kossebau@kde.org>2016-08-17 01:23:24 (GMT)
committerFriedrich W. H. Kossebau <kossebau@kde.org>2016-08-17 01:23:24 (GMT)
commit688f32eae1bf32f64de70e78406940dae4403574 (patch)
treecab09a2be64e8de161198e7f38a8c508b5e55ea7
parent76bc83e65ae395f26a0ae5b6950787d58a6198c6 (diff)
Use more QLatin1String for comparing raw strings to QStrings
-rw-r--r--examples/cpp/map-properties/main.cpp2
-rw-r--r--examples/cpp/marble-game/ClickOnThat.cpp4
-rw-r--r--examples/cpp/marble-game/CountryByFlag.cpp2
-rw-r--r--examples/cpp/marble-game/CountryByShape.cpp4
-rw-r--r--examples/cpp/marble-game/GameMainWindow.cpp12
-rw-r--r--examples/cpp/squad-interpolation/squad-interpolation.cpp2
-rw-r--r--src/apps/marble-kde/marble_part.cpp14
-rw-r--r--src/apps/marble-qt/QtMainWindow.cpp8
-rw-r--r--src/apps/marble-qt/qtmain.cpp14
-rw-r--r--src/apps/marble-ui/ControlView.cpp10
-rw-r--r--src/lib/marble/DownloadRegionDialog.cpp6
-rw-r--r--src/lib/marble/EditBookmarkDialog.cpp2
-rw-r--r--src/lib/marble/FileLoader.cpp2
-rw-r--r--src/lib/marble/FileStorageWatcher.cpp8
-rw-r--r--src/lib/marble/FlyToEditWidget.cpp4
-rw-r--r--src/lib/marble/GeoUriParser.cpp4
-rw-r--r--src/lib/marble/MapWizard.cpp2
-rw-r--r--src/lib/marble/MarbleLegendBrowser.cpp2
-rw-r--r--src/lib/marble/MarbleLocale.cpp2
-rw-r--r--src/lib/marble/MarbleMap.cpp36
-rw-r--r--src/lib/marble/MarbleModel.cpp2
-rw-r--r--src/lib/marble/MarbleWidget.cpp4
-rw-r--r--src/lib/marble/MarbleWidgetPopupMenu.cpp32
-rw-r--r--src/lib/marble/NewstuffModel.cpp2
-rw-r--r--src/lib/marble/PlanetFactory.cpp48
-rw-r--r--src/lib/marble/QtMarbleConfigDialog.cpp8
-rw-r--r--src/lib/marble/ServerLayout.cpp2
-rw-r--r--src/lib/marble/StyleBuilder.cpp10
-rw-r--r--src/lib/marble/SunControlWidget.cpp2
-rw-r--r--src/lib/marble/TileCreator.cpp14
-rw-r--r--src/lib/marble/TourCaptureDialog.cpp2
-rw-r--r--src/lib/marble/cloudsync/OwncloudSyncBackend.cpp2
-rw-r--r--src/lib/marble/geodata/data/GeoDataVec2.cpp20
-rw-r--r--src/lib/marble/geodata/handlers/dgml/DgmlDownloadPolicyTagHandler.cpp4
-rw-r--r--src/lib/marble/geodata/handlers/dgml/DgmlLicenseTagHandler.cpp8
-rw-r--r--src/lib/marble/geodata/handlers/dgml/DgmlPenTagHandler.cpp19
-rw-r--r--src/lib/marble/geodata/handlers/dgml/DgmlProjectionTagHandler.cpp4
-rw-r--r--src/lib/marble/geodata/handlers/dgml/DgmlStorageLayoutTagHandler.cpp10
-rw-r--r--src/lib/marble/geodata/handlers/kml/KmlAltitudeModeTagHandler.cpp4
-rw-r--r--src/lib/marble/geodata/handlers/kml/KmlBalloonVisibilityTagHandler.cpp7
-rw-r--r--src/lib/marble/geodata/handlers/kml/KmlColorModeTagHandler.cpp2
-rw-r--r--src/lib/marble/geodata/handlers/kml/KmlDisplayModeTagHandler.cpp5
-rw-r--r--src/lib/marble/geodata/handlers/kml/KmlDocumentTagHandler.cpp3
-rw-r--r--src/lib/marble/geodata/handlers/kml/KmlExtrudeTagHandler.cpp7
-rw-r--r--src/lib/marble/geodata/handlers/kml/KmlFlyToModeTagHandler.cpp4
-rw-r--r--src/lib/marble/geodata/handlers/kml/KmlFlyToViewTagHandler.cpp2
-rw-r--r--src/lib/marble/geodata/handlers/kml/KmlFolderTagHandler.cpp2
-rw-r--r--src/lib/marble/geodata/handlers/kml/KmlGridOriginTagHandler.cpp4
-rw-r--r--src/lib/marble/geodata/handlers/kml/KmlGroundOverlayTagHandler.cpp2
-rw-r--r--src/lib/marble/geodata/handlers/kml/KmlGxAltitudeModeTagHandler.cpp10
-rw-r--r--src/lib/marble/geodata/handlers/kml/KmlHotSpotTagHandler.cpp25
-rw-r--r--src/lib/marble/geodata/handlers/kml/KmlListItemTypeTagHandler.cpp15
-rw-r--r--src/lib/marble/geodata/handlers/kml/KmlOpenTagHandler.cpp2
-rw-r--r--src/lib/marble/geodata/handlers/kml/KmlRefreshModeTagHandler.cpp6
-rw-r--r--src/lib/marble/geodata/handlers/kml/KmlRefreshVisibilityTagHandler.cpp2
-rw-r--r--src/lib/marble/geodata/handlers/kml/KmlShapeTagHandler.cpp6
-rw-r--r--src/lib/marble/geodata/handlers/kml/KmlSimpleFieldTagHandler.cpp14
-rw-r--r--src/lib/marble/geodata/handlers/kml/KmlStateTagHandler.cpp12
-rw-r--r--src/lib/marble/geodata/handlers/kml/KmlTessellateTagHandler.cpp21
-rw-r--r--src/lib/marble/geodata/handlers/kml/KmlViewRefreshModeTagHandler.cpp6
-rw-r--r--src/lib/marble/geodata/handlers/kml/KmlVisibilityTagHandler.cpp6
-rw-r--r--src/lib/marble/geodata/handlers/kml/KmlplayModeTagHandler.cpp2
-rw-r--r--src/lib/marble/geodata/parser/GeoDataParser.cpp16
-rw-r--r--src/lib/marble/geodata/parser/GeoSceneParser.cpp2
-rw-r--r--src/lib/marble/geodata/scene/GeoSceneMap.cpp6
-rw-r--r--src/lib/marble/geodata/writer/GeoDataDocumentWriter.cpp5
-rw-r--r--src/lib/marble/layers/PopupLayer.cpp2
-rw-r--r--src/lib/marble/osm/OsmTagEditorWidget_p.cpp8
-rw-r--r--src/lib/marble/routing/instructions/RoutingInstruction.cpp14
-rw-r--r--src/plugins/positionprovider/flightgear/FlightGearPositionProviderPlugin.cpp8
-rw-r--r--src/plugins/render/annotate/EditPolygonDialog.cpp2
-rw-r--r--src/plugins/render/annotate/EditPolylineDialog.cpp2
-rw-r--r--src/plugins/render/aprs/AprsGatherer.cpp4
-rw-r--r--src/plugins/render/crosshairs/CrosshairsPlugin.cpp4
-rw-r--r--src/plugins/render/earthquake/EarthquakeModel.cpp2
-rw-r--r--src/plugins/render/eclipses/EclipsesPlugin.cpp4
-rw-r--r--src/plugins/render/elevationprofilemarker/ElevationProfileMarker.cpp4
-rw-r--r--src/plugins/render/foursquare/FoursquareModel.cpp2
-rw-r--r--src/plugins/render/graticule/GraticulePlugin.cpp19
-rw-r--r--src/plugins/render/navigation/ArrowDiscWidget.cpp2
-rw-r--r--src/plugins/render/navigation/NavigationSlider.cpp8
-rw-r--r--src/plugins/render/opencaching/OpenCachingModel.cpp28
-rw-r--r--src/plugins/render/opencachingcom/OpenCachingComItem.cpp6
-rw-r--r--src/plugins/render/opencachingcom/OpenCachingComModel.cpp3
-rw-r--r--src/plugins/render/opendesktop/OpenDesktopItem.cpp2
-rw-r--r--src/plugins/render/opendesktop/OpenDesktopModel.cpp5
-rw-r--r--src/plugins/render/overviewmap/OverviewMap.cpp4
-rw-r--r--src/plugins/render/panoramio/PanoramioModel.cpp2
-rw-r--r--src/plugins/render/photo/CoordinatesParser.cpp23
-rw-r--r--src/plugins/render/photo/FlickrParser.cpp27
-rw-r--r--src/plugins/render/photo/PhotoPluginItem.cpp4
-rw-r--r--src/plugins/render/photo/PhotoPluginModel.cpp4
-rw-r--r--src/plugins/render/postalcode/PostalCodeModel.cpp2
-rw-r--r--src/plugins/render/satellites/SatellitesModel.cpp4
-rw-r--r--src/plugins/render/stars/StarsPlugin.cpp18
-rw-r--r--src/plugins/render/twitter/jsonparser.cpp2
-rw-r--r--src/plugins/render/twitter/twitterPlugin.cpp2
-rw-r--r--src/plugins/render/weather/BBCParser.cpp32
-rw-r--r--src/plugins/render/weather/BBCWeatherItem.cpp6
-rw-r--r--src/plugins/render/weather/GeoNamesWeatherService.cpp6
-rw-r--r--src/plugins/render/weather/StationListParser.cpp20
-rw-r--r--src/plugins/render/wikipedia/GeonamesParser.cpp36
-rw-r--r--src/plugins/render/wikipedia/WikipediaItem.cpp2
-rw-r--r--src/plugins/render/wikipedia/WikipediaModel.cpp2
-rw-r--r--src/plugins/runner/cyclestreets/CycleStreetsRunner.cpp4
-rw-r--r--src/plugins/runner/json/JsonParser.cpp14
-rw-r--r--src/plugins/runner/kml/KmlRunner.cpp2
-rw-r--r--src/plugins/runner/mapquest/MapQuestRunner.cpp53
-rw-r--r--src/plugins/runner/monav/MonavRunner.cpp2
-rw-r--r--src/plugins/runner/open-source-routing-machine/OSRMRunner.cpp22
-rw-r--r--src/plugins/runner/openrouteservice/OpenRouteServiceRunner.cpp20
-rw-r--r--src/plugins/runner/osm/OsmParser.cpp4
-rw-r--r--src/plugins/runner/routino/RoutinoPlugin.cpp2
-rw-r--r--src/plugins/runner/routino/RoutinoRunner.cpp2
-rw-r--r--tests/PlacemarkPositionProviderPluginTest.cpp2
-rw-r--r--tests/TestGeoDataCoordinates.cpp10
-rw-r--r--tools/asc2kml/asc2kml.cpp3
-rw-r--r--tools/constellations2kml/constellations2kml.cpp6
-rw-r--r--tools/iau2kml/iau2kml.cpp12
-rw-r--r--tools/osm-addresses/main.cpp14
-rw-r--r--tools/osm-addresses/pbf/PbfParser.cpp38
-rw-r--r--tools/osm-addresses/xml/XmlParser.cpp58
-rw-r--r--tools/osm-simplify/TagsFilter.cpp2
-rw-r--r--tools/osm-simplify/main.cpp6
-rw-r--r--tools/osm-sisyphus/jobmanager.cpp6
-rw-r--r--tools/osm-sisyphus/main.cpp6
-rw-r--r--tools/pntreplace/svgxmlhandler.cpp2
-rw-r--r--tools/poly2kml/main.cpp14
-rw-r--r--tools/routing-instructions/main.cpp2
-rw-r--r--tools/shp2pn2/shp2pn2.cpp2
-rw-r--r--tools/speaker-files/main.cpp2
-rw-r--r--tools/stars/stars.cpp14
-rw-r--r--tools/svg2pnt/svgxmlhandler.cpp4
133 files changed, 598 insertions, 586 deletions
diff --git a/examples/cpp/map-properties/main.cpp b/examples/cpp/map-properties/main.cpp
index 11805ff..6219e36 100644
--- a/examples/cpp/map-properties/main.cpp
+++ b/examples/cpp/map-properties/main.cpp
@@ -37,7 +37,7 @@ int main(int argc, char** argv)
mapWidget->setShowScaleBar(false);
foreach ( AbstractFloatItem * floatItem, mapWidget->floatItems() )
- if ( floatItem && floatItem->nameId() == "compass" ) {
+ if (floatItem && floatItem->nameId() == QLatin1String("compass")) {
// Put the compass onto the left hand side
floatItem->setPosition( QPoint( 10, 10 ) );
diff --git a/examples/cpp/marble-game/ClickOnThat.cpp b/examples/cpp/marble-game/ClickOnThat.cpp
index 6ffed5a..ccff8f6 100644
--- a/examples/cpp/marble-game/ClickOnThat.cpp
+++ b/examples/cpp/marble-game/ClickOnThat.cpp
@@ -144,7 +144,7 @@ void ClickOnThat::initiateGame()
if ( object->nodeType() == GeoDataTypes::GeoDataDocumentType ) {
GeoDataDocument *doc = static_cast<GeoDataDocument*>( object );
QFileInfo fileInfo( doc->fileName() );
- if ( fileInfo.fileName() == QString("boundaryplacemarks.cache") ) {
+ if (fileInfo.fileName() == QLatin1String("boundaryplacemarks.cache")) {
d->m_countryNames = doc;
break;
}
@@ -162,7 +162,7 @@ void ClickOnThat::initiateGame()
if ( object->nodeType() == GeoDataTypes::GeoDataDocumentType ) {
GeoDataDocument *const doc = static_cast<GeoDataDocument*>( object );
QFileInfo fileInfo( doc->fileName() );
- if ( fileInfo.fileName() == QString("ne_50m_admin_0_countries.pn2") ) {
+ if (fileInfo.fileName() == QLatin1String("ne_50m_admin_0_countries.pn2")) {
d->m_countryBoundaries = doc;
break;
}
diff --git a/examples/cpp/marble-game/CountryByFlag.cpp b/examples/cpp/marble-game/CountryByFlag.cpp
index a9e5ddb..940b1fb 100644
--- a/examples/cpp/marble-game/CountryByFlag.cpp
+++ b/examples/cpp/marble-game/CountryByFlag.cpp
@@ -96,7 +96,7 @@ void CountryByFlag::initiateGame()
if ( object->nodeType() == GeoDataTypes::GeoDataDocumentType ) {
GeoDataDocument *doc = static_cast<GeoDataDocument*>( object );
QFileInfo fileInfo( doc->fileName() );
- if ( fileInfo.fileName() == QString("boundaryplacemarks.cache") ) {
+ if (fileInfo.fileName() == QLatin1String("boundaryplacemarks.cache")) {
d->m_countryNames = doc;
break;
}
diff --git a/examples/cpp/marble-game/CountryByShape.cpp b/examples/cpp/marble-game/CountryByShape.cpp
index 3a838d8..f6e3193 100644
--- a/examples/cpp/marble-game/CountryByShape.cpp
+++ b/examples/cpp/marble-game/CountryByShape.cpp
@@ -107,7 +107,7 @@ void CountryByShape::initiateGame()
if ( object->nodeType() == GeoDataTypes::GeoDataDocumentType ) {
GeoDataDocument *doc = static_cast<GeoDataDocument*>( object );
QFileInfo fileInfo( doc->fileName() );
- if ( fileInfo.fileName() == QString("boundaryplacemarks.cache") ) {
+ if (fileInfo.fileName() == QLatin1String("boundaryplacemarks.cache")) {
d->m_countryNames = doc;
break;
}
@@ -125,7 +125,7 @@ void CountryByShape::initiateGame()
if ( object->nodeType() == GeoDataTypes::GeoDataDocumentType ) {
GeoDataDocument *const doc = static_cast<GeoDataDocument*>( object );
QFileInfo fileInfo( doc->fileName() );
- if ( fileInfo.fileName() == QString("ne_50m_admin_0_countries.pn2") ) {
+ if (fileInfo.fileName() == QLatin1String("ne_50m_admin_0_countries.pn2")) {
d->m_countryBoundaries = doc;
break;
}
diff --git a/examples/cpp/marble-game/GameMainWindow.cpp b/examples/cpp/marble-game/GameMainWindow.cpp
index 783ea4b..9d3b186 100644
--- a/examples/cpp/marble-game/GameMainWindow.cpp
+++ b/examples/cpp/marble-game/GameMainWindow.cpp
@@ -91,11 +91,11 @@ void Private::setupMarbleWidget()
m_marbleWidget->setMapThemeId( "earth/political/political.dgml" );
foreach ( RenderPlugin *renderPlugin, m_marbleWidget->renderPlugins() ) {
- if ( renderPlugin->nameId() == "stars"
- || renderPlugin->nameId() == "overviewmap"
- || renderPlugin->nameId() == "compass"
- || renderPlugin->nameId() == "scalebar"
- || renderPlugin->nameId() == "navigation" )
+ if (renderPlugin->nameId() == QLatin1String("stars")
+ || renderPlugin->nameId() == QLatin1String("overviewmap")
+ || renderPlugin->nameId() == QLatin1String("compass")
+ || renderPlugin->nameId() == QLatin1String("scalebar")
+ || renderPlugin->nameId() == QLatin1String("navigation"))
{
renderPlugin->setVisible( false );
}
@@ -202,7 +202,7 @@ void MainWindow::browseMapButtonClicked()
GeoDataDocument *doc = static_cast<GeoDataDocument*>( object );
QFileInfo fileInfo( doc->fileName() );
QString fileName = fileInfo.fileName();
- if ( fileName == QString("boundaryplacemarks.cache") ) {
+ if (fileName == QLatin1String("boundaryplacemarks.cache")) {
doc->setVisible( true );
d->m_marbleWidget->model()->treeModel()->updateFeature( doc );
d->m_marbleWidget->setHighlightEnabled( true );
diff --git a/examples/cpp/squad-interpolation/squad-interpolation.cpp b/examples/cpp/squad-interpolation/squad-interpolation.cpp
index 4e3f733..02df6aa 100644
--- a/examples/cpp/squad-interpolation/squad-interpolation.cpp
+++ b/examples/cpp/squad-interpolation/squad-interpolation.cpp
@@ -153,7 +153,7 @@ void MyPaintLayer::addRandomCity ( double minDistance, double maxDistance )
Q_ASSERT ( object );
if ( object->nodeType() == GeoDataTypes::GeoDataDocumentType ) {
GeoDataDocument* document = static_cast<GeoDataDocument*> ( object );
- if ( document->name() == "cityplacemarks" ) {
+ if (document->name() == QLatin1String("cityplacemarks")) {
QVector<GeoDataPlacemark*> placemarks = document->placemarkList();
for ( int i = qrand() % placemarks.size(); i < placemarks.size(); ++i ) {
double const distance = EARTH_RADIUS * distanceSphere ( m_cities.last(), placemarks[i]->coordinate() );
diff --git a/src/apps/marble-kde/marble_part.cpp b/src/apps/marble-kde/marble_part.cpp
index 543722b..2b00b9b 100644
--- a/src/apps/marble-kde/marble_part.cpp
+++ b/src/apps/marble-kde/marble_part.cpp
@@ -239,7 +239,7 @@ bool MarblePart::openFile()
QStringList allFileExtensions;
QStringList filters;
foreach ( const ParseRunnerPlugin *plugin, pluginManager->parsingRunnerPlugins() ) {
- if ( plugin->nameId() == "Cache" )
+ if (plugin->nameId() == QLatin1String("Cache"))
continue;
const QStringList fileExtensions = plugin->fileExtensions().replaceInStrings( QRegExp( "^" ), "*." );
@@ -485,7 +485,7 @@ void MarblePart::readSettings()
KConfigGroup pluginGroup = profileGroup.group( pluginName );
profile.pluginSettings().insert( pluginName, QHash<QString, QVariant>() );
foreach ( const QString& key, pluginGroup.keyList() ) {
- if ( key != "Enabled" ) {
+ if (key != QLatin1String("Enabled")) {
profile.pluginSettings()[ pluginName ].insert( key, pluginGroup.readEntry( key ) );
}
}
@@ -796,7 +796,7 @@ void MarblePart::setupActions()
QList<RenderPlugin *>::const_iterator i = pluginList.constBegin();
QList<RenderPlugin *>::const_iterator const end = pluginList.constEnd();
for (; i != end; ++i ) {
- if ( (*i)->nameId() == "crosshairs" ) {
+ if ((*i)->nameId() == QLatin1String("crosshairs")) {
actionCollection()->addAction( "show_crosshairs", (*i)->action() );
}
}
@@ -870,7 +870,7 @@ void MarblePart::setupActions()
QList<RenderPlugin *>::const_iterator it = pluginList.constBegin();
QList<RenderPlugin *>::const_iterator const itEnd = pluginList.constEnd();
for (; it != itEnd; ++it ) {
- if ((*it)->nameId() != "annotation") {
+ if ((*it)->nameId() != QLatin1String("annotation")) {
connect( (*it), SIGNAL(actionGroupsChanged()),
this, SLOT(createPluginMenus()) );
}
@@ -1508,7 +1508,7 @@ void MarblePart::applyPluginState()
KConfigGroup pluginGroup = profileGroup.group( key );
pluginGroup.writeEntry( "Enabled", true );
foreach ( const QString& settingKey, profile.pluginSettings()[ key ].keys() ) {
- Q_ASSERT( settingKey != "Enabled" );
+ Q_ASSERT(settingKey != QLatin1String("Enabled"));
pluginGroup.writeEntry( settingKey, profile.pluginSettings()[ key ][ settingKey ] );
}
}
@@ -1548,7 +1548,7 @@ void MarblePart::updateSettings()
QNetworkProxy proxy;
// Make sure that no proxy is used for an empty string or the default value:
- if ( MarbleSettings::proxyUrl().isEmpty() || MarbleSettings::proxyUrl() == "http://" ) {
+ if (MarbleSettings::proxyUrl().isEmpty() || MarbleSettings::proxyUrl() == QLatin1String("http://")) {
proxy.setType( QNetworkProxy::NoProxy );
} else {
if ( MarbleSettings::proxyType() == Marble::Socks5Proxy ) {
@@ -1793,7 +1793,7 @@ void MarblePart::printMapScreenShot()
void MarblePart::updateMapEditButtonVisibility( const QString &mapTheme )
{
Q_ASSERT( m_externalMapEditorAction );
- m_externalMapEditorAction->setVisible( mapTheme == "earth/openstreetmap/openstreetmap.dgml" );
+ m_externalMapEditorAction->setVisible(mapTheme == QLatin1String("earth/openstreetmap/openstreetmap.dgml"));
}
void MarblePart::fallBackToDefaultTheme()
diff --git a/src/apps/marble-qt/QtMainWindow.cpp b/src/apps/marble-qt/QtMainWindow.cpp
index 74cc033..becebec 100644
--- a/src/apps/marble-qt/QtMainWindow.cpp
+++ b/src/apps/marble-qt/QtMainWindow.cpp
@@ -704,7 +704,7 @@ void MainWindow::createPluginMenus()
// menus
const QList<QActionGroup*> *tmp_actionGroups = (*i)->actionGroups();
- if( (*i)->enabled() && tmp_actionGroups && (*i)->nameId() != "annotation" ) {
+ if ((*i)->enabled() && tmp_actionGroups && (*i)->nameId() != QLatin1String("annotation")) {
foreach( QActionGroup *ag, *tmp_actionGroups ) {
if( !ag->actions().isEmpty() ) {
m_pluginMenus.append( m_viewMenu->addSeparator() );
@@ -989,7 +989,7 @@ void MainWindow::openFile()
QStringList allFileExtensions;
QStringList filters;
foreach ( const ParseRunnerPlugin *plugin, pluginManager->parsingRunnerPlugins() ) {
- if ( plugin->nameId() == "Cache" )
+ if (plugin->nameId() == QLatin1String("Cache"))
continue;
const QStringList fileExtensions = plugin->fileExtensions().replaceInStrings( QRegExp( "^" ), "*." );
@@ -1285,7 +1285,7 @@ void MainWindow::readSettings(const QVariantMap& overrideSettings)
settings.beginGroup( pluginName );
profile.pluginSettings().insert( pluginName, QHash<QString, QVariant>() );
foreach ( const QString& key, settings.childKeys() ) {
- if ( key != "Enabled" ) {
+ if (key != QLatin1String("Enabled")) {
profile.pluginSettings()[ pluginName ].insert( key, settings.value( key ) );
}
}
@@ -1427,7 +1427,7 @@ void MainWindow::writeSettings()
settings.beginGroup( key );
settings.setValue( "Enabled", true );
foreach ( const QString& settingKey, profile.pluginSettings()[ key ].keys() ) {
- Q_ASSERT( settingKey != "Enabled" );
+ Q_ASSERT(settingKey != QLatin1String("Enabled"));
settings.setValue( settingKey, profile.pluginSettings()[ key ][ settingKey ] );
}
settings.endGroup();
diff --git a/src/apps/marble-qt/qtmain.cpp b/src/apps/marble-qt/qtmain.cpp
index b2f6e14..96f542f 100644
--- a/src/apps/marble-qt/qtmain.cpp
+++ b/src/apps/marble-qt/qtmain.cpp
@@ -226,24 +226,22 @@ int main(int argc, char *argv[])
for ( int i = 1; i < args.count(); ++i ) {
const QString arg = args.at(i);
- if ( arg == "--timedemo" )
- {
+ if (arg == QLatin1String("--timedemo")) {
window->resize(900, 640);
MarbleTest marbleTest( window->marbleWidget() );
marbleTest.timeDemo();
return 0;
}
- else if( arg == "--fps" ) {
+ else if (arg == QLatin1String("--fps")) {
window->marbleControl()->marbleWidget()->setShowFrameRate( true );
}
- else if ( arg == "--tile-id" )
- {
- window->marbleControl()->marbleWidget()->setShowTileId(true);
+ else if (arg == QLatin1String("--tile-id")) {
+ window->marbleControl()->marbleWidget()->setShowTileId(true);
}
- else if( arg == "--runtimeTrace" ) {
+ else if (arg == QLatin1String("--runtimeTrace")) {
window->marbleControl()->marbleWidget()->setShowRuntimeTrace( true );
}
- else if( arg == "--debug-polygons" ) {
+ else if (arg == QLatin1String("--debug-polygons")) {
window->marbleControl()->marbleWidget()->setShowDebugPolygons( true );
}
else if ( i != dataPathIndex && QFile::exists( arg ) )
diff --git a/src/apps/marble-ui/ControlView.cpp b/src/apps/marble-ui/ControlView.cpp
index 2c7cf55..3bbb7d4 100644
--- a/src/apps/marble-ui/ControlView.cpp
+++ b/src/apps/marble-ui/ControlView.cpp
@@ -521,13 +521,11 @@ void ControlView::launchExternalMapEditor()
}
}
- if ( editor == "josm" )
- {
+ if (editor == QLatin1String("josm")) {
// JOSM, the java based editor
synchronizeWithExternalMapEditor( editor, "--download=%1,%4,%3,%2" );
}
- else if ( editor == "merkaartor" )
- {
+ else if (editor == QLatin1String("merkaartor")) {
// Merkaartor, a Qt based editor
QString argument = "osm://download/load_and_zoom?top=%1&right=%2&bottom=%3&left=%4";
synchronizeWithExternalMapEditor( editor, argument );
@@ -694,7 +692,7 @@ QList<QAction*> ControlView::setupDockWidgets( QMainWindow *mainWindow )
QList<RenderPlugin *>::const_iterator const end = renderPluginList.constEnd();
for (; i != end; ++i ) {
- if( (*i)->nameId() == "annotation" ) {
+ if ((*i)->nameId() == QLatin1String("annotation")) {
m_annotationPlugin = *i;
QObject::connect(m_annotationPlugin, SIGNAL(enabledChanged(bool)),
this, SLOT(updateAnnotationDockVisibility()));
@@ -830,7 +828,7 @@ void ControlView::updateAnnotationDock()
if( !tmp_actionGroups->isEmpty() ) {
bool firstToolbarFilled = false;
foreach( QAction *action, tmp_actionGroups->first()->actions() ) {
- if( action->objectName() == "toolbarSeparator" ) {
+ if (action->objectName() == QLatin1String("toolbarSeparator")) {
firstToolbarFilled = true;
} else {
if( !firstToolbarFilled ) {
diff --git a/src/lib/marble/DownloadRegionDialog.cpp b/src/lib/marble/DownloadRegionDialog.cpp
index 8aad209..31ffd13 100644
--- a/src/lib/marble/DownloadRegionDialog.cpp
+++ b/src/lib/marble/DownloadRegionDialog.cpp
@@ -329,7 +329,7 @@ QVector<TileCoordsPyramid> DownloadRegionDialog::region() const
break;
case RouteDownloadMethod:
qreal offset = d->m_routeOffsetSpinBox->value();
- if( d->m_routeOffsetSpinBox->suffix() == " km") {
+ if (d->m_routeOffsetSpinBox->suffix() == QLatin1String(" km")) {
offset *= KM2METER;
}
const GeoDataLineString waypoints = d->m_model->routingManager()->routingModel()->route().path();
@@ -455,7 +455,7 @@ void DownloadRegionDialog::updateTilesCount()
//~ plural There is a limit of %n tiles to download.
d->m_tileSizeInfo->setText( tr( "There is a limit of %n tile(s) to download.", "",
maxTilesCount ) );
- } else if ( themeId == "earth/openstreetmap/openstreetmap.dgml" ) {
+ } else if (themeId == QLatin1String("earth/openstreetmap/openstreetmap.dgml")) {
qreal tileDownloadSize = tilesCount * averageTileSize;
d->m_tileSizeInfo->setToolTip( tr( "Approximate size of the tiles to be downloaded" ) );
@@ -500,7 +500,7 @@ void DownloadRegionDialog::setOffsetUnit()
d->m_routeOffsetSpinBox->setValue( offset * METER2KM );
d->m_routeOffsetSpinBox->setSingleStep( 0.1 );
}
- else if( offset <= 1 && d->m_routeOffsetSpinBox->suffix() == " km" ) {
+ else if (offset <= 1 && d->m_routeOffsetSpinBox->suffix() == QLatin1String(" km")) {
d->m_routeOffsetSpinBox->setSuffix( " m" );
d->m_routeOffsetSpinBox->setRange( minimumRouteOffset, maximumRouteOffset );
d->m_routeOffsetSpinBox->setDecimals( 0 );
diff --git a/src/lib/marble/EditBookmarkDialog.cpp b/src/lib/marble/EditBookmarkDialog.cpp
index a3c5c5a..82bae90 100644
--- a/src/lib/marble/EditBookmarkDialog.cpp
+++ b/src/lib/marble/EditBookmarkDialog.cpp
@@ -268,7 +268,7 @@ GeoDataPlacemark EditBookmarkDialog::bookmark() const
if(d->m_widget != 0) {
const QString celestialName = d->m_widget->model()->planetId();
- if(celestialName != "earth") {
+ if (celestialName != QLatin1String("earth")) {
bookmark.extendedData().addValue( GeoDataData( "celestialBody", celestialName ) );
}
}
diff --git a/src/lib/marble/FileLoader.cpp b/src/lib/marble/FileLoader.cpp
index 2cb8bd3..28379e4 100644
--- a/src/lib/marble/FileLoader.cpp
+++ b/src/lib/marble/FileLoader.cpp
@@ -139,7 +139,7 @@ void FileLoader::run()
QFileInfo fileinfo( d->m_filepath );
QString path = fileinfo.path();
- if ( path == "." ) path.clear();
+ if (path == QLatin1String(".")) path.clear();
QString name = fileinfo.completeBaseName();
QString suffix = fileinfo.suffix();
diff --git a/src/lib/marble/FileStorageWatcher.cpp b/src/lib/marble/FileStorageWatcher.cpp
index ff103f9..742864e 100644
--- a/src/lib/marble/FileStorageWatcher.cpp
+++ b/src/lib/marble/FileStorageWatcher.cpp
@@ -108,10 +108,10 @@ void FileStorageWatcherThread::getCurrentCacheSize()
// planet/theme/tilelevel should be deeper than 4
if ( ( path.size() > basePathDepth + 3 ) &&
( path[basePathDepth + 2].toInt() >= maxBaseTileLevel ) &&
- ( ( suffix == "jpg"
- || suffix == "png"
- || suffix == "gif"
- || suffix == "svg" ) ) ) {
+ ((suffix == QLatin1String("jpg") ||
+ suffix == QLatin1String("png") ||
+ suffix == QLatin1String("gif") ||
+ suffix == QLatin1String("svg")))) {
dataSize += file.size();
m_filesCache.insert(file.lastModified(), file.absoluteFilePath());
}
diff --git a/src/lib/marble/FlyToEditWidget.cpp b/src/lib/marble/FlyToEditWidget.cpp
index e6f7e4f..03c3875 100644
--- a/src/lib/marble/FlyToEditWidget.cpp
+++ b/src/lib/marble/FlyToEditWidget.cpp
@@ -134,9 +134,9 @@ void FlyToEditWidget::save()
flyToElement()->setDuration(m_durationSpin->value());
- if( m_modeCombo->currentText() == "Smooth" ){
+ if (m_modeCombo->currentText() == QLatin1String("Smooth")) {
flyToElement()->setFlyToMode( GeoDataFlyTo::Smooth );
- } else if( m_modeCombo->currentText() == "Bounce" ){
+ } else if (m_modeCombo->currentText() == QLatin1String("Bounce")) {
flyToElement()->setFlyToMode( GeoDataFlyTo::Bounce );
}
diff --git a/src/lib/marble/GeoUriParser.cpp b/src/lib/marble/GeoUriParser.cpp
index 4819d62..74678a8 100644
--- a/src/lib/marble/GeoUriParser.cpp
+++ b/src/lib/marble/GeoUriParser.cpp
@@ -80,7 +80,7 @@ bool GeoUriParser::parse()
// this is not a bug! The '<=' was intended, otherwise we would skip that last Cgroups's data!
for ( int i = 4; i <= geoUriRegexp.captureCount(); ++i )
{
- if ( geoUriRegexp.capturedTexts()[i] == "crs" ) {
+ if (geoUriRegexp.capturedTexts()[i] == QLatin1String("crs")) {
foreach ( const QString& str, PlanetFactory::planetList()) {
if ( geoUriRegexp.captureCount() < i+1 ) {
i = geoUriRegexp.captureCount() + 1;
@@ -92,7 +92,7 @@ bool GeoUriParser::parse()
}
}
++i;
- } else if ( geoUriRegexp.capturedTexts()[i] == "u" ) {
+ } else if (geoUriRegexp.capturedTexts()[i] == QLatin1String("u")) {
mDebug() << "Captured uncertainity parameter, but this is not supported by Marble (yet).";
++i;
}
diff --git a/src/lib/marble/MapWizard.cpp b/src/lib/marble/MapWizard.cpp
index 4729948..ab683a3 100644
--- a/src/lib/marble/MapWizard.cpp
+++ b/src/lib/marble/MapWizard.cpp
@@ -276,7 +276,7 @@ void MapWizard::parseServerCapabilities( QNetworkReply* reply )
d->format = format.text().right( format.text().length() - format.text().indexOf( '/' ) - 1 ).toLower();
- if( d->format == "jpeg" ) {
+ if (d->format == QLatin1String("jpeg")) {
d->format = "jpg";
}
diff --git a/src/lib/marble/MarbleLegendBrowser.cpp b/src/lib/marble/MarbleLegendBrowser.cpp
index bd4b3be..4a46e25 100644
--- a/src/lib/marble/MarbleLegendBrowser.cpp
+++ b/src/lib/marble/MarbleLegendBrowser.cpp
@@ -188,7 +188,7 @@ void MarbleLegendBrowser::injectCheckBoxChecker()
void MarbleLegendBrowser::openLinkExternally( const QUrl &url )
{
- if ( url.scheme() == "tour" ) {
+ if (url.scheme() == QLatin1String("tour")) {
emit tourLinkClicked( "maps/"+url.host() + url.path() );
} else {
QDesktopServices::openUrl( url );
diff --git a/src/lib/marble/MarbleLocale.cpp b/src/lib/marble/MarbleLocale.cpp
index aa0f72f..c00c90c 100644
--- a/src/lib/marble/MarbleLocale.cpp
+++ b/src/lib/marble/MarbleLocale.cpp
@@ -149,7 +149,7 @@ QString MarbleLocale::languageCode()
QString code;
int index = lang.indexOf ( '_' );
- if ( lang == "C" ) {
+ if (lang == QLatin1String("C")) {
code = "en";
}
else if ( index != -1 ) {
diff --git a/src/lib/marble/MarbleMap.cpp b/src/lib/marble/MarbleMap.cpp
index b7bfd50..5836482 100644
--- a/src/lib/marble/MarbleMap.cpp
+++ b/src/lib/marble/MarbleMap.cpp
@@ -243,26 +243,26 @@ MarbleMapPrivate::MarbleMapPrivate( MarbleMap *parent, MarbleModel *model ) :
void MarbleMapPrivate::updateProperty( const QString &name, bool show )
{
// earth
- if ( name == "places" ) {
+ if (name == QLatin1String("places")) {
m_placemarkLayer.setShowPlaces( show );
- } else if ( name == "cities" ) {
+ } else if (name == QLatin1String("cities")) {
m_placemarkLayer.setShowCities( show );
- } else if ( name == "terrain" ) {
+ } else if (name == QLatin1String("terrain")) {
m_placemarkLayer.setShowTerrain( show );
- } else if ( name == "otherplaces" ) {
+ } else if (name == QLatin1String("otherplaces")) {
m_placemarkLayer.setShowOtherPlaces( show );
}
// other planets
- else if ( name == "landingsites" ) {
+ else if (name == QLatin1String("landingsites")) {
m_placemarkLayer.setShowLandingSites( show );
- } else if ( name == "craters" ) {
+ } else if (name == QLatin1String("craters")) {
m_placemarkLayer.setShowCraters( show );
- } else if ( name == "maria" ) {
+ } else if (name == QLatin1String("maria")) {
m_placemarkLayer.setShowMaria( show );
}
- else if ( name == "relief" ) {
+ else if (name == QLatin1String("relief")) {
m_textureLayer.setShowRelief( show );
}
@@ -634,7 +634,7 @@ bool MarbleMap::showCrosshairs() const
QList<RenderPlugin *>::const_iterator i = pluginList.constBegin();
QList<RenderPlugin *>::const_iterator const end = pluginList.constEnd();
for (; i != end; ++i ) {
- if ( (*i)->nameId() == "crosshairs" ) {
+ if ((*i)->nameId() == QLatin1String("crosshairs")) {
visible = (*i)->visible();
}
}
@@ -786,10 +786,10 @@ void MarbleMapPrivate::setDocument( QString key )
QString containername = data->sourceFile();
QString colorize = data->colorize();
if( key == containername ) {
- if( colorize == "land" ) {
+ if (colorize == QLatin1String("land")) {
m_textureLayer.addLandDocument( doc );
}
- if( colorize == "sea" ) {
+ if (colorize == QLatin1String("sea")) {
m_textureLayer.addSeaDocument( doc );
}
@@ -921,7 +921,7 @@ void MarbleMapPrivate::updateMapTheme()
TileCreator *tileCreator = new TileCreator(
sourceDir,
installMap,
- (role == "dem") ? "true" : "false" );
+ (role == QLatin1String("dem")) ? "true" : "false" );
tileCreator->setTileFormat( texture->fileFormat().toLower() );
QPointer<TileCreatorDialog> tileCreatorDlg = new TileCreatorDialog( tileCreator, 0 );
@@ -967,7 +967,7 @@ void MarbleMapPrivate::updateMapTheme()
TileCreator *tileCreator = new TileCreator(
sourceDir,
installMap,
- (role == "dem") ? "true" : "false" );
+ (role == QLatin1String("dem")) ? "true" : "false" );
tileCreator->setTileFormat( vectorTile->fileFormat().toLower() );
QPointer<TileCreatorDialog> tileCreatorDlg = new TileCreatorDialog( tileCreator, 0 );
@@ -997,14 +997,14 @@ void MarbleMapPrivate::updateMapTheme()
if( !m_model->mapTheme()->map()->filters().isEmpty() ) {
const GeoSceneFilter *filter= m_model->mapTheme()->map()->filters().first();
- if( filter->type() == "colorize" ) {
+ if (filter->type() == QLatin1String("colorize")) {
//no need to look up with MarbleDirs twice so they are left null for now
QList<const GeoScenePalette*> palette = filter->palette();
foreach (const GeoScenePalette *curPalette, palette ) {
- if( curPalette->type() == "sea" ) {
+ if (curPalette->type() == QLatin1String("sea")) {
seafile = MarbleDirs::path( curPalette->file() );
- } else if( curPalette->type() == "land" ) {
+ } else if (curPalette->type() == QLatin1String("land")) {
landfile = MarbleDirs::path( curPalette->file() );
}
}
@@ -1100,7 +1100,7 @@ void MarbleMap::setShowCompass( bool visible )
void MarbleMap::setShowAtmosphere( bool visible )
{
foreach ( RenderPlugin *plugin, renderPlugins() ) {
- if ( plugin->nameId() == "atmosphere" ) {
+ if (plugin->nameId() == QLatin1String("atmosphere")) {
plugin->setVisible( visible );
}
}
@@ -1114,7 +1114,7 @@ void MarbleMap::setShowCrosshairs( bool visible )
QList<RenderPlugin *>::const_iterator i = pluginList.constBegin();
QList<RenderPlugin *>::const_iterator const end = pluginList.constEnd();
for (; i != end; ++i ) {
- if ( (*i)->nameId() == "crosshairs" ) {
+ if ((*i)->nameId() == QLatin1String("crosshairs")) {
(*i)->setVisible( visible );
}
}
diff --git a/src/lib/marble/MarbleModel.cpp b/src/lib/marble/MarbleModel.cpp
index 4e5f21c..1adaaba 100644
--- a/src/lib/marble/MarbleModel.cpp
+++ b/src/lib/marble/MarbleModel.cpp
@@ -645,7 +645,7 @@ void MarbleModel::clearPersistentTileCache()
TileCreator *tileCreator = new TileCreator(
sourceDir,
installMap,
- (role == "dem") ? "true" : "false" );
+ (role == QLatin1String("dem")) ? "true" : "false" );
tileCreator->setTileFormat( texture->fileFormat().toLower() );
QPointer<TileCreatorDialog> tileCreatorDlg = new TileCreatorDialog( tileCreator, 0 );
diff --git a/src/lib/marble/MarbleWidget.cpp b/src/lib/marble/MarbleWidget.cpp
index f108103..ff1134a 100644
--- a/src/lib/marble/MarbleWidget.cpp
+++ b/src/lib/marble/MarbleWidget.cpp
@@ -759,7 +759,7 @@ void MarbleWidgetPrivate::updateMapTheme()
m_widget->setRadius( m_widget->radius() ); // Corrects zoom range, if needed
- if ( m_model.planetId() == "earth" ) {
+ if (m_model.planetId() == QLatin1String("earth")) {
m_map.addLayer( m_routingLayer );
}
@@ -830,7 +830,7 @@ void MarbleWidget::setSubSolarPointIconVisible( bool visible )
QList<RenderPlugin *>::const_iterator i = pluginList.constBegin();
QList<RenderPlugin *>::const_iterator const end = pluginList.constEnd();
for (; i != end; ++i ) {
- if ( (*i)->nameId() == "sun" ) {
+ if ((*i)->nameId() == QLatin1String("sun")) {
(*i)->setVisible( visible );
}
}
diff --git a/src/lib/marble/MarbleWidgetPopupMenu.cpp b/src/lib/marble/MarbleWidgetPopupMenu.cpp
index 74f29bc..278cde5 100644
--- a/src/lib/marble/MarbleWidgetPopupMenu.cpp
+++ b/src/lib/marble/MarbleWidgetPopupMenu.cpp
@@ -204,7 +204,7 @@ void MarbleWidgetPopupMenu::Private::setupDialogOsm( PopupLayer *popup, const Ge
if (data.containsTagKey("natural") && !data.tagValue("natural").isEmpty()){
QString natural = data.tagValue("natural");
natural[0] = natural[0].toUpper();
- if (natural == "Peak" && data.containsTagKey("ele") && !data.tagValue("ele").isEmpty()){
+ if (natural == QLatin1String("Peak") && data.containsTagKey("ele") && !data.tagValue("ele").isEmpty()) {
doc["details"] = natural + " - " + data.tagValue("ele") + " m";
} else {
doc["details"] = natural;
@@ -216,11 +216,11 @@ void MarbleWidgetPopupMenu::Private::setupDialogOsm( PopupLayer *popup, const Ge
if (data.containsTagKey("shop") && !data.tagValue("shop").isEmpty()){
QString shop = data.tagValue("shop");
shop[0] = shop[0].toUpper();
- if (shop == "Clothes" && data.containsTagKey("clothes") && !data.tagValue("clothes").isEmpty()){
+ 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 + ")";
- } else if (shop == "Clothes" && data.containsTagKey("designation") && !data.tagValue("designation").isEmpty()){
+ } 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 + ")";
@@ -365,18 +365,24 @@ void MarbleWidgetPopupMenu::Private::setupDialogCity( PopupLayer *popup, const G
doc["name"] = placemark->name();
QString roleString;
const QString role = placemark->role();
- if(role=="PPLC") {
+ if (role == QLatin1String("PPLC")) {
roleString = tr("National Capital");
- } else if(role=="PPL") {
+ } else if (role == QLatin1String("PPL")) {
roleString = tr("City");
- } else if(role=="PPLA") {
+ } else if (role == QLatin1String("PPLA")) {
roleString = tr("State Capital");
- } else if(role=="PPLA2") {
+ } else if (role == QLatin1String("PPLA2")) {
roleString = tr("County Capital");
- } else if(role=="PPLA3" || role=="PPLA4" ) {
+ } else if (role == QLatin1String("PPLA3") ||
+ role == QLatin1String("PPLA4")) {
roleString = tr("Capital");
- } else if(role=="PPLF" || role=="PPLG" || role=="PPLL" || role=="PPLQ" ||
- role=="PPLR" || role=="PPLS" || role=="PPLW" ) {
+ } else if (role == QLatin1String("PPLF") ||
+ role == QLatin1String("PPLG") ||
+ role == QLatin1String("PPLL") ||
+ role == QLatin1String("PPLQ") ||
+ role == QLatin1String("PPLR") ||
+ role == QLatin1String("PPLS") ||
+ role == QLatin1String("PPLW")) {
roleString = tr("Village");
}
@@ -502,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 != "." ? QUrl::fromLocalFile( basePath + "/" ) : QUrl();
+ QUrl const baseUrl = (basePath != QLatin1String(".")) ? QUrl::fromLocalFile( basePath + "/" ) : QUrl();
popup->setContent(doc.finalText(), baseUrl );
}
@@ -668,7 +674,7 @@ void MarbleWidgetPopupMenu::slotInfoDialog()
bool isSky = false;
if ( d->m_widget->model()->mapTheme() ) {
- isSky = d->m_widget->model()->mapTheme()->head()->target() == "sky";
+ isSky = d->m_widget->model()->mapTheme()->head()->target() == QLatin1String("sky");
}
popup->setSize(QSizeF(400, 400));
@@ -711,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 != "." ? QUrl::fromLocalFile( basePath + "/" ) : QUrl();
+ QUrl const baseUrl = (basePath != QLatin1String(".")) ? QUrl::fromLocalFile( basePath + "/" ) : QUrl();
popup->setContent(content, baseUrl );
}
diff --git a/src/lib/marble/NewstuffModel.cpp b/src/lib/marble/NewstuffModel.cpp
index 58e2ab0..f8abbaf 100644
--- a/src/lib/marble/NewstuffModel.cpp
+++ b/src/lib/marble/NewstuffModel.cpp
@@ -466,7 +466,7 @@ void NewstuffModelPrivate::readValue( const QDomNode &node, const QString &key,
} else {
for ( int i=0; i<matches.size(); ++i ) {
if ( matches.at( i ).attributes().contains( "lang" ) &&
- matches.at( i ).attributes().namedItem( "lang").toAttr().value() == "en" ) {
+ matches.at( i ).attributes().namedItem( "lang").toAttr().value() == QLatin1String("en")) {
*target = T(matches.at( i ).toElement().text());
return;
}
diff --git a/src/lib/marble/PlanetFactory.cpp b/src/lib/marble/PlanetFactory.cpp
index 80bc61c..ba5594c 100644
--- a/src/lib/marble/PlanetFactory.cpp
+++ b/src/lib/marble/PlanetFactory.cpp
@@ -44,7 +44,7 @@ Planet PlanetFactory::construct( const QString &id )
// constants taken from http://aa.quae.nl/en/reken/zonpositie.html
- if ( id == "mercury" ) {
+ if (id == QLatin1String("mercury")) {
planet.setM_0( 174.7948*DEG2RAD );
planet.setM_1( 4.09233445*DEG2RAD );
planet.setC_1( 23.4400*DEG2RAD );
@@ -60,7 +60,7 @@ Planet PlanetFactory::construct( const QString &id )
planet.setRadius( 2440000.0 );
planet.setName( "Mercury" );
planet.setHasAtmosphere( false );
- } else if ( id == "venus" ) {
+ } else if (id == QLatin1String("venus")) {
planet.setM_0( 50.4161*DEG2RAD );
planet.setM_1( 1.60213034*DEG2RAD );
planet.setC_1( 0.7758*DEG2RAD );
@@ -77,7 +77,7 @@ Planet PlanetFactory::construct( const QString &id )
planet.setName( "Venus" );
planet.setHasAtmosphere( true );
planet.setAtmosphereColor( Oxygen::sunYellow4 );
- } else if ( id == "earth" ) {
+ } else if (id == QLatin1String("earth")) {
planet.setM_0( 357.5291*DEG2RAD );
planet.setM_1( 0.98560028*DEG2RAD );
planet.setC_1( 1.9148*DEG2RAD );
@@ -94,7 +94,7 @@ Planet PlanetFactory::construct( const QString &id )
planet.setName( "Earth" );
planet.setHasAtmosphere( true );
planet.setAtmosphereColor( Qt::white );
- } else if ( id == "mars" ) {
+ } else if (id == QLatin1String("mars")) {
planet.setM_0( 19.3730*DEG2RAD );
planet.setM_1( 0.52402068*DEG2RAD );
planet.setC_1( 10.6912*DEG2RAD );
@@ -111,7 +111,7 @@ Planet PlanetFactory::construct( const QString &id )
planet.setName( "Mars" );
planet.setHasAtmosphere( true );
planet.setAtmosphereColor( Oxygen::hotOrange2 );
- } else if ( id == "jupiter" ) {
+ } else if (id == QLatin1String("jupiter")) {
planet.setM_0( 20.0202*DEG2RAD );
planet.setM_1( 0.08308529*DEG2RAD );
planet.setC_1( 5.5549*DEG2RAD );
@@ -128,7 +128,7 @@ Planet PlanetFactory::construct( const QString &id )
planet.setName( "Jupiter" );
planet.setHasAtmosphere( true );
planet.setAtmosphereColor( Oxygen::sunYellow2 );
- } else if ( id == "saturn" ) {
+ } else if (id == QLatin1String("saturn")) {
planet.setM_0( 317.0207*DEG2RAD );
planet.setM_1( 0.03344414*DEG2RAD );
planet.setC_1( 6.3585*DEG2RAD );
@@ -145,7 +145,7 @@ Planet PlanetFactory::construct( const QString &id )
planet.setName( "Saturn" );
planet.setHasAtmosphere( true );
planet.setAtmosphereColor( Oxygen::sunYellow2 );
- } else if ( id == "uranus" ) {
+ } else if (id == QLatin1String("uranus")) {
planet.setM_0( 141.0498*DEG2RAD );
planet.setM_1( 0.01172834*DEG2RAD );
planet.setC_1( 5.3042*DEG2RAD );
@@ -162,7 +162,7 @@ Planet PlanetFactory::construct( const QString &id )
planet.setName( "Uranus" );
planet.setHasAtmosphere( true );
planet.setAtmosphereColor( Oxygen::seaBlue4 );
- } else if ( id == "neptune" ) {
+ } else if (id == QLatin1String("neptune")) {
planet.setM_0( 256.2250*DEG2RAD );
planet.setM_1( 0.00598103*DEG2RAD );
planet.setC_1( 1.0302*DEG2RAD );
@@ -179,7 +179,7 @@ Planet PlanetFactory::construct( const QString &id )
planet.setName( "Neptune" );
planet.setHasAtmosphere( true );
planet.setAtmosphereColor( Oxygen::skyBlue2 );
- } else if ( id == "pluto" ) {
+ } else if (id == QLatin1String("pluto")) {
// dwarf planets ... (everybody likes pluto)
planet.setM_0( 14.882*DEG2RAD );
planet.setM_1( 0.00396*DEG2RAD );
@@ -196,20 +196,20 @@ Planet PlanetFactory::construct( const QString &id )
planet.setRadius( 1151000.0 );
planet.setName( "Pluto" );
planet.setHasAtmosphere( false );
- } else if ( id == "sun" ) {
+ } else if (id == QLatin1String("sun")) {
mDebug() << "WARNING: Creating Planet instance" << id << "with invalid orbital elements";
planet.setRadius( 695000000.0 );
//FIXME: fill in with valid data
planet.setName( "Sun" );
planet.setHasAtmosphere( true );
planet.setAtmosphereColor( Qt::white );
- } else if ( id == "moon" ) {
+ } else if (id == QLatin1String("moon")) {
mDebug() << "WARNING: Creating Planet instance" << id << "with invalid orbital elements";
planet.setRadius( 1738000.0 );
//FIXME: fill in with valid data
planet.setName( "Moon" );
planet.setHasAtmosphere( false );
- } else if ( id == "sky" ) {
+ } else if (id == QLatin1String("sky")) {
mDebug() << "WARNING: Creating Planet instance" << id << "with invalid orbital elements";
planet.setRadius( 10000000.0 );
planet.setName( "Sky" );
@@ -226,31 +226,31 @@ Planet PlanetFactory::construct( const QString &id )
QString PlanetFactory::localizedName( const QString &id )
{
- if ( id == "mercury" ) {
+ if (id == QLatin1String("mercury")) {
return QObject::tr("Mercury", "the planet");
- } else if ( id == "venus" ) {
+ } else if (id == QLatin1String("venus")) {
return QObject::tr("Venus", "the planet");
- } else if ( id == "earth" ) {
+ } else if (id == QLatin1String("earth")) {
return QObject::tr("Earth", "the planet");
- } else if ( id == "mars" ) {
+ } else if (id == QLatin1String("mars")) {
return QObject::tr("Mars", "the planet");
- } else if ( id == "jupiter" ) {
+ } else if (id == QLatin1String("jupiter")) {
return QObject::tr("Jupiter", "the planet");
- } else if ( id == "saturn" ) {
+ } else if (id == QLatin1String("saturn")) {
return QObject::tr("Saturn", "the planet");
- } else if ( id == "uranus" ) {
+ } else if (id == QLatin1String("uranus")) {
return QObject::tr("Uranus", "the planet");
- } else if ( id == "neptune" ) {
+ } else if (id == QLatin1String("neptune")) {
return QObject::tr("Neptune", "the planet");
// dwarf planets ... (everybody likes pluto)
- } else if ( id == "pluto" ) {
+ } else if (id == QLatin1String("pluto")) {
return QObject::tr("Pluto", "the planet");
// sun, moon and sky
- } else if ( id == "sun" ) {
+ } else if (id == QLatin1String("sun")) {
return QObject::tr("Sun", "the earth's star");
- } else if ( id == "moon" ) {
+ } else if (id == QLatin1String("moon")) {
return QObject::tr("Moon", "the earth's moon");
- } else if ( id == "sky" ) {
+ } else if (id == QLatin1String("sky")) {
return QObject::tr("Sky");
} else if ( id.isEmpty() ) {
mDebug() << "Warning: empty id";
diff --git a/src/lib/marble/QtMarbleConfigDialog.cpp b/src/lib/marble/QtMarbleConfigDialog.cpp
index 372e5e4..7575d05 100644
--- a/src/lib/marble/QtMarbleConfigDialog.cpp
+++ b/src/lib/marble/QtMarbleConfigDialog.cpp
@@ -197,7 +197,7 @@ void QtMarbleConfigDialog::syncSettings()
QNetworkProxy proxy;
// Make sure that no proxy is used for an empty string or the default value:
- if ( proxyUrl().isEmpty() || proxyUrl() == "http://" ) {
+ if (proxyUrl().isEmpty() || proxyUrl() == QLatin1String("http://")) {
proxy.setType( QNetworkProxy::NoProxy );
} else {
if ( proxyType() == Marble::Socks5Proxy ) {
@@ -302,11 +302,11 @@ void QtMarbleConfigDialog::readSettings()
d->ui_navigationSettings.kcfg_inertialEarthRotation->setChecked( inertialEarthRotation() );
d->ui_navigationSettings.kcfg_animateTargetVoyage->setChecked( animateTargetVoyage() );
int editorIndex = 0;
- if ( externalMapEditor() == "potlatch") {
+ if (externalMapEditor() == QLatin1String("potlatch")) {
editorIndex = 1;
- } else if ( externalMapEditor() == "josm") {
+ } else if (externalMapEditor() == QLatin1String("josm")) {
editorIndex = 2;
- } else if ( externalMapEditor() == "merkaartor") {
+ } else if (externalMapEditor() == QLatin1String("merkaartor")) {
editorIndex = 3;
}
d->ui_navigationSettings.kcfg_externalMapEditor->setCurrentIndex( editorIndex );
diff --git a/src/lib/marble/ServerLayout.cpp b/src/lib/marble/ServerLayout.cpp
index 63a8a24..4971b6d 100644
--- a/src/lib/marble/ServerLayout.cpp
+++ b/src/lib/marble/ServerLayout.cpp
@@ -131,7 +131,7 @@ QUrl WmsServerLayout::downloadUrl( const QUrl &prototypeUrl, const Marble::TileI
if ( !url.hasQueryItem( "styles" ) )
url.addQueryItem( "styles", "" );
if ( !url.hasQueryItem( "format" ) ) {
- if ( m_textureLayer->fileFormat().toLower() == "jpg" )
+ if (m_textureLayer->fileFormat().toLower() == QLatin1String("jpg"))
url.addQueryItem( "format", "image/jpeg" );
else
url.addQueryItem( "format", "image/" + m_textureLayer->fileFormat().toLower() );
diff --git a/src/lib/marble/StyleBuilder.cpp b/src/lib/marble/StyleBuilder.cpp
index 99dfac4..4bd3f60 100644
--- a/src/lib/marble/StyleBuilder.cpp
+++ b/src/lib/marble/StyleBuilder.cpp
@@ -931,7 +931,7 @@ GeoDataStyle::ConstPtr StyleBuilder::createStyle(const StyleParameters &paramete
else if (visualCategory == GeoDataFeature::Bathymetry) {
if (osmData.containsTagKey("ele")) {
QString elevation = osmData.tagValue("ele");
- if (elevation == "4000") {
+ if (elevation == QLatin1String("4000")) {
polyStyle.setColor("#a5c9c9");
lineStyle.setColor("#a5c9c9");
adjustStyle = true;
@@ -1016,7 +1016,11 @@ GeoDataStyle::ConstPtr StyleBuilder::createStyle(const StyleParameters &paramete
}
QString const accessValue = osmData.tagValue("access");
- if (accessValue == "private" || accessValue == "no" || accessValue == "agricultural" || accessValue == "delivery" || accessValue == "forestry") {
+ if (accessValue == QLatin1String("private") ||
+ accessValue == QLatin1String("no") ||
+ accessValue == QLatin1String("agricultural") ||
+ accessValue == QLatin1String("delivery") ||
+ accessValue == QLatin1String("forestry")) {
QColor polyColor = polyStyle.color();
qreal hue, sat, val;
polyColor.getHsvF(&hue, &sat, &val);
@@ -1063,7 +1067,7 @@ GeoDataStyle::ConstPtr StyleBuilder::createStyle(const StyleParameters &paramete
if (visualCategory == GeoDataFeature::Bathymetry) {
if (osmData.containsTagKey("ele")) {
QString elevation = osmData.tagValue("ele");
- if (elevation == "4000") {
+ if (elevation == QLatin1String("4000")) {
polyStyle.setColor("#a5c9c9");
lineStyle.setColor("#a5c9c9");
adjustStyle = true;
diff --git a/src/lib/marble/SunControlWidget.cpp b/src/lib/marble/SunControlWidget.cpp
index 6dc5bdd..7fc604d 100644
--- a/src/lib/marble/SunControlWidget.cpp
+++ b/src/lib/marble/SunControlWidget.cpp
@@ -114,7 +114,7 @@ void SunControlWidget::showEvent( QShowEvent* event )
else
{
m_uiWidget->showShadow->setChecked( false );
- if( m_shadow == "shadow" )
+ if (m_shadow == QLatin1String("shadow"))
{
m_uiWidget->showShadow->setChecked( true );
}
diff --git a/src/lib/marble/TileCreator.cpp b/src/lib/marble/TileCreator.cpp
index d0c1c64..fba962f 100644
--- a/src/lib/marble/TileCreator.cpp
+++ b/src/lib/marble/TileCreator.cpp
@@ -43,7 +43,7 @@ class TileCreatorPrivate
m_verify( false ),
m_source( source )
{
- if ( m_dem == "true" ) {
+ if (m_dem == QLatin1String("true")) {
m_tileQuality = 70;
} else {
m_tileQuality = 85;
@@ -211,7 +211,7 @@ void TileCreator::cancelTileCreation()
void TileCreator::run()
{
- if ( d->m_resume && d->m_tileFormat == "jpg" && d->m_tileQuality != 100 ) {
+ if (d->m_resume && d->m_tileFormat == QLatin1String("jpg") && d->m_tileQuality != 100) {
qWarning() << "Resuming jpegs is only supported with tileQuality 100";
return;
}
@@ -320,13 +320,13 @@ void TileCreator::run()
return;
}
- if ( d->m_dem == "true" ) {
+ if (d->m_dem == QLatin1String("true")) {
tile = tile.convertToFormat(QImage::Format_Indexed8,
grayScalePalette,
Qt::ThresholdDither);
}
- bool ok = tile.save( tileName, d->m_tileFormat.toLatin1().data(), d->m_tileFormat == "jpg" ? 100 : d->m_tileQuality );
+ bool ok = tile.save(tileName, d->m_tileFormat.toLatin1().data(), d->m_tileFormat == QLatin1String("jpg") ? 100 : d->m_tileQuality);
if ( !ok )
mDebug() << "Error while writing Tile: " << tileName;
@@ -438,7 +438,7 @@ void TileCreator::run()
}
QImage tile = img_topleft;
- if ( d->m_dem == "true" ) {
+ if (d->m_dem == QLatin1String("true")) {
tile.setColorTable( grayScalePalette );
uchar* destLine;
@@ -510,7 +510,7 @@ void TileCreator::run()
// Saving at 100% JPEG quality to have a high-quality
// version to create the remaining needed tiles from.
- bool ok = tile.save( newTileName, d->m_tileFormat.toLatin1().data(), d->m_tileFormat == "jpg" ? 100 : d->m_tileQuality );
+ bool ok = tile.save(newTileName, d->m_tileFormat.toLatin1().data(), d->m_tileFormat == QLatin1String("jpg") ? 100 : d->m_tileQuality);
if ( ! ok )
mDebug() << "Error while writing Tile: " << newTileName;
}
@@ -527,7 +527,7 @@ void TileCreator::run()
}
mDebug() << "Tile creation completed.";
- if ( d->m_tileFormat == "jpg" && d->m_tileQuality != 100 ) {
+ if (d->m_tileFormat == QLatin1String("jpg") && d->m_tileQuality != 100) {
// Applying correct lower JPEG compression now that we created all tiles
int savedTilesCount = 0;
diff --git a/src/lib/marble/TourCaptureDialog.cpp b/src/lib/marble/TourCaptureDialog.cpp
index e0087bc..5a780ce 100644
--- a/src/lib/marble/TourCaptureDialog.cpp
+++ b/src/lib/marble/TourCaptureDialog.cpp
@@ -152,7 +152,7 @@ void TourCaptureDialog::recordNextFrame()
return;
}
- if( ui->startButton->text() == QString("Start") ) {
+ if (ui->startButton->text() == QLatin1String("Start")) {
return;
}
diff --git a/src/lib/marble/cloudsync/OwncloudSyncBackend.cpp b/src/lib/marble/cloudsync/OwncloudSyncBackend.cpp
index 380b84b..a66e41e 100644
--- a/src/lib/marble/cloudsync/OwncloudSyncBackend.cpp
+++ b/src/lib/marble/cloudsync/OwncloudSyncBackend.cpp
@@ -321,7 +321,7 @@ void OwncloudSyncBackend::checkAuthReply()
} else {
d->m_cloudSyncManager->setStatus( tr( "The server is not an ownCloud server" ), CloudSyncManager::Error);
}
- } else if ( result == "{\"message\":\"Current user is not logged in\"}" && statusCode == 401 ) {
+ } else if (result == QLatin1String("{\"message\":\"Current user is not logged in\"}") && statusCode == 401) {
// credientials were incorrect
d->m_cloudSyncManager->setStatus( tr( "Username or password are incorrect" ), CloudSyncManager::Error);
} else if ( result.contains("\"status\":\"success\"") && statusCode == 200 ) {
diff --git a/src/lib/marble/geodata/data/GeoDataVec2.cpp b/src/lib/marble/geodata/data/GeoDataVec2.cpp
index 0b08f1f..6735913 100644
--- a/src/lib/marble/geodata/data/GeoDataVec2.cpp
+++ b/src/lib/marble/geodata/data/GeoDataVec2.cpp
@@ -46,16 +46,18 @@ GeoDataVec2::GeoDataVec2(const qreal &x, const qreal &y, const QString &xunits,
GeoDataVec2::Unit GeoDataVec2Private::parseUnits( const QString &value )
{
- if ( value == "fraction" ) {
- return GeoDataVec2::Fraction;
- } else if ( value == "pixels" ) {
- return GeoDataVec2::Pixels;
- } else if ( value == "insetPixels" ) {
- return GeoDataVec2::InsetPixels;
- } else {
- mDebug() << "Warning: Unknown units value " << value << " - falling back to default 'fraction'";
- return GeoDataVec2::Fraction;
+ if (value == QLatin1String("fraction")) {
+ return GeoDataVec2::Fraction;
}
+ if (value == QLatin1String("pixels")) {
+ return GeoDataVec2::Pixels;
+ }
+ if (value == QLatin1String("insetPixels")) {
+ return GeoDataVec2::InsetPixels;
+ }
+
+ mDebug() << "Warning: Unknown units value " << value << " - falling back to default 'fraction'";
+ return GeoDataVec2::Fraction;
}
GeoDataVec2::GeoDataVec2( const Marble::GeoDataVec2 &other ) :
diff --git a/src/lib/marble/geodata/handlers/dgml/DgmlDownloadPolicyTagHandler.cpp b/src/lib/marble/geodata/handlers/dgml/DgmlDownloadPolicyTagHandler.cpp
index 425b858..f2c69d6 100644
--- a/src/lib/marble/geodata/handlers/dgml/DgmlDownloadPolicyTagHandler.cpp
+++ b/src/lib/marble/geodata/handlers/dgml/DgmlDownloadPolicyTagHandler.cpp
@@ -52,9 +52,9 @@ GeoNode* DgmlDownloadPolicyTagHandler::parse( GeoParser& parser ) const
// Attribute usage
DownloadUsage usage;
const QString usageStr = parser.attribute( dgmlAttr_usage ).trimmed();
- if ( usageStr == "Browse" )
+ if (usageStr == QLatin1String("Browse"))
usage = DownloadBrowse;
- else if ( usageStr == "Bulk" )
+ else if (usageStr == QLatin1String("Bulk"))
usage = DownloadBulk;
else {
qCritical( "Parse error: invalid attribute downloadPolicy/@usage" );
diff --git a/src/lib/marble/geodata/handlers/dgml/DgmlLicenseTagHandler.cpp b/src/lib/marble/geodata/handlers/dgml/DgmlLicenseTagHandler.cpp
index 551d23f..6ee50a3 100644
--- a/src/lib/marble/geodata/handlers/dgml/DgmlLicenseTagHandler.cpp
+++ b/src/lib/marble/geodata/handlers/dgml/DgmlLicenseTagHandler.cpp
@@ -31,13 +31,13 @@ GeoNode* DgmlLicenseTagHandler::parse( GeoParser& parser ) const
GeoStackItem parentItem = parser.parentElement();
if( parentItem.represents( dgmlTag_Head ) ) {
QString const attribution = parser.attribute(dgmlAttr_attribution).trimmed().toLower();
- if ( attribution == "never" ) {
+ if (attribution == QLatin1String("never")) {
parentItem.nodeAs<GeoSceneHead>()->license()->setAttribution( GeoSceneLicense::Never );
- } else if( attribution == "opt-in" || attribution == "optin" ) {
+ } else if (attribution == QLatin1String("opt-in") || attribution == QLatin1String("optin")) {
parentItem.nodeAs<GeoSceneHead>()->license()->setAttribution( GeoSceneLicense::OptIn );
- } else if( attribution.isEmpty() || attribution == "opt-out" || attribution == "optout" ) {
+ } else if (attribution.isEmpty() || attribution == QLatin1String("opt-out") || attribution == QLatin1String("optout")) {
parentItem.nodeAs<GeoSceneHead>()->license()->setAttribution( GeoSceneLicense::OptOut );
- } else if ( attribution == "always" ) {
+ } else if (attribution == QLatin1String("always")) {
parentItem.nodeAs<GeoSceneHead>()->license()->setAttribution( GeoSceneLicense::Always );
} else {
mDebug() << "Unknown license attribution value " << attribution << ", falling back to 'opt-out'.";
diff --git a/src/lib/marble/geodata/handlers/dgml/DgmlPenTagHandler.cpp b/src/lib/marble/geodata/handlers/dgml/DgmlPenTagHandler.cpp
index f071e61..b8027f1 100644
--- a/src/lib/marble/geodata/handlers/dgml/DgmlPenTagHandler.cpp
+++ b/src/lib/marble/geodata/handlers/dgml/DgmlPenTagHandler.cpp
@@ -53,12 +53,19 @@ GeoNode* DgmlPenTagHandler::parse(GeoParser& parser) const
}
if ( !style.isEmpty() ) {
- if ( style == "nopen" ) pen.setStyle( Qt::NoPen );
- if ( style == "solidline" ) pen.setStyle( Qt::SolidLine );
- if ( style == "dashline" ) pen.setStyle( Qt::DashLine );
- if ( style == "dotline" ) pen.setStyle( Qt::DotLine );
- if ( style == "dashdotline" ) pen.setStyle( Qt::DashDotLine );
- if ( style == "dashdotdotline" ) pen.setStyle( Qt::DashDotDotLine );
+ if (style == QLatin1String("nopen")) {
+ pen.setStyle(Qt::NoPen);
+ } else if (style == QLatin1String("solidline")) {
+ pen.setStyle(Qt::SolidLine);
+ } else if (style == QLatin1String("dashline")) {
+ pen.setStyle(Qt::DashLine);
+ } else if (style == QLatin1String("dotline")) {
+ pen.setStyle(Qt::DotLine);
+ } else if (style == QLatin1String("dashdotline")) {
+ pen.setStyle(Qt::DashDotLine);
+ } else if (style == QLatin1String("dashdotdotline")) {
+ pen.setStyle(Qt::DashDotDotLine);
+ }
}
if ( width != 0.0 ) {
diff --git a/src/lib/marble/geodata/handlers/dgml/DgmlProjectionTagHandler.cpp b/src/lib/marble/geodata/handlers/dgml/DgmlProjectionTagHandler.cpp
index 5da657f..7aef842 100644
--- a/src/lib/marble/geodata/handlers/dgml/DgmlProjectionTagHandler.cpp
+++ b/src/lib/marble/geodata/handlers/dgml/DgmlProjectionTagHandler.cpp
@@ -48,9 +48,9 @@ GeoNode* DgmlProjectionTagHandler::parse( GeoParser& parser ) const
const QString nameStr = parser.attribute( dgmlAttr_name ).trimmed();
if ( !nameStr.isEmpty() ) {
GeoSceneTileDataset::Projection projection = GeoSceneTileDataset::Equirectangular;
- if ( nameStr == "Equirectangular" )
+ if (nameStr == QLatin1String("Equirectangular"))
projection = GeoSceneTileDataset::Equirectangular;
- else if ( nameStr == "Mercator" )
+ else if (nameStr == QLatin1String("Mercator"))
projection = GeoSceneTileDataset::Mercator;
else
parser.raiseWarning( QString( "Value not allowed for attribute name: %1" ).arg( nameStr ));
diff --git a/src/lib/marble/geodata/handlers/dgml/DgmlStorageLayoutTagHandler.cpp b/src/lib/marble/geodata/handlers/dgml/DgmlStorageLayoutTagHandler.cpp
index 4b2a69e..bc1f218 100644
--- a/src/lib/marble/geodata/handlers/dgml/DgmlStorageLayoutTagHandler.cpp
+++ b/src/lib/marble/geodata/handlers/dgml/DgmlStorageLayoutTagHandler.cpp
@@ -80,15 +80,15 @@ GeoNode* DgmlStorageLayoutTagHandler::parse(GeoParser& parser) const
GeoSceneTileDataset::StorageLayout storageLayout = GeoSceneTileDataset::OpenStreetMap;
ServerLayout *serverLayout = 0;
const QString modeStr = parser.attribute(dgmlAttr_mode).trimmed();
- if ( modeStr == "OpenStreetMap" )
+ if (modeStr == QLatin1String("OpenStreetMap"))
serverLayout = new OsmServerLayout( texture );
- else if ( modeStr == "Custom" )
+ else if (modeStr == QLatin1String("Custom"))
serverLayout = new CustomServerLayout( texture );
- else if ( modeStr == "WebMapService" )
+ else if (modeStr == QLatin1String("WebMapService"))
serverLayout = new WmsServerLayout( texture );
- else if ( modeStr == "QuadTree" )
+ else if (modeStr == QLatin1String("QuadTree"))
serverLayout = new QuadTreeServerLayout( texture );
- else if ( modeStr == "TileMapService" )
+ else if (modeStr == QLatin1String("TileMapService"))
{
storageLayout = GeoSceneTileDataset::TileMapService;
serverLayout = new TmsServerLayout( texture );
diff --git a/src/lib/marble/geodata/handlers/kml/KmlAltitudeModeTagHandler.cpp b/src/lib/marble/geodata/handlers/kml/KmlAltitudeModeTagHandler.cpp
index c31a06d..f2cbdd5 100644
--- a/src/lib/marble/geodata/handlers/kml/KmlAltitudeModeTagHandler.cpp
+++ b/src/lib/marble/geodata/handlers/kml/KmlAltitudeModeTagHandler.cpp
@@ -49,9 +49,9 @@ GeoNode* KmlaltitudeModeTagHandler::parse( GeoParser& parser ) const
QString content = parser.readElementText().trimmed();
AltitudeMode mode;
- if( content == QString( "relativeToGround" ) ) {
+ if (content == QLatin1String("relativeToGround")) {
mode = RelativeToGround;
- } else if( content == QString( "absolute" ) ) {
+ } else if (content == QLatin1String("absolute")) {
mode = Absolute;
} else { // clampToGround is Standard
mode = ClampToGround;
diff --git a/src/lib/marble/geodata/handlers/kml/KmlBalloonVisibilityTagHandler.cpp b/src/lib/marble/geodata/handlers/kml/KmlBalloonVisibilityTagHandler.cpp
index e73015c..c44e2b9 100644
--- a/src/lib/marble/geodata/handlers/kml/KmlBalloonVisibilityTagHandler.cpp
+++ b/src/lib/marble/geodata/handlers/kml/KmlBalloonVisibilityTagHandler.cpp
@@ -29,12 +29,7 @@ GeoNode* KmlballoonVisibilityTagHandler::parse( GeoParser& parser ) const
QString content = parser.readElementText().trimmed();
- bool visible;
- if( content == QString( "1" ) ){
- visible = true;
- } else {
- visible = false;
- }
+ const bool visible = (content == QLatin1String("1"));
GeoStackItem parentItem = parser.parentElement();
diff --git a/src/lib/marble/geodata/handlers/kml/KmlColorModeTagHandler.cpp b/src/lib/marble/geodata/handlers/kml/KmlColorModeTagHandler.cpp
index c16f4d8..6201909 100644
--- a/src/lib/marble/geodata/handlers/kml/KmlColorModeTagHandler.cpp
+++ b/src/lib/marble/geodata/handlers/kml/KmlColorModeTagHandler.cpp
@@ -40,7 +40,7 @@ GeoNode* KmlcolorModeTagHandler::parse( GeoParser& parser ) const
GeoStackItem parentItem = parser.parentElement();
if ( parentItem.is<GeoDataColorStyle>() ) {
- if ( parser.readElementText().trimmed() == QString("random") ) {
+ if (parser.readElementText().trimmed() == QLatin1String("random")) {
parentItem.nodeAs<GeoDataColorStyle>()->setColorMode( GeoDataColorStyle::Random );
} else {
parentItem.nodeAs<GeoDataColorStyle>()->setColorMode( GeoDataColorStyle::Normal );
diff --git a/src/lib/marble/geodata/handlers/kml/KmlDisplayModeTagHandler.cpp b/src/lib/marble/geodata/handlers/kml/KmlDisplayModeTagHandler.cpp
index 852c8cd..c2f9d6c 100644
--- a/src/lib/marble/geodata/handlers/kml/KmlDisplayModeTagHandler.cpp
+++ b/src/lib/marble/geodata/handlers/kml/KmlDisplayModeTagHandler.cpp
@@ -32,10 +32,11 @@ GeoNode* KmldisplayModeTagHandler::parse( GeoParser& parser ) const
{
QString mode = parser.readElementText().trimmed();
GeoDataBalloonStyle::DisplayMode displayMode;
- if ( mode == "default" )
+ if (mode == QLatin1String("default")) {
displayMode = GeoDataBalloonStyle::Default;
- else if ( mode == "hide" )
+ } else if (mode == QLatin1String("hide")) {
displayMode = GeoDataBalloonStyle::Hide;
+ }
parentItem.nodeAs<GeoDataBalloonStyle>()->setDisplayMode( displayMode );
}
diff --git a/src/lib/marble/geodata/handlers/kml/KmlDocumentTagHandler.cpp b/src/lib/marble/geodata/handlers/kml/KmlDocumentTagHandler.cpp
index f5f4964..6d276fe 100644
--- a/src/lib/marble/geodata/handlers/kml/KmlDocumentTagHandler.cpp
+++ b/src/lib/marble/geodata/handlers/kml/KmlDocumentTagHandler.cpp
@@ -50,8 +50,7 @@ GeoNode* KmlDocumentTagHandler::parse(GeoParser& parser) const
return document;
}
- else if ( parentItem.qualifiedName().first == kmlTag_kml)
- {
+ else if (parentItem.qualifiedName().first == QLatin1String(kmlTag_kml)) {
GeoDataDocument* doc = geoDataDoc( parser );
KmlObjectTagHandler::parseIdentifiers( parser, doc );
return doc;
diff --git a/src/lib/marble/geodata/handlers/kml/KmlExtrudeTagHandler.cpp b/src/lib/marble/geodata/handlers/kml/KmlExtrudeTagHandler.cpp
index 941b88b..35ee7b4 100644
--- a/src/lib/marble/geodata/handlers/kml/KmlExtrudeTagHandler.cpp
+++ b/src/lib/marble/geodata/handlers/kml/KmlExtrudeTagHandler.cpp
@@ -68,11 +68,8 @@ GeoNode* KmlextrudeTagHandler::parse( GeoParser& parser ) const
if( validParents ) {
QString content = parser.readElementText().trimmed();
- if( content == QString( "1" ) ) {
- geometry->setExtrude( true );
- } else {
- geometry->setExtrude( false );
- }
+ const bool extrude = (content == QLatin1String("1"));
+ geometry->setExtrude(extrude);
}
return 0;
diff --git a/src/lib/marble/geodata/handlers/kml/KmlFlyToModeTagHandler.cpp b/src/lib/marble/geodata/handlers/kml/KmlFlyToModeTagHandler.cpp
index ea321aa..447238f 100644
--- a/src/lib/marble/geodata/handlers/kml/KmlFlyToModeTagHandler.cpp
+++ b/src/lib/marble/geodata/handlers/kml/KmlFlyToModeTagHandler.cpp
@@ -27,9 +27,9 @@ GeoNode* KmlflyToModeTagHandler::parse( GeoParser& parser ) const
QString content = parser.readElementText().trimmed();
GeoDataFlyTo::FlyToMode mode;
- if( content == "smooth" ) {
+ if (content == QLatin1String("smooth")) {
mode = GeoDataFlyTo::Smooth;
- } else if( content == "bounce" ) {
+ } else if (content == QLatin1String("bounce")) {
mode = GeoDataFlyTo::Bounce;
} else {
mDebug() << "Unknown mode " << content << ", using 'bounce' instead.";
diff --git a/src/lib/marble/geodata/handlers/kml/KmlFlyToViewTagHandler.cpp b/src/lib/marble/geodata/handlers/kml/KmlFlyToViewTagHandler.cpp
index 4741dfd..4bbda69 100644
--- a/src/lib/marble/geodata/handlers/kml/KmlFlyToViewTagHandler.cpp
+++ b/src/lib/marble/geodata/handlers/kml/KmlFlyToViewTagHandler.cpp
@@ -28,7 +28,7 @@ GeoNode* KmlflyToViewTagHandler::parse( GeoParser& parser ) const
if( parentItem.is<GeoDataNetworkLink>() ) {
QString content = parser.readElementText().trimmed();
GeoDataNetworkLink* networkLink = parentItem.nodeAs<GeoDataNetworkLink>();
- networkLink->setFlyToView( content == QString( "1" ) );
+ networkLink->setFlyToView(content == QLatin1String("1"));
}
return 0;
diff --git a/src/lib/marble/geodata/handlers/kml/KmlFolderTagHandler.cpp b/src/lib/marble/geodata/handlers/kml/KmlFolderTagHandler.cpp
index c55af2c..c489f91 100644
--- a/src/lib/marble/geodata/handlers/kml/KmlFolderTagHandler.cpp
+++ b/src/lib/marble/geodata/handlers/kml/KmlFolderTagHandler.cpp
@@ -48,7 +48,7 @@ GeoNode* KmlFolderTagHandler::parse(GeoParser& parser) const
parentPtr->append( folder );
return folder;
- } else if ( parentItem.qualifiedName().first == kmlTag_kml) {
+ } else if (parentItem.qualifiedName().first == QLatin1String(kmlTag_kml)) {
GeoDataDocument* doc = geoDataDoc( parser );
doc->append( folder );
return folder;
diff --git a/src/lib/marble/geodata/handlers/kml/KmlGridOriginTagHandler.cpp b/src/lib/marble/geodata/handlers/kml/KmlGridOriginTagHandler.cpp
index 4191d1a..bc6b672 100644
--- a/src/lib/marble/geodata/handlers/kml/KmlGridOriginTagHandler.cpp
+++ b/src/lib/marble/geodata/handlers/kml/KmlGridOriginTagHandler.cpp
@@ -31,9 +31,9 @@ GeoNode* KmlgridOriginTagHandler::parse( GeoParser& parser ) const
GeoDataImagePyramid::GridOrigin gridOrigin;
QString gridOriginText = parser.readElementText();
- if ( gridOriginText == "lowerLeft" ) {
+ if (gridOriginText == QLatin1String("lowerLeft")) {
gridOrigin = GeoDataImagePyramid::LowerLeft;
- } else if ( gridOriginText == "upperLeft" ) {
+ } else if (gridOriginText == QLatin1String("upperLeft")) {
gridOrigin = GeoDataImagePyramid::UpperLeft;
}
diff --git a/src/lib/marble/geodata/handlers/kml/KmlGroundOverlayTagHandler.cpp b/src/lib/marble/geodata/handlers/kml/KmlGroundOverlayTagHandler.cpp
index fef4f74..6555067 100644
--- a/src/lib/marble/geodata/handlers/kml/KmlGroundOverlayTagHandler.cpp
+++ b/src/lib/marble/geodata/handlers/kml/KmlGroundOverlayTagHandler.cpp
@@ -38,7 +38,7 @@ GeoNode* KmlGroundOverlayTagHandler::parse( GeoParser& parser ) const
parentItem.represents( kmlTag_Change ) || parentItem.represents( kmlTag_Create ) || parentItem.represents( kmlTag_Delete ) ) {
parentItem.nodeAs<GeoDataContainer>()->append( overlay );
return overlay;
- } else if ( parentItem.qualifiedName().first == kmlTag_kml ) {
+ } else if (parentItem.qualifiedName().first == QLatin1String(kmlTag_kml)) {
GeoDataDocument* doc = geoDataDoc( parser );
doc->append( overlay );
return overlay;
diff --git a/src/lib/marble/geodata/handlers/kml/KmlGxAltitudeModeTagHandler.cpp b/src/lib/marble/geodata/handlers/kml/KmlGxAltitudeModeTagHandler.cpp
index 93229d5..4449e3d 100644
--- a/src/lib/marble/geodata/handlers/kml/KmlGxAltitudeModeTagHandler.cpp
+++ b/src/lib/marble/geodata/handlers/kml/KmlGxAltitudeModeTagHandler.cpp
@@ -41,15 +41,15 @@ GeoNode* KmlaltitudeModeTagHandler::parse( GeoParser& parser ) const
QString content = parser.readElementText().trimmed();
AltitudeMode mode;
- if( content == QString( "relativeToGround" ) ) {
+ if (content == QLatin1String("relativeToGround")) {
mode = RelativeToGround;
- } else if( content == QString( "absolute" ) ) {
+ } else if (content == QLatin1String("absolute")) {
mode = Absolute;
- } else if( content == QString( "relativeToSeaFloor" ) ) {
+ } else if (content == QLatin1String("relativeToSeaFloor")) {
mode = RelativeToSeaFloor;
- } else if( content == QString( "clampToSeaFloor" ) ) {
+ } else if (content == QLatin1String("clampToSeaFloor")) {
mode = ClampToSeaFloor;
- }else if( content == QString( "clampToGround" ) ) {
+ } else if (content == QLatin1String("clampToGround")) {
mode = ClampToGround;
} else {
mDebug() << "Unknown altitude mode " << content << ", falling back to 'clampToGround'";
diff --git a/src/lib/marble/geodata/handlers/kml/KmlHotSpotTagHandler.cpp b/src/lib/marble/geodata/handlers/kml/KmlHotSpotTagHandler.cpp
index 034f152..e08725e 100644
--- a/src/lib/marble/geodata/handlers/kml/KmlHotSpotTagHandler.cpp
+++ b/src/lib/marble/geodata/handlers/kml/KmlHotSpotTagHandler.cpp
@@ -48,14 +48,23 @@ GeoNode* KmlhotSpotTagHandler::parse( GeoParser& parser ) const
GeoDataHotSpot::Units xunits;
GeoDataHotSpot::Units yunits;
-
- if( xu == QString( "pixels" ) ) xunits = GeoDataHotSpot::Pixels;
- else if( xu == QString( "insetPixels" ) ) xunits = GeoDataHotSpot::InsetPixels;
- else xunits = GeoDataHotSpot::Fraction;
- if( yu == QString( "pixels" ) ) yunits = GeoDataHotSpot::Pixels;
- else if( yu == QString( "insetPixels" ) ) yunits = GeoDataHotSpot::InsetPixels;
- else yunits = GeoDataHotSpot::Fraction;
-
+
+ if (xu == QLatin1String("pixels")) {
+ xunits = GeoDataHotSpot::Pixels;
+ } else if (xu == QLatin1String("insetPixels")) {
+ xunits = GeoDataHotSpot::InsetPixels;
+ } else {
+ xunits = GeoDataHotSpot::Fraction;
+ }
+
+ if (yu == QLatin1String("pixels")) {
+ yunits = GeoDataHotSpot::Pixels;
+ } else if (yu == QLatin1String("insetPixels")) {
+ yunits = GeoDataHotSpot::InsetPixels;
+ } else {
+ yunits = GeoDataHotSpot::Fraction;
+ }
+
parentItem.nodeAs<GeoDataIconStyle>()->setHotSpot( pf, xunits, yunits );
}
return 0;
diff --git a/src/lib/marble/geodata/handlers/kml/KmlListItemTypeTagHandler.cpp b/src/lib/marble/geodata/handlers/kml/KmlListItemTypeTagHandler.cpp
index f8ce519..36b97b1 100644
--- a/src/lib/marble/geodata/handlers/kml/KmlListItemTypeTagHandler.cpp
+++ b/src/lib/marble/geodata/handlers/kml/KmlListItemTypeTagHandler.cpp
@@ -32,20 +32,13 @@ GeoNode* KmllistItemTypeTagHandler::parse( GeoParser& parser ) const
{
QString typeText = parser.readElementText().trimmed();
GeoDataListStyle::ListItemType type;
- if ( typeText == "check" )
- {
+ if (typeText == QLatin1String("check")) {
type = GeoDataListStyle::Check;
- }
- else if ( typeText == "radioFolder" )
- {
+ } else if (typeText == QLatin1String("radioFolder")) {
type = GeoDataListStyle::RadioFolder;
- }
- else if ( typeText == "checkOffOnly" )
- {
+ } else if (typeText == QLatin1String("checkOffOnly")) {
type = GeoDataListStyle::CheckOffOnly;
- }
- else if ( typeText == "checkHideChildren" )
- {
+ } else if (typeText == QLatin1String("checkHideChildren")) {
type = GeoDataListStyle::CheckHideChildren;
}
else
diff --git a/src/lib/marble/geodata/handlers/kml/KmlOpenTagHandler.cpp b/src/lib/marble/geodata/handlers/kml/KmlOpenTagHandler.cpp
index e46bd31..fc8fa4f 100644
--- a/src/lib/marble/geodata/handlers/kml/KmlOpenTagHandler.cpp
+++ b/src/lib/marble/geodata/handlers/kml/KmlOpenTagHandler.cpp
@@ -42,7 +42,7 @@ GeoNode* KmlopenTagHandler::parse( GeoParser& parser ) const
if( parentItem.is<GeoDataFeature>() ) {
QString open = parser.readElementText().trimmed();
-/* if( open == QString( "1" ) )
+/* if (open == QLatin1String("1"))
parentItem.nodeAs<GeoDataFeature>()->setOpen( true );
else
parentItem.nodeAs<GeoDataFeature>()->setOpen( false );*/
diff --git a/src/lib/marble/geodata/handlers/kml/KmlRefreshModeTagHandler.cpp b/src/lib/marble/geodata/handlers/kml/KmlRefreshModeTagHandler.cpp
index 67a8d01..d506d19 100644
--- a/src/lib/marble/geodata/handlers/kml/KmlRefreshModeTagHandler.cpp
+++ b/src/lib/marble/geodata/handlers/kml/KmlRefreshModeTagHandler.cpp
@@ -19,11 +19,11 @@ GeoNode* KmlrefreshModeTagHandler::parse( GeoParser& parser ) const
GeoDataLink::RefreshMode mode;
if ( parentItem.is<GeoDataLink>()) {
- if( content == QString( "onChange" ) ) {
+ if (content == QLatin1String("onChange")) {
mode = GeoDataLink::OnChange;
- } else if( content == QString( "onExpire" ) ) {
+ } else if (content == QLatin1String("onExpire")) {
mode = GeoDataLink::OnExpire;
- } else if( content == QString( "onInterval" ) ) {
+ } else if (content == QLatin1String("onInterval")) {
mode = GeoDataLink::OnInterval;
} else {
mode = GeoDataLink::OnChange;
diff --git a/src/lib/marble/geodata/handlers/kml/KmlRefreshVisibilityTagHandler.cpp b/src/lib/marble/geodata/handlers/kml/KmlRefreshVisibilityTagHandler.cpp
index 8b6ec79..26d2b7a 100644
--- a/src/lib/marble/geodata/handlers/kml/KmlRefreshVisibilityTagHandler.cpp
+++ b/src/lib/marble/geodata/handlers/kml/KmlRefreshVisibilityTagHandler.cpp
@@ -30,7 +30,7 @@ GeoNode *KmlrefreshVisibilityTagHandler::parse(GeoParser & parser) const
if( parentItem.is<GeoDataNetworkLink>() ) {
QString content = parser.readElementText().trimmed();
GeoDataNetworkLink* networkLink = parentItem.nodeAs<GeoDataNetworkLink>();
- networkLink->setRefreshVisibility( content == QString( "1" ) );
+ networkLink->setRefreshVisibility(content == QLatin1String("1"));
}
return 0;
diff --git a/src/lib/marble/geodata/handlers/kml/KmlShapeTagHandler.cpp b/src/lib/marble/geodata/handlers/kml/KmlShapeTagHandler.cpp
index 05ed008..61b6152 100644
--- a/src/lib/marble/geodata/handlers/kml/KmlShapeTagHandler.cpp
+++ b/src/lib/marble/geodata/handlers/kml/KmlShapeTagHandler.cpp
@@ -33,11 +33,11 @@ GeoNode* KmlshapeTagHandler::parse( GeoParser& parser ) const
GeoDataPhotoOverlay::Shape shape;
QString shapeText = parser.readElementText();
- if ( shapeText == "rectangle" ) {
+ if (shapeText == QLatin1String("rectangle")) {
shape = GeoDataPhotoOverlay::Rectangle;
- } else if ( shapeText == "cylinder" ) {
+ } else if (shapeText == QLatin1String("cylinder")) {
shape = GeoDataPhotoOverlay::Cylinder;
- } else if ( shapeText == "sphere" ) {
+ } else if (shapeText == QLatin1String("sphere")) {
shape = GeoDataPhotoOverlay::Sphere;
} else {
mDebug() << "Unknown shape attribute" << shapeText << ", falling back to default value 'rectangle'";
diff --git a/src/lib/marble/geodata/handlers/kml/KmlSimpleFieldTagHandler.cpp b/src/lib/marble/geodata/handlers/kml/KmlSimpleFieldTagHandler.cpp
index 71aedf0..a623957 100644
--- a/src/lib/marble/geodata/handlers/kml/KmlSimpleFieldTagHandler.cpp
+++ b/src/lib/marble/geodata/handlers/kml/KmlSimpleFieldTagHandler.cpp
@@ -57,25 +57,25 @@ GeoNode* KmlSimpleFieldTagHandler::parse( GeoParser& parser ) const
GeoDataSimpleField::SimpleFieldType KmlSimpleFieldTagHandler::resolveType( const QString& type )
{
GeoDataSimpleField::SimpleFieldType fieldType;
- if ( type == QString("string") ) {
+ if (type == QLatin1String("string")) {
fieldType = GeoDataSimpleField::String;
}
- else if ( type == QString("int") ) {
+ else if (type == QLatin1String("int")) {
fieldType = GeoDataSimpleField::Int;
}
- else if ( type == QString("unit") ) {
+ else if (type == QLatin1String("unit")) {
fieldType = GeoDataSimpleField::UInt;
}
- else if ( type == QString("short") ) {
+ else if (type == QLatin1String("short")) {
fieldType = GeoDataSimpleField::Short;
}
- else if ( type == QString("ushort") ) {
+ else if (type == QLatin1String("ushort")) {
fieldType = GeoDataSimpleField::UShort;
}
- else if ( type == QString("float") ) {
+ else if (type == QLatin1String("float")) {
fieldType = GeoDataSimpleField::Float;
}
- else if ( type == QString("double") ) {
+ else if (type == QLatin1String("double")) {
fieldType = GeoDataSimpleField::Double;
}
else {
diff --git a/src/lib/marble/geodata/handlers/kml/KmlStateTagHandler.cpp b/src/lib/marble/geodata/handlers/kml/KmlStateTagHandler.cpp
index 278c700..a34d0e9 100644
--- a/src/lib/marble/geodata/handlers/kml/KmlStateTagHandler.cpp
+++ b/src/lib/marble/geodata/handlers/kml/KmlStateTagHandler.cpp
@@ -36,17 +36,17 @@ GeoNode* KmlstateTagHandler::parse( GeoParser& parser ) const
QStringList iconStateTextList = value.split(QLatin1Char(' '));
foreach( const QString &value, iconStateTextList ) {
- if ( value == "open" ) {
+ if (value == QLatin1String("open")) {
itemIconState |= GeoDataItemIcon::Open;
- } else if ( value == "closed" ) {
+ } else if (value == QLatin1String("closed")) {
itemIconState |= GeoDataItemIcon::Closed;
- } else if ( value == "error" ) {
+ } else if (value == QLatin1String("error")) {
itemIconState |= GeoDataItemIcon::Error;
- } else if ( value == "fetching0" ) {
+ } else if (value == QLatin1String("fetching0")) {
itemIconState |= GeoDataItemIcon::Fetching0;
- } else if ( value == "fetching1" ) {
+ } else if (value == QLatin1String("fetching1")) {
itemIconState |= GeoDataItemIcon::Fetching1;
- } else if ( value == "fetching2" ) {
+ } else if (value == QLatin1String("fetching2")) {
itemIconState |= GeoDataItemIcon::Fetching2;
}
else {
diff --git a/src/lib/marble/geodata/handlers/kml/KmlTessellateTagHandler.cpp b/src/lib/marble/geodata/handlers/kml/KmlTessellateTagHandler.cpp
index cca53bf..86112c8 100644
--- a/src/lib/marble/geodata/handlers/kml/KmlTessellateTagHandler.cpp
+++ b/src/lib/marble/geodata/handlers/kml/KmlTessellateTagHandler.cpp
@@ -48,29 +48,20 @@ GeoNode* KmltessellateTagHandler::parse( GeoParser& parser ) const
if( parentItem.is<GeoDataLineString>() ) {
GeoDataLineString* lineString = parentItem.nodeAs<GeoDataLineString>();
- if( content == QString( "1" ) ) {
- lineString->setTessellate( true );
- } else {
- lineString->setTessellate( false );
- }
+ const bool tesselate = (content == QLatin1String("1"));
+ lineString->setTessellate(tesselate);
} else if( parentItem.is<GeoDataLinearRing>() ) {
GeoDataLinearRing* linearRing = parentItem.nodeAs<GeoDataLinearRing>();
- if( content == QString( "1" ) ) {
- linearRing->setTessellate( true );
- } else {
- linearRing->setTessellate( false );
- }
+ const bool tesselate = (content == QLatin1String("1"));
+ linearRing->setTessellate(tesselate);
} else if( parentItem.is<GeoDataPolygon>() ) {
GeoDataPolygon* polygon = parentItem.nodeAs<GeoDataPolygon>();
- if( content == QString( "1" ) ) {
- polygon->setTessellate( true );
- } else {
- polygon->setTessellate( false );
- }
+ const bool tesselate = (content == QLatin1String("1"));
+ polygon->setTessellate(tesselate);
}
return 0;
diff --git a/src/lib/marble/geodata/handlers/kml/KmlViewRefreshModeTagHandler.cpp b/src/lib/marble/geodata/handlers/kml/KmlViewRefreshModeTagHandler.cpp
index 6782bc8..50c402c 100644
--- a/src/lib/marble/geodata/handlers/kml/KmlViewRefreshModeTagHandler.cpp
+++ b/src/lib/marble/geodata/handlers/kml/KmlViewRefreshModeTagHandler.cpp
@@ -30,11 +30,11 @@ GeoNode* KmlviewRefreshModeTagHandler::parse( GeoParser& parser ) const
QString content = parser.readElementText().trimmed();
GeoDataLink::ViewRefreshMode mode = GeoDataLink::Never;
- if( content == QString( "onStop" ) ) {
+ if (content == QLatin1String("onStop")) {
mode = GeoDataLink::OnStop;
- } else if( content == QString( "onRegion" ) ) {
+ } else if (content == QLatin1String("onRegion")) {
mode = GeoDataLink::OnRegion;
- } else if(content == QString("onRequest")) {
+ } else if (content == QLatin1String("onRequest")) {
mode = GeoDataLink::OnRequest;
}
diff --git a/src/lib/marble/geodata/handlers/kml/KmlVisibilityTagHandler.cpp b/src/lib/marble/geodata/handlers/kml/KmlVisibilityTagHandler.cpp
index 06bf078..c930915 100644
--- a/src/lib/marble/geodata/handlers/kml/KmlVisibilityTagHandler.cpp
+++ b/src/lib/marble/geodata/handlers/kml/KmlVisibilityTagHandler.cpp
@@ -41,10 +41,8 @@ GeoNode* KmlvisibilityTagHandler::parse( GeoParser& parser ) const
if( parentItem.is<GeoDataFeature>() ) {
QString visibility = parser.readElementText().trimmed();
- if( visibility == QString( "1" ) )
- parentItem.nodeAs<GeoDataFeature>()->setVisible( true );
- else
- parentItem.nodeAs<GeoDataFeature>()->setVisible( false );
+ const bool visible = (visibility == QLatin1String("1"));
+ parentItem.nodeAs<GeoDataFeature>()->setVisible(visible);
}
return 0;
diff --git a/src/lib/marble/geodata/handlers/kml/KmlplayModeTagHandler.cpp b/src/lib/marble/geodata/handlers/kml/KmlplayModeTagHandler.cpp
index bc5832d..f242923 100644
--- a/src/lib/marble/geodata/handlers/kml/KmlplayModeTagHandler.cpp
+++ b/src/lib/marble/geodata/handlers/kml/KmlplayModeTagHandler.cpp
@@ -29,7 +29,7 @@ GeoNode* KmlplayModeTagHandler::parse(GeoParser &parser) const
if (parentItem.is<GeoDataTourControl>()) {
GeoDataTourControl *control = parentItem.nodeAs<GeoDataTourControl>();
- if (parser.readElementText().trimmed().toLower() == "play") {
+ if (parser.readElementText().trimmed().toLower() == QLatin1String("play")) {
control->setPlayMode(GeoDataTourControl::Play);
} else {
control->setPlayMode(GeoDataTourControl::Pause);
diff --git a/src/lib/marble/geodata/parser/GeoDataParser.cpp b/src/lib/marble/geodata/parser/GeoDataParser.cpp
index 4c47302..dd21806 100644
--- a/src/lib/marble/geodata/parser/GeoDataParser.cpp
+++ b/src/lib/marble/geodata/parser/GeoDataParser.cpp
@@ -81,13 +81,15 @@ bool GeoDataParser::isValidElement(const QString& tagName) const
switch ((GeoDataSourceType) m_source) {
// TODO: case GeoData_GeoRSS:
- case GeoData_KML:
- return (namespaceUri() == kml::kmlTag_nameSpace20 ||
- namespaceUri() == kml::kmlTag_nameSpace21 ||
- namespaceUri() == kml::kmlTag_nameSpace22 ||
- namespaceUri() == kml::kmlTag_nameSpaceOgc22 ||
- namespaceUri() == kml::kmlTag_nameSpaceGx22 ||
- namespaceUri() == kml::kmlTag_nameSpaceMx );
+ case GeoData_KML: {
+ const QStringRef namespaceUri = this->namespaceUri();
+ return (namespaceUri == QLatin1String(kml::kmlTag_nameSpace20) ||
+ namespaceUri == QLatin1String(kml::kmlTag_nameSpace21) ||
+ namespaceUri == QLatin1String(kml::kmlTag_nameSpace22) ||
+ namespaceUri == QLatin1String(kml::kmlTag_nameSpaceOgc22) ||
+ namespaceUri == QLatin1String(kml::kmlTag_nameSpaceGx22) ||
+ namespaceUri == QLatin1String(kml::kmlTag_nameSpaceMx));
+ }
default:
break;
}
diff --git a/src/lib/marble/geodata/parser/GeoSceneParser.cpp b/src/lib/marble/geodata/parser/GeoSceneParser.cpp
index de976f2..32ad8ac 100644
--- a/src/lib/marble/geodata/parser/GeoSceneParser.cpp
+++ b/src/lib/marble/geodata/parser/GeoSceneParser.cpp
@@ -65,7 +65,7 @@ bool GeoSceneParser::isValidElement(const QString& tagName) const
switch ((GeoSceneSourceType) m_source) {
case GeoScene_DGML:
- return (namespaceUri() == dgml::dgmlTag_nameSpace20);
+ return (namespaceUri() == QLatin1String(dgml::dgmlTag_nameSpace20));
default:
break;
}
diff --git a/src/lib/marble/geodata/scene/GeoSceneMap.cpp b/src/lib/marble/geodata/scene/GeoSceneMap.cpp
index 451c343..1fc83a8 100644
--- a/src/lib/marble/geodata/scene/GeoSceneMap.cpp
+++ b/src/lib/marble/geodata/scene/GeoSceneMap.cpp
@@ -199,8 +199,8 @@ bool GeoSceneMap::hasTextureLayers() const
QVector<GeoSceneLayer*>::const_iterator it = d->m_layers.constBegin();
QVector<GeoSceneLayer*>::const_iterator end = d->m_layers.constEnd();
for (; it != end; ++it) {
- if ( ( (*it)->backend() == dgml::dgmlValue_texture
- || (*it)->backend() == dgml::dgmlValue_vectortile ) && (*it)->datasets().count() > 0 )
+ if (((*it)->backend() == QLatin1String(dgml::dgmlValue_texture) ||
+ (*it)->backend() == QLatin1String(dgml::dgmlValue_vectortile)) && (*it)->datasets().count() > 0)
return true;
}
@@ -212,7 +212,7 @@ bool GeoSceneMap::hasVectorLayers() const
QVector<GeoSceneLayer*>::const_iterator it = d->m_layers.constBegin();
QVector<GeoSceneLayer*>::const_iterator end = d->m_layers.constEnd();
for (; it != end; ++it) {
- if ( ( (*it)->backend() == dgml::dgmlValue_vector ) && (*it)->datasets().count() > 0 )
+ if (((*it)->backend() == QLatin1String(dgml::dgmlValue_vector)) && (*it)->datasets().count() > 0)
return true;
}
diff --git a/src/lib/marble/geodata/writer/GeoDataDocumentWriter.cpp b/src/lib/marble/geodata/writer/GeoDataDocumentWriter.cpp
index 0537d12..4b37482 100644
--- a/src/lib/marble/geodata/writer/GeoDataDocumentWriter.cpp
+++ b/src/lib/marble/geodata/writer/GeoDataDocumentWriter.cpp
@@ -62,9 +62,10 @@ void GeoDataDocumentWriter::registerWriter(GeoWriterBackend *writer, const QStri
QString GeoDataDocumentWriter::determineDocumentIdentifier(const QString &filename)
{
QString const fileExtension = QFileInfo(filename).suffix().toLower();
- if (fileExtension == "kml") {
+ if (fileExtension == QLatin1String("kml")) {
return kml::kmlTag_nameSpaceOgc22;
- } else if (fileExtension == "osm") {
+ }
+ if (fileExtension == QLatin1String("osm")) {
return "0.6";
}
diff --git a/src/lib/marble/layers/PopupLayer.cpp b/src/lib/marble/layers/PopupLayer.cpp
index ced4f25..ca50364 100644
--- a/src/lib/marble/layers/PopupLayer.cpp
+++ b/src/lib/marble/layers/PopupLayer.cpp
@@ -63,7 +63,7 @@ PopupLayer::PopupLayer( MarbleWidget *marbleWidget, QObject *parent ) :
d( new Private( marbleWidget, this ) )
{
foreach (const RenderPlugin *renderPlugin, d->m_widget->renderPlugins()) {
- if( renderPlugin->nameId() == "crosshairs" ) {
+ if (renderPlugin->nameId() == QLatin1String("crosshairs")) {
d->m_hasCrosshairsPlugin = true;
break;
}
diff --git a/src/lib/marble/osm/OsmTagEditorWidget_p.cpp b/src/lib/marble/osm/OsmTagEditorWidget_p.cpp
index 72903a3..2069a7c 100644
--- a/src/lib/marble/osm/OsmTagEditorWidget_p.cpp
+++ b/src/lib/marble/osm/OsmTagEditorWidget_p.cpp
@@ -153,7 +153,7 @@ QStringList OsmTagEditorWidgetPrivate::generateTagFilter() const
bool condition;
QStringList tags, tagsAux;
QString type;
- if ( m_placemark->extendedData().value( "osmRelation" ).value().toString() == "yes" ) {
+ if (m_placemark->extendedData().value("osmRelation").value().toString() == QLatin1String("yes")) {
type = "Relation";
}
else {
@@ -199,7 +199,7 @@ QStringList OsmTagEditorWidgetPrivate::generateTagFilter() const
// If the placemark is a relation, recommend type=*
tags = QStringList() << "type=*";
- condition = type == "Relation";
+ condition = (type == QLatin1String("Relation"));
if ( condition ) {
addPattern( filter, osmData, tags );
}
@@ -344,10 +344,10 @@ bool OsmTagEditorWidgetPrivate::containsAny( const OsmPlacemarkData &osmData, co
QString key = tagSplit.at( 0 );
QString value = tagSplit.at( 1 );
- if ( value == "*" && osmData.containsTagKey( key ) ) {
+ if (value == QLatin1String("*") && osmData.containsTagKey(key)) {
return true;
}
- else if ( value != "*" && osmData.containsTag( key, value ) ) {
+ else if (value != QLatin1String("*") && osmData.containsTag(key, value)) {
return true;
}
}
diff --git a/src/lib/marble/routing/instructions/RoutingInstruction.cpp b/src/lib/marble/routing/instructions/RoutingInstruction.cpp
index 754012b..e3135c8 100644
--- a/src/lib/marble/routing/instructions/RoutingInstruction.cpp
+++ b/src/lib/marble/routing/instructions/RoutingInstruction.cpp
@@ -31,13 +31,17 @@ RoutingInstruction::RoutingInstruction( const RoutingWaypoint &item ) :
bool RoutingInstruction::append( const RoutingWaypoint &item, int angle )
{
- if ( m_points.size() && m_points.last().roadType() != "roundabout" && item.roadType() == "roundabout" ) {
+ if (m_points.size() &&
+ m_points.last().roadType() != QLatin1String("roundabout") &&
+ item.roadType() == QLatin1String("roundabout")) {
// Entering a roundabout. Merge with previous segment to avoid 'Enter the roundabout' instructions
m_points.push_back( item );
return true;
}
- if ( m_points.size() && m_points.last().roadType() == "roundabout" && item.roadType() != "roundabout" ) {
+ if (m_points.size() &&
+ m_points.last().roadType() == QLatin1String("roundabout") &&
+ item.roadType() != QLatin1String("roundabout")) {
// Exiting a roundabout
m_points.push_back( item );
return false;
@@ -58,7 +62,7 @@ bool RoutingInstruction::append( const RoutingWaypoint &item, int angle )
return angle >= 150 && angle <= 210;
} else {
- return item.roadType() == "roundabout" || item.roadName() == roadName();
+ return item.roadType() == QLatin1String("roundabout") || item.roadName() == roadName();
}
}
@@ -247,11 +251,11 @@ qreal RoutingInstruction::distanceToEnd() const
QString RoutingInstruction::nextRoadInstruction() const
{
- if ( roadType() == "roundabout" ) {
+ if (roadType() == QLatin1String("roundabout")) {
return QObject::tr( "Enter the roundabout." );
}
- if ( roadType() == "motorway_link" ) {
+ if (roadType() == QLatin1String("motorway_link")) {
QStringList motorways = QStringList() << "motorway" << "motorway_link";
bool const leaving = predecessor() && motorways.contains( predecessor()->roadType() );
if ( leaving ) {
diff --git a/src/plugins/positionprovider/flightgear/FlightGearPositionProviderPlugin.cpp b/src/plugins/positionprovider/flightgear/FlightGearPositionProviderPlugin.cpp
index 25b8471..cee5ad7 100644
--- a/src/plugins/positionprovider/flightgear/FlightGearPositionProviderPlugin.cpp
+++ b/src/plugins/positionprovider/flightgear/FlightGearPositionProviderPlugin.cpp
@@ -137,7 +137,7 @@ void FlightGearPositionProviderPlugin::parseNmeaSentence( const QString &sentenc
if ( sentence.startsWith( QLatin1String( "$GPRMC" ) ) ) {
QStringList const values = sentence.split( ',' );
if ( values.size() > 9 ) {
- if ( values[2] == "A" ) {
+ if (values[2] == QLatin1String("A")) {
m_speed = values[7].toDouble() * 0.514444; // knots => m/s
m_track = values[8].toDouble();
QString const date = values[9] + ' ' + values[1];
@@ -155,9 +155,9 @@ void FlightGearPositionProviderPlugin::parseNmeaSentence( const QString &sentenc
if ( values[6] == 0 ) {
m_status = PositionProviderStatusAcquiring; // no fix
} else {
- double const lat = parsePosition( values[2], values[3] == "S" );
- double const lon = parsePosition( values[4], values[5] == "W" );
- double const unitFactor = values[10] == "F" ? FT2M : 1.0;
+ double const lat = parsePosition(values[2], values[3] == QLatin1String("S"));
+ double const lon = parsePosition(values[4], values[5] == QLatin1String("W"));
+ double const unitFactor = values[10] == QLatin1String("F") ? FT2M : 1.0;
double const alt = unitFactor * values[9].toDouble();
m_position.set( lon, lat, alt, GeoDataCoordinates::Degree );
m_accuracy.level = GeoDataAccuracy::Detailed;
diff --git a/src/plugins/render/annotate/EditPolygonDialog.cpp b/src/plugins/render/annotate/EditPolygonDialog.cpp
index b7adc5d..1f7c70f 100644
--- a/src/plugins/render/annotate/EditPolygonDialog.cpp
+++ b/src/plugins/render/annotate/EditPolygonDialog.cpp
@@ -256,7 +256,7 @@ void EditPolygonDialog::updatePolygon()
// If there is not custom style initialized( default #polyline url is used ) and there is a osmTag-based style
// available, set it
const OsmTagEditorWidget::OsmTag suitableTag = d->m_osmTagEditorWidget->suitableTag();
- if (d->m_placemark->styleUrl() == "#polygon" && suitableTag != OsmTagEditorWidget::OsmTag()) {
+ if (d->m_placemark->styleUrl() == QLatin1String("#polygon") && suitableTag != OsmTagEditorWidget::OsmTag()) {
GeoDataFeature::GeoDataVisualCategory category = OsmPresetLibrary::osmVisualCategory( suitableTag );
d->m_placemark->setStyle( GeoDataStyle::Ptr() ); // first clear style so style gets set by setVisualCategory()
d->m_placemark->setVisualCategory( category );
diff --git a/src/plugins/render/annotate/EditPolylineDialog.cpp b/src/plugins/render/annotate/EditPolylineDialog.cpp
index d38f484..84258a8 100644
--- a/src/plugins/render/annotate/EditPolylineDialog.cpp
+++ b/src/plugins/render/annotate/EditPolylineDialog.cpp
@@ -220,7 +220,7 @@ void EditPolylineDialog::updatePolyline()
// If there is no custom style initialized( default #polyline url is used ) and there is a osmTag-based style
// available, set it
const OsmTagEditorWidget::OsmTag suitableTag = d->m_osmTagEditorWidget->suitableTag();
- if (d->m_placemark->styleUrl() == "#polyline" && suitableTag != OsmTagEditorWidget::OsmTag()) {
+ if (d->m_placemark->styleUrl() == QLatin1String("#polyline") && suitableTag != OsmTagEditorWidget::OsmTag()) {
GeoDataFeature::GeoDataVisualCategory category = OsmPresetLibrary::osmVisualCategory( suitableTag );
d->m_placemark->setStyle( GeoDataStyle::Ptr() ); // first clear style so style gets set by setVisualCategory()
d->m_placemark->setVisualCategory( category );
diff --git a/src/plugins/render/aprs/AprsGatherer.cpp b/src/plugins/render/aprs/AprsGatherer.cpp
index b4f2ae1..8180eb4 100644
--- a/src/plugins/render/aprs/AprsGatherer.cpp
+++ b/src/plugins/render/aprs/AprsGatherer.cpp
@@ -140,12 +140,12 @@ AprsGatherer::run()
QString callSign = matcher.cap( 1 );
qreal latitude = matcher.cap( 6 ).toFloat() +
( matcher.cap( 7 ).toFloat()/60 );
- if ( matcher.cap( 8 ) == "S" )
+ if (matcher.cap(8) == QLatin1String("S"))
latitude = - latitude;
qreal longitude = matcher.cap( 10 ).toFloat() +
( matcher.cap( 11 ).toFloat()/60 );
- if ( matcher.cap( 12 ) == "W" )
+ if (matcher.cap(12) == QLatin1String("W"))
longitude = - longitude;
addObject( callSign, latitude, longitude, canDoDirect,
diff --git a/src/plugins/render/crosshairs/CrosshairsPlugin.cpp b/src/plugins/render/crosshairs/CrosshairsPlugin.cpp
index d45d885..97145bc 100644
--- a/src/plugins/render/crosshairs/CrosshairsPlugin.cpp
+++ b/src/plugins/render/crosshairs/CrosshairsPlugin.cpp
@@ -187,7 +187,7 @@ void CrosshairsPlugin::readSettings()
break;
}
- if( QImageReader::imageFormat( m_theme ) == "svg" ) {
+ if (QImageReader::imageFormat(m_theme) == QLatin1String("svg")) {
delete m_svgobj;
m_svgobj = new QSvgRenderer( m_theme, this );
}
@@ -211,7 +211,7 @@ bool CrosshairsPlugin::render( GeoPainter *painter, ViewportParams *viewport,
Q_UNUSED( layer )
if ( m_crosshairs.isNull() ) {
- if( QImageReader::imageFormat( m_theme ) == "svg" ) {
+ if (QImageReader::imageFormat(m_theme) == QLatin1String("svg")) {
painter->setRenderHint( QPainter::Antialiasing, true );
m_crosshairs = QPixmap( QSize( 21, 21 ) );
m_crosshairs.fill( Qt::transparent );
diff --git a/src/plugins/render/earthquake/EarthquakeModel.cpp b/src/plugins/render/earthquake/EarthquakeModel.cpp
index 49e2668..83f5ada 100644
--- a/src/plugins/render/earthquake/EarthquakeModel.cpp
+++ b/src/plugins/render/earthquake/EarthquakeModel.cpp
@@ -56,7 +56,7 @@ void EarthquakeModel::setEndDate( const QDateTime& endDate )
void EarthquakeModel::getAdditionalItems( const GeoDataLatLonAltBox& box, qint32 number )
{
- if( marbleModel()->planetId() != "earth" ) {
+ if (marbleModel()->planetId() != QLatin1String("earth")) {
return;
}
diff --git a/src/plugins/render/eclipses/EclipsesPlugin.cpp b/src/plugins/render/eclipses/EclipsesPlugin.cpp
index 74e6ef3..e68c2b6 100644
--- a/src/plugins/render/eclipses/EclipsesPlugin.cpp
+++ b/src/plugins/render/eclipses/EclipsesPlugin.cpp
@@ -241,7 +241,7 @@ bool EclipsesPlugin::render( GeoPainter *painter,
Q_UNUSED( renderPos );
Q_UNUSED( layer );
- if( marbleModel()->planetId() == "earth" ) {
+ if (marbleModel()->planetId() == QLatin1String("earth")) {
foreach( EclipsesItem *item, m_model->items() ) {
if( item->takesPlaceAt( marbleModel()->clock()->dateTime() ) ) {
return renderItem( painter, item );
@@ -468,7 +468,7 @@ void EclipsesPlugin::updateMenuItemState()
// eclipses are only supported for earth based obervers at the moment
// so we disable the menu items for other celestial bodies
- bool active = ( marbleModel()->planetId() == "earth" );
+ const bool active = (marbleModel()->planetId() == QLatin1String("earth"));
m_eclipsesListMenu->setEnabled( active );
m_eclipsesMenuAction->setEnabled( active );
diff --git a/src/plugins/render/elevationprofilemarker/ElevationProfileMarker.cpp b/src/plugins/render/elevationprofilemarker/ElevationProfileMarker.cpp
index 45f29d2..2ea5f20 100644
--- a/src/plugins/render/elevationprofilemarker/ElevationProfileMarker.cpp
+++ b/src/plugins/render/elevationprofilemarker/ElevationProfileMarker.cpp
@@ -200,7 +200,7 @@ void ElevationProfileMarker::onGeoObjectAdded( GeoDataObject *object )
if ( !document )
return;
- if ( document->name() != "Elevation Profile" )
+ if (document->name() != QLatin1String("Elevation Profile"))
return;
if ( document->size() < 1 )
@@ -217,7 +217,7 @@ void ElevationProfileMarker::onGeoObjectRemoved( GeoDataObject *object )
if ( !document )
return;
- if ( document->name() != "Elevation Profile" )
+ if (document->name() != QLatin1String("Elevation Profile"))
return;
m_markerPlacemark = 0;
diff --git a/src/plugins/render/foursquare/FoursquareModel.cpp b/src/plugins/render/foursquare/FoursquareModel.cpp
index 9c4534f..97b4448 100644
--- a/src/plugins/render/foursquare/FoursquareModel.cpp
+++ b/src/plugins/render/foursquare/FoursquareModel.cpp
@@ -39,7 +39,7 @@ FoursquareModel::~FoursquareModel()
void FoursquareModel::getAdditionalItems( const GeoDataLatLonAltBox& box, qint32 number )
{
- if( marbleModel()->planetId() != "earth" ) {
+ if (marbleModel()->planetId() != QLatin1String("earth")) {
return;
}
diff --git a/src/plugins/render/graticule/GraticulePlugin.cpp b/src/plugins/render/graticule/GraticulePlugin.cpp
index 820149a..282df83 100644
--- a/src/plugins/render/graticule/GraticulePlugin.cpp
+++ b/src/plugins/render/graticule/GraticulePlugin.cpp
@@ -313,7 +313,7 @@ void GraticulePlugin::renderGrid( GeoPainter *painter, ViewportParams *viewport,
// Render the Prime Meridian and Antimeridian
GeoDataCoordinates::Notation notation = GeoDataCoordinates::defaultNotation();
- if (marbleModel()->planet()->id() != "sky" && notation != GeoDataCoordinates::Astro) {
+ if (marbleModel()->planet()->id() != QLatin1String("sky") && notation != GeoDataCoordinates::Astro) {
renderLongitudeLine( painter, 0.0, viewLatLonAltBox, 0.0, 0.0, tr( "Prime Meridian" ), mainPosition );
renderLongitudeLine( painter, 180.0, viewLatLonAltBox, 0.0, 0.0, tr( "Antimeridian" ), mainPosition );
}
@@ -556,16 +556,16 @@ void GraticulePlugin::renderUtmExceptions( GeoPainter *painter,
// This code renders the so called "exceptions" in the UTM coordinate grid
// See: http://en.wikipedia.org/wiki/Universal_Transverse_Mercator_coordinate_system#Exceptions
if ( northPolarGap == 6.0 && southPolarGap == 162.0) {
- if ( label == "33" ) {
+ if (label == QLatin1String("33")) {
renderLongitudeLine( painter, itStep-3.0, viewLatLonAltBox, northPolarGap,
southPolarGap, label, labelPositionFlags );
- } else if ( label == "35" ) {
+ } else if (label == QLatin1String("35")) {
renderLongitudeLine( painter, itStep-3.0, viewLatLonAltBox, northPolarGap,
southPolarGap, label, labelPositionFlags );
- } else if ( label == "37" ) {
+ } else if (label == QLatin1String("37")) {
renderLongitudeLine( painter, itStep-3.0, viewLatLonAltBox, northPolarGap,
southPolarGap, label, labelPositionFlags );
- } else if ( label == "32" || label == "34" || label == "36" ) {
+ } else if (label == QLatin1String("32") || label == QLatin1String("34") || label == QLatin1String("36")) {
// paint nothing
} else {
renderLongitudeLine( painter, itStep, viewLatLonAltBox, northPolarGap,
@@ -573,7 +573,7 @@ void GraticulePlugin::renderUtmExceptions( GeoPainter *painter,
}
}
else if ( northPolarGap == 26.0 && southPolarGap == 146.0 ) {
- if ( label == "32" ) {
+ if (label == QLatin1String("32")) {
renderLongitudeLine( painter, itStep-3.0, viewLatLonAltBox, northPolarGap,
southPolarGap, label, labelPositionFlags );
} else {
@@ -597,8 +597,8 @@ void GraticulePlugin::renderLongitudeLines( GeoPainter *painter,
return;
}
- GeoDataCoordinates::Notation notation = marbleModel()->planet()->id() == "sky" ? GeoDataCoordinates::Astro :
- GeoDataCoordinates::defaultNotation();
+ const bool isSky = (marbleModel()->planet()->id() == QLatin1String("sky"));
+ const GeoDataCoordinates::Notation notation = isSky ? GeoDataCoordinates::Astro : GeoDataCoordinates::defaultNotation();
// Set precision to 0 in UTM in order to show only zone number.
int precision = (notation == GeoDataCoordinates::UTM) ? 0 : -1;
@@ -708,7 +708,8 @@ void GraticulePlugin::initLineMaps( GeoDataCoordinates::Notation notation)
with 4 longitude lines (4 half-circles).
*/
- if (marbleModel()->planet()->id() == "sky" || notation == GeoDataCoordinates::Astro) {
+ if (marbleModel()->planet()->id() == QLatin1String("sky") ||
+ notation == GeoDataCoordinates::Astro) {
m_normalLineMap[100] = 4; // 6h
m_normalLineMap[1000] = 12; // 2h
m_normalLineMap[2000] = 24; // 1h
diff --git a/src/plugins/render/navigation/ArrowDiscWidget.cpp b/src/plugins/render/navigation/ArrowDiscWidget.cpp
index 2ca9727..7530711 100644
--- a/src/plugins/render/navigation/ArrowDiscWidget.cpp
+++ b/src/plugins/render/navigation/ArrowDiscWidget.cpp
@@ -107,7 +107,7 @@ void ArrowDiscWidget::mouseReleaseEvent( QMouseEvent *mouseEvent )
void ArrowDiscWidget::leaveEvent( QEvent* )
{
- if ( m_imagePath != "marble/navigation/navigational_arrows" ) {
+ if (m_imagePath != QLatin1String("marble/navigation/navigational_arrows")) {
m_imagePath = "marble/navigation/navigational_arrows";
repaint();
}
diff --git a/src/plugins/render/navigation/NavigationSlider.cpp b/src/plugins/render/navigation/NavigationSlider.cpp
index 3e0ff22..e87930f 100644
--- a/src/plugins/render/navigation/NavigationSlider.cpp
+++ b/src/plugins/render/navigation/NavigationSlider.cpp
@@ -49,7 +49,7 @@ QPixmap NavigationSlider::pixmap( const QString &id )
void NavigationSlider::enterEvent( QEvent * )
{
setSliderDown( false );
- if ( m_handleImagePath != "marble/navigation/navigational_slider_handle_hover" ) {
+ if (m_handleImagePath != QLatin1String("marble/navigation/navigational_slider_handle_hover")) {
m_handleImagePath = "marble/navigation/navigational_slider_handle_hover";
repaint();
}
@@ -71,7 +71,7 @@ void NavigationSlider::mouseMoveEvent( QMouseEvent *mouseEvent )
void NavigationSlider::mousePressEvent( QMouseEvent * )
{
setSliderDown( true );
- if ( m_handleImagePath != "marble/navigation/navigational_slider_handle_press" ) {
+ if (m_handleImagePath != QLatin1String("marble/navigation/navigational_slider_handle_press")) {
m_handleImagePath = "marble/navigation/navigational_slider_handle_press";
repaint();
}
@@ -80,7 +80,7 @@ void NavigationSlider::mousePressEvent( QMouseEvent * )
void NavigationSlider::mouseReleaseEvent( QMouseEvent * )
{
setSliderDown( false );
- if ( m_handleImagePath != "marble/navigation/navigational_slider_handle_hover" ) {
+ if (m_handleImagePath != QLatin1String("marble/navigation/navigational_slider_handle_hover")) {
m_handleImagePath = "marble/navigation/navigational_slider_handle_hover";
repaint();
}
@@ -89,7 +89,7 @@ void NavigationSlider::mouseReleaseEvent( QMouseEvent * )
void NavigationSlider::leaveEvent( QEvent * )
{
setSliderDown( false );
- if ( m_handleImagePath != "marble/navigation/navigational_slider_handle" ) {
+ if (m_handleImagePath != QLatin1String("marble/navigation/navigational_slider_handle")) {
m_handleImagePath = "marble/navigation/navigational_slider_handle";
repaint();
}
diff --git a/src/plugins/render/opencaching/OpenCachingModel.cpp b/src/plugins/render/opencaching/OpenCachingModel.cpp
index bb96668..c7b37cf 100644
--- a/src/plugins/render/opencaching/OpenCachingModel.cpp
+++ b/src/plugins/render/opencaching/OpenCachingModel.cpp
@@ -37,15 +37,15 @@ QHash<QString, QVariant> OpenCachingModelPrivate::parseCache( QXmlStreamReader&
{
QHash<QString, QVariant> cache;
while ( !reader.atEnd() ) {
- if ( reader.isStartElement() && reader.name() != "cache" ) {
- if( reader.name() == "id" ) {
+ if (reader.isStartElement() && reader.name() != QLatin1String("cache")) {
+ if (reader.name() == QLatin1String("id")) {
cache["id"] = reader.attributes().value("id").toString();
}
- else if( reader.name() != "attributes" && reader.name() != "attribute" ) {
+ else if (reader.name() != QLatin1String("attributes") && reader.name() != QLatin1String("attribute")) {
cache[reader.name().toString()] = reader.readElementText();
}
}
- else if( reader.isEndElement() && reader.name() == "cache" ) {
+ else if (reader.isEndElement() && reader.name() == QLatin1String("cache")) {
return cache;
}
reader.readNext();
@@ -57,15 +57,15 @@ QHash<QString, QVariant> OpenCachingModelPrivate::parseLogEntry( QXmlStreamReade
{
QHash<QString, QVariant> cacheLogEntry;
while ( !reader.atEnd() ) {
- if ( reader.isStartElement() && reader.name() != "cachelog" ) {
- if( reader.name() == "cacheid" ) {
+ if (reader.isStartElement() && reader.name() != QLatin1String("cachelog")) {
+ if (reader.name() == QLatin1String("cacheid")) {
cacheLogEntry["cacheid"] = reader.attributes().value( "id" ).toString();
}
else {
cacheLogEntry[reader.name().toString()] = reader.readElementText();
}
}
- else if( reader.isEndElement() && reader.name() == "cachelog" ) {
+ else if (reader.isEndElement() && reader.name() == QLatin1String("cachelog")) {
return cacheLogEntry;
}
reader.readNext();
@@ -77,15 +77,15 @@ QHash<QString, QVariant> OpenCachingModelPrivate::parseDescription( QXmlStreamRe
{
QHash<QString, QVariant> cacheDesc;
while ( !reader.atEnd() ) {
- if ( reader.isStartElement() && reader.name() != "cachedesc" ) {
- if( reader.name() == "cacheid" ) {
+ if (reader.isStartElement() && reader.name() != QLatin1String("cachedesc")) {
+ if (reader.name() == QLatin1String("cacheid")) {
cacheDesc["cacheid"] = reader.attributes().value( "id" ).toString();
}
else {
cacheDesc[reader.name().toString()] = reader.readElementText();
}
}
- else if( reader.isEndElement() && reader.name() == "cachedesc" ) {
+ else if (reader.isEndElement() && reader.name() == QLatin1String("cachedesc")) {
return cacheDesc;
}
reader.readNext();
@@ -143,7 +143,7 @@ void OpenCachingModel::getAdditionalItems( const GeoDataLatLonAltBox& box, const
{
Q_UNUSED( number );
- if( model->planetId() != "earth" ) {
+ if (model->planetId() != QLatin1String("earth")) {
return;
}
@@ -172,15 +172,15 @@ void OpenCachingModel::parseFile( const QByteArray& file )
continue;
}
if( token == QXmlStreamReader::StartElement ) {
- if( reader.name() == "cache" ) {
+ if (reader.name() == QLatin1String("cache") {
OpenCachingCache cache = d->parseCache( reader );
caches[cache.id()] = cache;
}
- else if( reader.name() == "cachedesc" ) {
+ else if (reader.name() == QLatin1String("cachedesc")) {
OpenCachingCacheDescription description = d->parseDescription( reader );
descriptions[description.cacheId()][description.language()] = description;
}
- else if( reader.name() == "cachelog" ) {
+ else if (reader.name() == QLatin1String("cachelog")) {
OpenCachingCacheLogEntry logEntry = d->parseLogEntry( reader );
logs[logEntry.cacheId()].addLogEntry( logEntry );
}
diff --git a/src/plugins/render/opencachingcom/OpenCachingComItem.cpp b/src/plugins/render/opencachingcom/OpenCachingComItem.cpp
index 83d56cb..d8d4cc0 100644
--- a/src/plugins/render/opencachingcom/OpenCachingComItem.cpp
+++ b/src/plugins/render/opencachingcom/OpenCachingComItem.cpp
@@ -46,8 +46,7 @@ OpenCachingComItem::OpenCachingComItem( const QVariantMap& cache, OpenCachingCom
setCoordinate( GeoDataCoordinates( cache["location"].toMap()["lon"].toReal(), cache["location"].toMap()["lat"].toReal(), 0.0, GeoDataCoordinates::Degree ) );
// Opencaching.Com does (in effect) this, so as do we..
- if ( m_cache["type"].toString() == "Unknown Cache" )
- {
+ if (m_cache["type"].toString() == QLatin1String("Unknown Cache")) {
m_cache["type"] = QString("Puzzle");
}
@@ -275,8 +274,7 @@ bool OpenCachingComItem::operator<( const AbstractDataPluginItem *other ) const
void OpenCachingComItem::addDownloadedFile( const QString &url, const QString &type )
{
- if (type == "description_and_logs")
- {
+ if (type == QLatin1String("description_and_logs")) {
QFile file( url );
if (! file.open( QIODevice::ReadOnly | QIODevice::Text ) )
{
diff --git a/src/plugins/render/opencachingcom/OpenCachingComModel.cpp b/src/plugins/render/opencachingcom/OpenCachingComModel.cpp
index f6fb3b9..55a2129 100644
--- a/src/plugins/render/opencachingcom/OpenCachingComModel.cpp
+++ b/src/plugins/render/opencachingcom/OpenCachingComModel.cpp
@@ -55,8 +55,7 @@ OpenCachingComModel::~OpenCachingComModel()
void OpenCachingComModel::getAdditionalItems( const GeoDataLatLonAltBox& box, qint32 number )
{
- if( marbleModel()->planetId() != "earth" )
- {
+ if (marbleModel()->planetId() != QLatin1String("earth")) {
return;
}
diff --git a/src/plugins/render/opendesktop/OpenDesktopItem.cpp b/src/plugins/render/opendesktop/OpenDesktopItem.cpp
index c06ac22..203186d 100644
--- a/src/plugins/render/opendesktop/OpenDesktopItem.cpp
+++ b/src/plugins/render/opendesktop/OpenDesktopItem.cpp
@@ -56,7 +56,7 @@ bool OpenDesktopItem::operator<( const AbstractDataPluginItem *other ) const
void OpenDesktopItem::addDownloadedFile( const QString& url, const QString& type )
{
- if( type == "avatar" ) {
+ if (type == QLatin1String("avatar")) {
m_pixmap.load( url );
setSize( m_pixmap.size() );
emit updated();
diff --git a/src/plugins/render/opendesktop/OpenDesktopModel.cpp b/src/plugins/render/opendesktop/OpenDesktopModel.cpp
index dbdc304..19e5a55 100644
--- a/src/plugins/render/opendesktop/OpenDesktopModel.cpp
+++ b/src/plugins/render/opendesktop/OpenDesktopModel.cpp
@@ -44,9 +44,10 @@ void OpenDesktopModel::getAdditionalItems( const GeoDataLatLonAltBox& box, qint3
{
Q_UNUSED( number )
- if( marbleModel()->planetId() != "earth" )
+ if (marbleModel()->planetId() != QLatin1String("earth")) {
return;
-
+ }
+
GeoDataCoordinates coords = box.center();
QString openDesktopUrl( "http://api.opendesktop.org/v1/person/data" );
diff --git a/src/plugins/render/overviewmap/OverviewMap.cpp b/src/plugins/render/overviewmap/OverviewMap.cpp
index b0cfd86..14ca086 100644
--- a/src/plugins/render/overviewmap/OverviewMap.cpp
+++ b/src/plugins/render/overviewmap/OverviewMap.cpp
@@ -321,10 +321,10 @@ void OverviewMap::setSettings( const QHash<QString,QVariant> &settings )
foreach ( const QString& planet, PlanetFactory::planetList() ) {
QString mapFile = MarbleDirs::path( QString( "svg/%1map.svg" ).arg( planet ) );
- if ( planet == "moon" ) {
+ if (planet == QLatin1String("moon")) {
mapFile = MarbleDirs::path( "svg/lunarmap.svg" );
}
- else if ( planet == "earth" || mapFile.isEmpty() ) {
+ else if (planet == QLatin1String("earth") || mapFile.isEmpty()) {
mapFile = MarbleDirs::path( "svg/worldmap.svg" );
}
diff --git a/src/plugins/render/panoramio/PanoramioModel.cpp b/src/plugins/render/panoramio/PanoramioModel.cpp
index 04049f0..4d1ac78 100644
--- a/src/plugins/render/panoramio/PanoramioModel.cpp
+++ b/src/plugins/render/panoramio/PanoramioModel.cpp
@@ -37,7 +37,7 @@ void PanoramioModel::setMarbleWidget( MarbleWidget *widget )
void PanoramioModel::getAdditionalItems( const GeoDataLatLonAltBox &box, qint32 number )
{
- if ( marbleModel()->planetId() != "earth" ) {
+ if (marbleModel()->planetId() != QLatin1String("earth")) {
return;
}
diff --git a/src/plugins/render/photo/CoordinatesParser.cpp b/src/plugins/render/photo/CoordinatesParser.cpp
index 2369d1a..fe3b63a 100644
--- a/src/plugins/render/photo/CoordinatesParser.cpp
+++ b/src/plugins/render/photo/CoordinatesParser.cpp
@@ -29,12 +29,15 @@ bool CoordinatesParser::read( QIODevice *device )
readNext();
if( isStartElement() ) {
- if ( name() == "rsp" && attributes().value( "stat" ) == "ok" )
- readRsp();
- else if ( name() == "rsp" )
- raiseError( QObject::tr("Query failed") );
- else
- raiseError( QObject::tr("The file is not a valid Flickr answer.") );
+ if (name() == QLatin1String("rsp")) {
+ if (attributes().value("stat") == QLatin1String("ok")) {
+ readRsp();
+ } else {
+ raiseError(QObject::tr("Query failed"));
+ }
+ } else {
+ raiseError(QObject::tr("The file is not a valid Flickr answer."));
+ }
}
}
@@ -68,7 +71,7 @@ void CoordinatesParser::readRsp()
break;
if( isStartElement() ) {
- if( name() == "photo" )
+ if (name() == QLatin1String("photo"))
readPhoto();
else
readUnknownElement();
@@ -79,7 +82,7 @@ void CoordinatesParser::readRsp()
void CoordinatesParser::readPhoto()
{
Q_ASSERT( isStartElement()
- && name() == "photo" );
+ && name() == QLatin1String("photo"));
while( !atEnd() ) {
readNext();
@@ -88,7 +91,7 @@ void CoordinatesParser::readPhoto()
break;
if( isStartElement() ) {
- if( name() == "location" )
+ if (name() == QLatin1String("location"))
readLocation();
else
readUnknownElement();
@@ -99,7 +102,7 @@ void CoordinatesParser::readPhoto()
void CoordinatesParser::readLocation()
{
Q_ASSERT( isStartElement()
- && name() == "location" );
+ && name() == QLatin1String("location"));
m_coordinates->setLatitude( attributes().value( "latitude" ).toString().toDouble() * DEG2RAD );
m_coordinates->setLongitude( attributes().value( "longitude" ).toString().toDouble() * DEG2RAD );
diff --git a/src/plugins/render/photo/FlickrParser.cpp b/src/plugins/render/photo/FlickrParser.cpp
index baff10a..0af9c2f 100644
--- a/src/plugins/render/photo/FlickrParser.cpp
+++ b/src/plugins/render/photo/FlickrParser.cpp
@@ -36,12 +36,15 @@ bool FlickrParser::read( QByteArray data )
readNext();
if (isStartElement()) {
- if ( name() == "rsp" && attributes().value( "stat" ) == "ok" )
- readFlickr();
- else if ( name() == "rsp" )
- raiseError( QObject::tr("Query failed") );
- else
- raiseError( QObject::tr("The file is not a valid Flickr answer.") );
+ if (name() == QLatin1String("rsp")) {
+ if (attributes().value("stat") == QLatin1String("ok")) {
+ readFlickr();
+ } else {
+ raiseError(QObject::tr("Query failed"));
+ }
+ } else {
+ raiseError(QObject::tr("The file is not a valid Flickr answer."));
+ }
}
}
@@ -66,8 +69,8 @@ void FlickrParser::readUnknownElement()
void FlickrParser::readFlickr()
{
Q_ASSERT( isStartElement()
- && name() == "rsp"
- && attributes().value( "stat" ) == "ok" );
+ && name() == QLatin1String("rsp")
+ && attributes().value( "stat" ) == QLatin1String("ok"));
while( !atEnd() ) {
readNext();
@@ -76,7 +79,7 @@ void FlickrParser::readFlickr()
break;
if( isStartElement() ) {
- if( name() == "photos" )
+ if (name() == QLatin1String("photos"))
readPhotos();
else
readUnknownElement();
@@ -87,7 +90,7 @@ void FlickrParser::readFlickr()
void FlickrParser::readPhotos()
{
Q_ASSERT( isStartElement()
- && name() == "photos" );
+ && name() == QLatin1String("photos"));
while( !atEnd() ) {
readNext();
@@ -96,7 +99,7 @@ void FlickrParser::readPhotos()
break;
if( isStartElement() ) {
- if( name() == "photo" )
+ if (name() == QLatin1String("photo"))
readPhoto();
else
readUnknownElement();
@@ -107,7 +110,7 @@ void FlickrParser::readPhotos()
void FlickrParser::readPhoto()
{
Q_ASSERT( isStartElement()
- && name() == "photo" );
+ && name() == QLatin1String("photo"));
if( attributes().hasAttribute( "id" ) ) {
PhotoPluginItem *item = new PhotoPluginItem( m_marbleWidget, m_parent );
diff --git a/src/plugins/render/photo/PhotoPluginItem.cpp b/src/plugins/render/photo/PhotoPluginItem.cpp
index c986ead..3b69e7b 100644
--- a/src/plugins/render/photo/PhotoPluginItem.cpp
+++ b/src/plugins/render/photo/PhotoPluginItem.cpp
@@ -78,11 +78,11 @@ bool PhotoPluginItem::initialized() const
void PhotoPluginItem::addDownloadedFile( const QString& url, const QString& type )
{
- if( type == "thumbnail" ) {
+ if (type == QLatin1String("thumbnail")) {
m_smallImage.load( url );
m_image.setImage( m_smallImage.scaled( QSize( 50, 50 ) ) );
}
- else if ( type == "info" ) {
+ else if (type == QLatin1String("info")) {
QFile file( url );
if( !file.open( QIODevice::ReadOnly | QIODevice::Text ) ) {
return;
diff --git a/src/plugins/render/photo/PhotoPluginModel.cpp b/src/plugins/render/photo/PhotoPluginModel.cpp
index ad8603b..8e16a09 100644
--- a/src/plugins/render/photo/PhotoPluginModel.cpp
+++ b/src/plugins/render/photo/PhotoPluginModel.cpp
@@ -45,7 +45,7 @@ QUrl PhotoPluginModel::generateUrl( const QString& service,
{
QString url( "" );
- if( service == "flickr" )
+ if (service == QLatin1String("flickr"))
url += "https://www.flickr.com/services/rest/";
else
return QUrl();
@@ -72,7 +72,7 @@ void PhotoPluginModel::getAdditionalItems( const GeoDataLatLonAltBox& box,
qint32 number )
{
// Flickr only supports images for earth
- if( marbleModel()->planetId() != "earth" ) {
+ if (marbleModel()->planetId() != QLatin1String("earth")) {
return;
}
diff --git a/src/plugins/render/postalcode/PostalCodeModel.cpp b/src/plugins/render/postalcode/PostalCodeModel.cpp
index 5e122df..49d11b0 100644
--- a/src/plugins/render/postalcode/PostalCodeModel.cpp
+++ b/src/plugins/render/postalcode/PostalCodeModel.cpp
@@ -44,7 +44,7 @@ PostalCodeModel::~PostalCodeModel() {
void PostalCodeModel::getAdditionalItems( const GeoDataLatLonAltBox& box,
qint32 number )
{
- if( marbleModel()->planetId() != "earth" ) {
+ if (marbleModel()->planetId() != QLatin1String("earth")) {
return;
}
diff --git a/src/plugins/render/satellites/SatellitesModel.cpp b/src/plugins/render/satellites/SatellitesModel.cpp
index 1f6f46b..890f236 100644
--- a/src/plugins/render/satellites/SatellitesModel.cpp
+++ b/src/plugins/render/satellites/SatellitesModel.cpp
@@ -105,7 +105,7 @@ void SatellitesModel::updateVisibility()
SatellitesTLEItem *eItem = dynamic_cast<SatellitesTLEItem*>(obj);
if( eItem != NULL ) {
// TLE satellites are always earth satellites
- bool enabled = ( m_lcPlanet == "earth" );
+ bool enabled = (m_lcPlanet == QLatin1String("earth"));
eItem->setEnabled( enabled );
if( enabled ) {
@@ -196,7 +196,7 @@ void SatellitesModel::parseCatalog( const QString &id,
style->labelStyle().setGlow( true );
// use special icon for moons
- if( category == "Moons" ) {
+ if (category == QLatin1String("Moons")) {
style->iconStyle().setIconPath( ":/icons/moon.png" );
} else {
style->iconStyle().setIconPath(MarbleDirs::path("bitmaps/satellite.png"));
diff --git a/src/plugins/render/stars/StarsPlugin.cpp b/src/plugins/render/stars/StarsPlugin.cpp
index 4d20a70..d43a2ff 100644
--- a/src/plugins/render/stars/StarsPlugin.cpp
+++ b/src/plugins/render/stars/StarsPlugin.cpp
@@ -783,7 +783,7 @@ bool StarsPlugin::render( GeoPainter *painter, ViewportParams *viewport,
QString planetId = marbleModel()->planetId();
const bool doRender = !viewport->mapCoversViewport() &&
( (viewport->projection() == Spherical || viewport->projection() == VerticalPerspective) &&
- planetId == "earth" ); // So far displaying stars is only supported on earth.
+ planetId == QLatin1String("earth")); // So far displaying stars is only supported on earth.
if ( doRender != m_doRender ) {
if ( doRender ) {
@@ -1149,7 +1149,7 @@ bool StarsPlugin::render( GeoPainter *painter, ViewportParams *viewport,
}
}
- if ( m_renderMoon && marbleModel()->planetId() == "earth" ) {
+ if ( m_renderMoon && marbleModel()->planetId() == QLatin1String("earth")) {
// moon
double ra=0.0;
double decl=0.0;
@@ -1265,31 +1265,31 @@ void StarsPlugin::renderPlanet(const QString &planetId,
int color=0;
// venus, mars, jupiter, uranus, neptune, saturn
- if (planetId == "venus") {
+ if (planetId == QLatin1String("venus")) {
sys.getVenus(ra, decl);
sys.getPhysVenus(diam, mag, phase);
color = 2;
- } else if (planetId == "mars") {
+ } else if (planetId == QLatin1String("mars")) {
sys.getMars(ra, decl);
sys.getPhysMars(diam, mag, phase);
color = 5;
- } else if (planetId == "jupiter") {
+ } else if (planetId == QLatin1String("jupiter")) {
sys.getJupiter(ra, decl);
sys.getPhysJupiter(diam, mag, phase);
color = 2;
- } else if (planetId == "mercury") {
+ } else if (planetId == QLatin1String("mercury")) {
sys.getMercury(ra, decl);
sys.getPhysMercury(diam, mag, phase);
color = 3;
- } else if (planetId == "saturn") {
+ } else if (planetId == QLatin1String("saturn")) {
sys.getSaturn(ra, decl);
sys.getPhysSaturn(diam, mag, phase);
color = 3;
- } else if (planetId == "uranus") {
+ } else if (planetId == QLatin1String("uranus")) {
sys.getUranus(ra, decl);
sys.getPhysUranus(diam, mag, phase);
color = 0;
- } else if (planetId == "neptune") {
+ } else if (planetId == QLatin1String("neptune")) {
sys.getNeptune(ra, decl);
sys.getPhysNeptune(diam, mag, phase);
color = 0;
diff --git a/src/plugins/render/twitter/jsonparser.cpp b/src/plugins/render/twitter/jsonparser.cpp
index 22acb69..7dcf67b 100644
--- a/src/plugins/render/twitter/jsonparser.cpp
+++ b/src/plugins/render/twitter/jsonparser.cpp
@@ -28,7 +28,7 @@ QList <twitterDataStructure> jsonParser::parseAllObjects(const QString &content
{
QString temp = "var myJSONObject = { \"twitter\":" + content + "}";
int iterator = 0;//the count starts fom one
- if (temp != "Twitter is down for database maintenance. It will return in about 30 minutes")
+ if (temp != QLatin1String("Twitter is down for database maintenance. It will return in about 30 minutes"))
{
myEngine.evaluate(QString("function userName(k){return myJSONObject.twitter[k].user.name};"));
myEngine.evaluate(QString("function userLocation(k){return myJSONObject.twitter[k].user.location};"));
diff --git a/src/plugins/render/twitter/twitterPlugin.cpp b/src/plugins/render/twitter/twitterPlugin.cpp
index 79922b0..94e97ff 100644
--- a/src/plugins/render/twitter/twitterPlugin.cpp
+++ b/src/plugins/render/twitter/twitterPlugin.cpp
@@ -117,7 +117,7 @@ mDebug()<<"::::::::::::::::slot"<<parsedData[0].text;
connect(m_downloadManager, SIGNAL(downloadComplete(QString,QString)), this, SLOT(slotGeoCodingReplyRecieved(QString,QString)) );
for (int counter = 0;counter < 10;counter++) {
- if (parsedData[counter].location != "null") {
+ if (parsedData[counter].location != QLatin1String("null")) {
parsedData[counter].location.replace(QRegExp("[?,:!/\\s]+"), "+");//remove whitespace and replace it with + for query api
findLatLonOfStreetAddress(parsedData [ counter ].location) ; //this will set temp
}
diff --git a/src/plugins/render/weather/BBCParser.cpp b/src/plugins/render/weather/BBCParser.cpp
index 5235d19..3be63e4 100644
--- a/src/plugins/render/weather/BBCParser.cpp
+++ b/src/plugins/render/weather/BBCParser.cpp
@@ -223,10 +223,10 @@ void BBCParser::work()
QList<WeatherData> data = read( &file );
if( !data.isEmpty() && !entry.item.isNull() ) {
- if ( entry.type == "bbcobservation" ) {
+ if (entry.type == QLatin1String("bbcobservation")) {
entry.item->setCurrentWeather( data.at( 0 ) );
}
- else if ( entry.type == "bbcforecast" ) {
+ else if (entry.type == QLatin1String("bbcforecast")) {
entry.item->addForecastWeather( data );
}
@@ -243,7 +243,7 @@ QList<WeatherData> BBCParser::read( QIODevice *device )
readNext();
if ( isStartElement() ) {
- if ( name() == "rss" )
+ if (name() == QLatin1String("rss"))
readBBC();
else
raiseError( QObject::tr("The file is not a valid BBC answer.") );
@@ -271,7 +271,7 @@ void BBCParser::readUnknownElement()
void BBCParser::readBBC()
{
Q_ASSERT( isStartElement()
- && name() == "rss" );
+ && name() == QLatin1String("rss"));
while( !atEnd() ) {
readNext();
@@ -280,7 +280,7 @@ void BBCParser::readBBC()
break;
if( isStartElement() ) {
- if( name() == "channel" )
+ if (name() == QLatin1String("channel"))
readChannel();
else
readUnknownElement();
@@ -291,7 +291,7 @@ void BBCParser::readBBC()
void BBCParser::readChannel()
{
Q_ASSERT( isStartElement()
- && name() == "channel" );
+ && name() == QLatin1String("channel"));
while( !atEnd() ) {
readNext();
@@ -300,7 +300,7 @@ void BBCParser::readChannel()
break;
if( isStartElement() ) {
- if( name() == "item" )
+ if (name() == QLatin1String("item"))
readItem();
else
readUnknownElement();
@@ -311,7 +311,7 @@ void BBCParser::readChannel()
void BBCParser::readItem()
{
Q_ASSERT( isStartElement()
- && name() == "item" );
+ && name() == QLatin1String("item"));
WeatherData item;
@@ -322,11 +322,11 @@ void BBCParser::readItem()
break;
if( isStartElement() ) {
- if( name() == "description" )
+ if (name() == QLatin1String("description"))
readDescription( &item );
- else if( name() == "title" )
+ else if(name() == QLatin1String("title"))
readTitle( &item );
- else if( name() == "pubDate" )
+ else if (name() == QLatin1String("pubDate"))
readPubDate( &item );
else
readUnknownElement();
@@ -339,7 +339,7 @@ void BBCParser::readItem()
void BBCParser::readDescription( WeatherData *data )
{
Q_ASSERT( isStartElement()
- && name() == "description" );
+ && name() == QLatin1String("description"));
while( !atEnd() ) {
readNext();
@@ -414,7 +414,7 @@ void BBCParser::readDescription( WeatherData *data )
pos = regExp.indexIn( description );
if ( pos > -1 ) {
QString pressure = regExp.cap( 2 );
- if ( pressure != "N/A" ) {
+ if (pressure != QLatin1String("N/A")) {
pressure.chop( 2 );
data->setPressure( pressure.toFloat()/1000, WeatherData::Bar );
}
@@ -450,7 +450,7 @@ void BBCParser::readDescription( WeatherData *data )
void BBCParser::readTitle( WeatherData *data )
{
Q_ASSERT( isStartElement()
- && name() == "title" );
+ && name() == QLatin1String("title"));
while( !atEnd() ) {
readNext();
@@ -513,7 +513,7 @@ void BBCParser::readTitle( WeatherData *data )
void BBCParser::readPubDate( WeatherData *data )
{
Q_ASSERT( isStartElement()
- && name() == "pubDate" );
+ && name() == QLatin1String("pubDate"));
while( !atEnd() ) {
readNext();
@@ -548,7 +548,7 @@ void BBCParser::readPubDate( WeatherData *data )
dateTime.setTime( time );
// Timezone
- if( regExp.cap( 14 ) == "-" ) {
+ if (regExp.cap(14) == QLatin1String("-")) {
dateTime = dateTime.addSecs( 60*60*regExp.cap( 15 ).toInt() );
dateTime = dateTime.addSecs( 60 *regExp.cap( 16 ).toInt() );
}
diff --git a/src/plugins/render/weather/BBCWeatherItem.cpp b/src/plugins/render/weather/BBCWeatherItem.cpp
index 589849f..0f0759e 100644
--- a/src/plugins/render/weather/BBCWeatherItem.cpp
+++ b/src/plugins/render/weather/BBCWeatherItem.cpp
@@ -35,13 +35,13 @@ BBCWeatherItem::~BBCWeatherItem()
bool BBCWeatherItem::request( const QString& type )
{
- if ( type == "bbcobservation" ) {
+ if (type == QLatin1String("bbcobservation")) {
if ( !m_observationRequested ) {
m_observationRequested = true;
return true;
}
}
- else if ( type == "bbcforecast" ) {
+ else if (type == QLatin1String("bbcforecast")) {
if ( !m_forecastRequested ) {
m_forecastRequested = true;
return true;
@@ -57,7 +57,7 @@ QString BBCWeatherItem::service() const
void BBCWeatherItem::addDownloadedFile( const QString& url, const QString& type )
{
- if( type == "bbcobservation" || type == "bbcforecast" ) {
+ if (type == QLatin1String("bbcobservation") || type == QLatin1String("bbcforecast")) {
BBCParser::instance()->scheduleRead( url, this, type );
}
}
diff --git a/src/plugins/render/weather/GeoNamesWeatherService.cpp b/src/plugins/render/weather/GeoNamesWeatherService.cpp
index 9a9d75e..1d66c00 100644
--- a/src/plugins/render/weather/GeoNamesWeatherService.cpp
+++ b/src/plugins/render/weather/GeoNamesWeatherService.cpp
@@ -44,7 +44,7 @@ GeoNamesWeatherService::~GeoNamesWeatherService()
void GeoNamesWeatherService::getAdditionalItems( const GeoDataLatLonAltBox& box,
qint32 number )
{
- if( marbleModel()->planetId() != "earth" ) {
+ if (marbleModel()->planetId() != QLatin1String("earth")) {
return;
}
@@ -63,7 +63,7 @@ void GeoNamesWeatherService::getAdditionalItems( const GeoDataLatLonAltBox& box,
void GeoNamesWeatherService::getItem( const QString &id )
{
- if( marbleModel()->planetId() != "earth" ) {
+ if (marbleModel()->planetId() != QLatin1String("earth")) {
return;
}
@@ -127,7 +127,7 @@ AbstractDataPluginItem *GeoNamesWeatherService::parse( const QScriptValue &value
WeatherData data;
// Weather condition
- if ( clouds != "n/a" && condition != "n/a" ) {
+ if (clouds != QLatin1String("n/a") && condition != QLatin1String("n/a")) {
if ( dayConditions.contains( condition ) ) {
data.setCondition( dayConditions[condition] );
} else {
diff --git a/src/plugins/render/weather/StationListParser.cpp b/src/plugins/render/weather/StationListParser.cpp
index 1bdbc24..2ba249b 100644
--- a/src/plugins/render/weather/StationListParser.cpp
+++ b/src/plugins/render/weather/StationListParser.cpp
@@ -42,7 +42,7 @@ void StationListParser::read()
readNext();
if ( isStartElement() ) {
- if ( name() == "StationList" )
+ if (name() == QLatin1String("StationList"))
readStationList();
else
raiseError( QObject::tr("The file is not a valid file.") );
@@ -90,7 +90,7 @@ void StationListParser::readUnknownElement()
void StationListParser::readStationList()
{
Q_ASSERT( isStartElement()
- && name() == "StationList" );
+ && name() == QLatin1String("StationList"));
while( !atEnd() ) {
readNext();
@@ -99,7 +99,7 @@ void StationListParser::readStationList()
break;
if( isStartElement() ) {
- if( name() == "Station" )
+ if (name() == QLatin1String("Station"))
readStation();
else
readUnknownElement();
@@ -110,7 +110,7 @@ void StationListParser::readStationList()
void StationListParser::readStation()
{
Q_ASSERT( isStartElement()
- && name() == "Station" );
+ && name() == QLatin1String("Station"));
BBCStation station;
@@ -121,13 +121,13 @@ void StationListParser::readStation()
break;
if( isStartElement() ) {
- if( name() == "name" )
+ if (name() == QLatin1String("name"))
station.setName( readCharacters() );
- else if ( name() == "id" )
+ else if (name() == QLatin1String("id"))
station.setBbcId( readCharacters().toLong() );
- else if ( name() == "priority" )
+ else if (name() == QLatin1String("priority"))
station.setPriority( readCharacters().toInt() );
- else if ( name() == "Point" )
+ else if (name() == QLatin1String("Point"))
readPoint( &station );
else
readUnknownElement();
@@ -169,7 +169,7 @@ QString StationListParser::readCharacters()
void StationListParser::readPoint( BBCStation *station )
{
Q_ASSERT( isStartElement()
- && name() == "Point" );
+ && name() == QLatin1String("Point"));
while ( !atEnd() ) {
readNext();
@@ -178,7 +178,7 @@ void StationListParser::readPoint( BBCStation *station )
break;
if ( isStartElement() ) {
- if ( name() == "coordinates" ) {
+ if (name() == QLatin1String("coordinates")) {
QString coorString = readCharacters();
QStringList coorList = coorString.split( ',' );
diff --git a/src/plugins/render/wikipedia/GeonamesParser.cpp b/src/plugins/render/wikipedia/GeonamesParser.cpp
index aa2a6d5..76bde66 100644
--- a/src/plugins/render/wikipedia/GeonamesParser.cpp
+++ b/src/plugins/render/wikipedia/GeonamesParser.cpp
@@ -38,7 +38,7 @@ bool GeonamesParser::read( const QByteArray& data )
readNext();
if ( isStartElement() ) {
- if ( name() == "geonames" )
+ if (name() == QLatin1String("geonames"))
readGeonames();
else
raiseError( QObject::tr("The file is not a valid Geonames answer.") );
@@ -66,7 +66,7 @@ void GeonamesParser::readUnknownElement()
void GeonamesParser::readGeonames()
{
Q_ASSERT( isStartElement()
- && name() == "geonames" );
+ && name() == QLatin1String("geonames"));
while ( !atEnd() ) {
readNext();
@@ -75,7 +75,7 @@ void GeonamesParser::readGeonames()
break;
if ( isStartElement() ) {
- if ( name() == "entry" )
+ if (name() == QLatin1String("entry"))
readEntry();
else
readUnknownElement();
@@ -86,7 +86,7 @@ void GeonamesParser::readGeonames()
void GeonamesParser::readEntry()
{
Q_ASSERT( isStartElement()
- && name() == "entry" );
+ && name() == QLatin1String("entry"));
WikipediaItem *item = new WikipediaItem( m_marbleWidget, m_parent );
m_list->append( item );
@@ -98,19 +98,19 @@ void GeonamesParser::readEntry()
break;
if ( isStartElement() ) {
- if ( name() == "title" )
+ if ( name() == QLatin1String("title" ))
readTitle( item );
- else if ( name() == "lng" )
+ else if (name() == QLatin1String("lng"))
readLongitude( item );
- else if ( name() == "lat" )
+ else if (name() == QLatin1String("lat"))
readLatitude( item );
- else if ( name() == "wikipediaUrl" )
+ else if (name() == QLatin1String("wikipediaUrl"))
readUrl( item );
- else if ( name() == "summary" )
+ else if (name() == QLatin1String("summary"))
readSummary( item );
- else if ( name() == "thumbnailImg" )
+ else if (name() == QLatin1String("thumbnailImg"))
readThumbnailImage( item );
- else if ( name() == "rank" )
+ else if (name() == QLatin1String("rank"))
readRank( item );
else
readUnknownElement();
@@ -121,7 +121,7 @@ void GeonamesParser::readEntry()
void GeonamesParser::readTitle( WikipediaItem *item )
{
Q_ASSERT( isStartElement()
- && name() == "title" );
+ && name() == QLatin1String("title"));
while ( !atEnd() ) {
readNext();
@@ -138,7 +138,7 @@ void GeonamesParser::readTitle( WikipediaItem *item )
void GeonamesParser::readLongitude( WikipediaItem *item )
{
Q_ASSERT( isStartElement()
- && name() == "lng" );
+ && name() == QLatin1String("lng"));
while ( !atEnd() ) {
readNext();
@@ -155,7 +155,7 @@ void GeonamesParser::readLongitude( WikipediaItem *item )
void GeonamesParser::readLatitude( WikipediaItem *item )
{
Q_ASSERT( isStartElement()
- && name() == "lat" );
+ && name() == QLatin1String("lat"));
while ( !atEnd() ) {
readNext();
@@ -172,7 +172,7 @@ void GeonamesParser::readLatitude( WikipediaItem *item )
void GeonamesParser::readUrl( WikipediaItem *item )
{
Q_ASSERT( isStartElement()
- && name() == "wikipediaUrl" );
+ && name() == QLatin1String("wikipediaUrl"));
while ( !atEnd() ) {
readNext();
@@ -195,7 +195,7 @@ void GeonamesParser::readUrl( WikipediaItem *item )
void GeonamesParser::readSummary( WikipediaItem *item )
{
Q_ASSERT( isStartElement()
- && name() == "summary" );
+ && name() == QLatin1String("summary"));
while ( !atEnd() ) {
readNext();
@@ -212,7 +212,7 @@ void GeonamesParser::readSummary( WikipediaItem *item )
void GeonamesParser::readThumbnailImage( WikipediaItem *item )
{
Q_ASSERT( isStartElement()
- && name() == "thumbnailImg" );
+ && name() == QLatin1String("thumbnailImg"));
while ( !atEnd() ) {
readNext();
@@ -229,7 +229,7 @@ void GeonamesParser::readThumbnailImage( WikipediaItem *item )
void GeonamesParser::readRank( WikipediaItem *item )
{
Q_ASSERT( isStartElement()
- && name() == "rank" );
+ && name() == QLatin1String("rank"));
while ( !atEnd() ) {
readNext();
diff --git a/src/plugins/render/wikipedia/WikipediaItem.cpp b/src/plugins/render/wikipedia/WikipediaItem.cpp
index a48e16e..978b966 100644
--- a/src/plugins/render/wikipedia/WikipediaItem.cpp
+++ b/src/plugins/render/wikipedia/WikipediaItem.cpp
@@ -69,7 +69,7 @@ bool WikipediaItem::initialized() const
void WikipediaItem::addDownloadedFile( const QString& url, const QString& type )
{
- if ( type == "thumbnail" ) {
+ if (type == QLatin1String("thumbnail")) {
m_thumbnail.load( url );
updateSize();
emit updated();
diff --git a/src/plugins/render/wikipedia/WikipediaModel.cpp b/src/plugins/render/wikipedia/WikipediaModel.cpp
index 65b70f7..8f63305 100644
--- a/src/plugins/render/wikipedia/WikipediaModel.cpp
+++ b/src/plugins/render/wikipedia/WikipediaModel.cpp
@@ -55,7 +55,7 @@ void WikipediaModel::getAdditionalItems( const GeoDataLatLonAltBox& box,
qint32 number )
{
// Geonames only supports wikipedia articles for earth
- if ( marbleModel()->planetId() != "earth" ) {
+ if (marbleModel()->planetId() != QLatin1String("earth")) {
return;
}
diff --git a/src/plugins/runner/cyclestreets/CycleStreetsRunner.cpp b/src/plugins/runner/cyclestreets/CycleStreetsRunner.cpp
index eb7c6ed..2d80049 100644
--- a/src/plugins/runner/cyclestreets/CycleStreetsRunner.cpp
+++ b/src/plugins/runner/cyclestreets/CycleStreetsRunner.cpp
@@ -188,7 +188,7 @@ GeoDataDocument *CycleStreetsRunner::parse( const QByteArray &content ) const
result->append( routePlacemark );
int i;
- for ( i = 1; i < features.count() && features.at( i ).firstChildElement().tagName() != "cs:segment"; ++i );
+ for (i = 1; i < features.count() && features.at( i ).firstChildElement().tagName() != QLatin1String("cs:segment"); ++i);
for ( ; i < features.count(); ++i) {
QDomElement segment = features.at( i ).toElement();
@@ -204,7 +204,7 @@ GeoDataDocument *CycleStreetsRunner::parse( const QByteArray &content ) const
} else {
instructionName = "Straight";
}
- if ( name != "Short un-named link" && name != "Un-named link" ){
+ if (name != QLatin1String("Short un-named link") && name != QLatin1String("Un-named link")) {
instructionName.append( " into " + name );
}
instructions->setName( instructionName );
diff --git a/src/plugins/runner/json/JsonParser.cpp b/src/plugins/runner/json/JsonParser.cpp
index 54a6ccf..ed2dc1d 100644
--- a/src/plugins/runner/json/JsonParser.cpp
+++ b/src/plugins/runner/json/JsonParser.cpp
@@ -78,7 +78,7 @@ bool JsonParser::read( QIODevice* device )
// Create the different geometry types
- if ( m_engine.evaluate( "fileData.features[" + count + "].geometry.type" ).toString().toUpper() == "POLYGON" ) {
+ if (m_engine.evaluate( "fileData.features[" + count + "].geometry.type" ).toString().toUpper() == QLatin1String("POLYGON")) {
// Check first that there are coordinates
if ( m_engine.evaluate( "fileData.features[" + count + "].geometry.coordinates" ).isArray() ) {
@@ -115,7 +115,7 @@ bool JsonParser::read( QIODevice* device )
geometryList.append( geom );
}
- } else if ( m_engine.evaluate( "fileData.features[" + count + "].geometry.type" ).toString().toUpper() == "MULTIPOLYGON" ) {
+ } else if (m_engine.evaluate( "fileData.features[" + count + "].geometry.type" ).toString().toUpper() == QLatin1String("MULTIPOLYGON")) {
// Check first that there are coordinates
if ( m_engine.evaluate( "fileData.features[" + count + "].geometry.coordinates" ).isArray() ) {
@@ -157,7 +157,7 @@ bool JsonParser::read( QIODevice* device )
}
}
- } else if ( m_engine.evaluate( "fileData.features[" + count + "].geometry.type" ).toString().toUpper() == "LINESTRING" ) {
+ } else if (m_engine.evaluate( "fileData.features[" + count + "].geometry.type" ).toString().toUpper() == QLatin1String("LINESTRING")) {
// Check first that there are coordinates
if ( m_engine.evaluate( "fileData.features[" + count + "].geometry.coordinates" ).isArray() ) {
@@ -177,7 +177,7 @@ bool JsonParser::read( QIODevice* device )
geometryList.append( geom );
}
- } else if ( m_engine.evaluate( "fileData.features[" + count + "].geometry.type" ).toString().toUpper() == "MULTILINESTRING" ) {
+ } else if (m_engine.evaluate( "fileData.features[" + count + "].geometry.type" ).toString().toUpper() == QLatin1String("MULTILINESTRING")) {
// Check first that there are coordinates
if ( m_engine.evaluate( "fileData.features[" + count + "].geometry.coordinates" ).isArray() ) {
@@ -202,7 +202,7 @@ bool JsonParser::read( QIODevice* device )
}
}
- } else if ( m_engine.evaluate( "fileData.features[" + count + "].geometry.type" ).toString().toUpper() == "POINT" ) {
+ } else if (m_engine.evaluate( "fileData.features[" + count + "].geometry.type" ).toString().toUpper() == QLatin1String("POINT")) {
// Check first that there are coordinates
if ( m_engine.evaluate( "fileData.features[" + count + "].geometry.coordinates" ).isArray() ) {
@@ -216,7 +216,7 @@ bool JsonParser::read( QIODevice* device )
geometryList.append( geom );
}
- } else if ( m_engine.evaluate( "fileData.features[" + count + "].geometry.type" ).toString().toUpper() == "MULTIPOINT" ) {
+ } else if (m_engine.evaluate( "fileData.features[" + count + "].geometry.type" ).toString().toUpper() == QLatin1String("MULTIPOINT")) {
// Check first that there are coordinates
if ( m_engine.evaluate( "fileData.features[" + count + "].geometry.coordinates" ).isArray() ) {
@@ -257,7 +257,7 @@ bool JsonParser::read( QIODevice* device )
propertyIterator.next();
// If the property read, is the features name
- if ( propertyIterator.name() == "name" ) {
+ if (propertyIterator.name() == QLatin1String("name")) {
for ( int pl = 0 ; pl < placemarkList.length() ; pl++) {
placemarkList.at( pl )->setName( propertyIterator.value().toString() );
}
diff --git a/src/plugins/runner/kml/KmlRunner.cpp b/src/plugins/runner/kml/KmlRunner.cpp
index 5a61b63..5254266 100644
--- a/src/plugins/runner/kml/KmlRunner.cpp
+++ b/src/plugins/runner/kml/KmlRunner.cpp
@@ -37,7 +37,7 @@ GeoDataDocument *KmlRunner::parseFile(const QString &fileName, DocumentRole role
QStringList kmzFiles;
QFileInfo const kmzFile( fileName );
- if ( kmzFile.exists() && kmzFile.suffix().toLower() == "kmz" ) {
+ if (kmzFile.exists() && kmzFile.suffix().toLower() == QLatin1String("kmz")) {
KmzHandler kmzHandler;
if ( kmzHandler.open( fileName, error ) ) {
kmlFileName = kmzHandler.kmlFile();
diff --git a/src/plugins/runner/mapquest/MapQuestRunner.cpp b/src/plugins/runner/mapquest/MapQuestRunner.cpp
index 0d1a0b1..07ed380 100644
--- a/src/plugins/runner/mapquest/MapQuestRunner.cpp
+++ b/src/plugins/runner/mapquest/MapQuestRunner.cpp
@@ -82,32 +82,35 @@ void MapQuestRunner::retrieveRoute( const RouteRequest *route )
append( &url, "routeType", settings["preference"].toString() );
}
- if ( !settings["ascending"].toString().isEmpty() && !settings["descending"].toString().isEmpty() ) {
- if ( settings["ascending"].toString() == "AVOID_UP_HILL"
- && settings["descending"].toString() == "AVOID_DOWN_HILL" ) {
- append( &url, "roadGradeStrategy", "AVOID_ALL_HILLS" );
- }
- else if ( settings["ascending"].toString() == "FAVOR_UP_HILL"
- && settings["descending"].toString() == "FAVOR_DOWN_HILL" ) {
- append( &url, "roadGradeStrategy", "FAVOR_ALL_HILLS" );
- }
- else if ( settings["ascending"].toString() == "DEFAULT_STRATEGY"
- && settings["descending"].toString() == "DEFAULT_STRATEGY" ) {
- append( &url, "roadGradeStrategy", "DEFAULT_STRATEGY" );
- }
- else if ( settings["ascending"].toString() == "DEFAULT_STRATEGY" ) {
- append( &url, "roadGradeStrategy", settings["descending"].toString() );
- }
- else if ( settings["descending"].toString() == "DEFAULT_STRATEGY" ) {
- append( &url, "roadGradeStrategy", settings["ascending"].toString() );
- }
- else if ( settings["descending"].toString() == "AVOID_DOWN_HILL" ) {
- append( &url, "roadGradeStrategy", settings["descending"].toString() );
- }
- else if ( settings["ascending"].toString() == "AVOID_UP_HILL" ) {
- append( &url, "roadGradeStrategy", settings["ascending"].toString() );
- }
+ const QString ascendingSetting = settings[QStringLiteral("ascending")].toString();
+ const QString descendingSetting = settings[QStringLiteral("descending")].toString();
+ if (!ascendingSetting.isEmpty() && !descendingSetting.isEmpty()) {
+ if (ascendingSetting == QLatin1String("AVOID_UP_HILL") &&
+ descendingSetting == QLatin1String("AVOID_DOWN_HILL")) {
+ append(&url, QStringLiteral("roadGradeStrategy"), QStringLiteral("AVOID_ALL_HILLS"));
+ }
+ else if (ascendingSetting == QLatin1String("FAVOR_UP_HILL") &&
+ descendingSetting == QLatin1String("FAVOR_DOWN_HILL")) {
+ append(&url, QStringLiteral("roadGradeStrategy"), QStringLiteral("FAVOR_ALL_HILLS"));
}
+ else if (ascendingSetting == QLatin1String("DEFAULT_STRATEGY") &&
+ descendingSetting == QLatin1String("DEFAULT_STRATEGY")) {
+ append(&url, QStringLiteral("roadGradeStrategy"), QStringLiteral("DEFAULT_STRATEGY"));
+ }
+ else if (ascendingSetting == QLatin1String("DEFAULT_STRATEGY")) {
+ append(&url, QStringLiteral("roadGradeStrategy"), descendingSetting);
+ }
+ else if (descendingSetting == QLatin1String("DEFAULT_STRATEGY")) {
+ append(&url, QStringLiteral("roadGradeStrategy"), ascendingSetting);
+ }
+ else if (descendingSetting == QLatin1String("AVOID_DOWN_HILL")) {
+ append(&url, QStringLiteral("roadGradeStrategy"), descendingSetting);
+ }
+ else if (ascendingSetting == QLatin1String("AVOID_UP_HILL")) {
+ append(&url, QStringLiteral("roadGradeStrategy"), ascendingSetting);
+ }
+ }
+
QUrl qurl(url);
// FIXME: verify that this works with special characters.
QUrlQuery urlQuery;
diff --git a/src/plugins/runner/monav/MonavRunner.cpp b/src/plugins/runner/monav/MonavRunner.cpp
index a1ceb25..c0cc5cf 100644
--- a/src/plugins/runner/monav/MonavRunner.cpp
+++ b/src/plugins/runner/monav/MonavRunner.cpp
@@ -154,7 +154,7 @@ int MonavRunnerPrivate::retrieveRoute( const Marble::RouteRequest* route, QVecto
QString road = reply.nameStrings[reply.pathEdges[i].name];
QString type = reply.typeStrings[reply.pathEdges[i].type];
RoutingWaypoint::JunctionType junction = RoutingWaypoint::Other;
- if ( type == "roundabout" && reply.pathEdges[i].branchingPossible ) {
+ if (type == QLatin1String("roundabout") && reply.pathEdges[i].branchingPossible) {
junction = RoutingWaypoint::Roundabout;
}
for ( unsigned int l = 0; l < reply.pathEdges[i].length; ++k, ++l ) {
diff --git a/src/plugins/runner/open-source-routing-machine/OSRMRunner.cpp b/src/plugins/runner/open-source-routing-machine/OSRMRunner.cpp
index 84b8642..14839a2 100644
--- a/src/plugins/runner/open-source-routing-machine/OSRMRunner.cpp
+++ b/src/plugins/runner/open-source-routing-machine/OSRMRunner.cpp
@@ -158,25 +158,25 @@ GeoDataLineString *OSRMRunner::decodePolyline( const QString &geometry )
RoutingInstruction::TurnType OSRMRunner::parseTurnType( const QString &instruction )
{
- if ( instruction == "1" ) {
+ if (instruction == QLatin1String("1")) {
return RoutingInstruction::Straight;
- } else if ( instruction == "2" ) {
+ } else if (instruction == QLatin1String("2")) {
return RoutingInstruction::SlightRight;
- } else if ( instruction == "3" ) {
+ } else if (instruction == QLatin1String("3")) {
return RoutingInstruction::Right;
- } else if ( instruction == "4" ) {
+ } else if (instruction == QLatin1String("4")) {
return RoutingInstruction::SharpRight;
- } else if ( instruction == "5" ) {
+ } else if (instruction == QLatin1String("5")) {
return RoutingInstruction::TurnAround;
- } else if ( instruction == "6" ) {
+ } else if (instruction == QLatin1String("6")) {
return RoutingInstruction::SharpLeft;
- } else if ( instruction == "7" ) {
+ } else if (instruction == QLatin1String("7")) {
return RoutingInstruction::Left;
- } else if ( instruction == "8" ) {
+ } else if (instruction == QLatin1String("8")) {
return RoutingInstruction::SlightLeft;
- } else if ( instruction == "10" ) {
+ } else if (instruction == QLatin1String("10")) {
return RoutingInstruction::Continue;
- } else if ( instruction.startsWith( QLatin1String( "11-" ) ) ) {
+ } else if (instruction.startsWith(QLatin1String("11-"))) {
int const exit = instruction.mid( 3 ).toInt();
switch ( exit ) {
case 1: return RoutingInstruction::RoundaboutFirstExit; break;
@@ -184,7 +184,7 @@ RoutingInstruction::TurnType OSRMRunner::parseTurnType( const QString &instructi
case 3: return RoutingInstruction::RoundaboutThirdExit; break;
default: return RoutingInstruction::RoundaboutExit;
}
- } else if ( instruction == "12" ) {
+ } else if (instruction == QLatin1String("12")) {
return RoutingInstruction::RoundaboutExit;
}
diff --git a/src/plugins/runner/openrouteservice/OpenRouteServiceRunner.cpp b/src/plugins/runner/openrouteservice/OpenRouteServiceRunner.cpp
index 752d8ab..663f447 100644
--- a/src/plugins/runner/openrouteservice/OpenRouteServiceRunner.cpp
+++ b/src/plugins/runner/openrouteservice/OpenRouteServiceRunner.cpp
@@ -57,7 +57,7 @@ void OpenRouteServiceRunner::retrieveRoute( const RouteRequest *route )
if ( settings.contains( "preference" ) ) {
preference = settings["preference"].toString();
}
- if ( preference == "Pedestrian" ) {
+ if (preference == QLatin1String("Pedestrian")) {
unit = 'M';
}
@@ -362,23 +362,23 @@ RoutingInstruction::TurnType OpenRouteServiceRunner::parseTurnType( const QStrin
}
}
- if ( instruction == "Continue" ) {
+ if (instruction == QLatin1String("Continue")) {
return RoutingInstruction::Straight;
- } else if ( instruction == "half right" ) {
+ } else if (instruction == QLatin1String("half right")) {
return RoutingInstruction::SlightRight;
- } else if ( instruction == "right" ) {
+ } else if (instruction == QLatin1String("right")) {
return RoutingInstruction::Right;
- } else if ( instruction == "sharp right" ) {
+ } else if (instruction == QLatin1String("sharp right")) {
return RoutingInstruction::SharpRight;
- } else if ( instruction == "straight forward" ) {
+ } else if (instruction == QLatin1String("straight forward")) {
return RoutingInstruction::Straight;
- } else if ( instruction == "turn" ) {
+ } else if (instruction == QLatin1String("turn")) {
return RoutingInstruction::TurnAround;
- } else if ( instruction == "sharp left" ) {
+ } else if (instruction == QLatin1String("sharp left")) {
return RoutingInstruction::SharpLeft;
- } else if ( instruction == "left" ) {
+ } else if (instruction == QLatin1String("left")) {
return RoutingInstruction::Left;
- } else if ( instruction == "half left" ) {
+ } else if (instruction == QLatin1String("half left")) {
return RoutingInstruction::SlightLeft;
}
diff --git a/src/plugins/runner/osm/OsmParser.cpp b/src/plugins/runner/osm/OsmParser.cpp
index fb13aa2..0aad036 100644
--- a/src/plugins/runner/osm/OsmParser.cpp
+++ b/src/plugins/runner/osm/OsmParser.cpp
@@ -32,7 +32,7 @@ namespace Marble {
GeoDataDocument *OsmParser::parse(const QString &filename, QString &error)
{
QFileInfo const fileInfo(filename);
- if (fileInfo.completeSuffix() == "o5m") {
+ if (fileInfo.completeSuffix() == QLatin1String("o5m")) {
return parseO5m(filename, error);
} else {
return parseXml(filename, error);
@@ -113,7 +113,7 @@ GeoDataDocument* OsmParser::parseXml(const QString &filename, QString &error)
QFile file;
QBuffer buffer;
QFileInfo fileInfo(filename);
- if (fileInfo.completeSuffix() == "osm.zip") {
+ if (fileInfo.completeSuffix() == QLatin1String("osm.zip")) {
MarbleZipReader zipReader(filename);
if (zipReader.fileInfoList().size() != 1) {
int const fileNumber = zipReader.fileInfoList().size();
diff --git a/src/plugins/runner/routino/RoutinoPlugin.cpp b/src/plugins/runner/routino/RoutinoPlugin.cpp
index 576f5ad..59be712 100644
--- a/src/plugins/runner/routino/RoutinoPlugin.cpp
+++ b/src/plugins/runner/routino/RoutinoPlugin.cpp
@@ -95,7 +95,7 @@ public:
}
ui_configWidget->transport->setCurrentIndex(
ui_configWidget->transport->findData( settings.value( "transport" ).toString() ) );
- if ( settings.value( "method" ).toString() == "shortest" ) {
+ if (settings.value("method").toString() == QLatin1String("shortest")) {
ui_configWidget->shortest->setChecked( true );
} else {
ui_configWidget->fastest->setChecked( true );
diff --git a/src/plugins/runner/routino/RoutinoRunner.cpp b/src/plugins/runner/routino/RoutinoRunner.cpp
index f883082..c3b286d 100644
--- a/src/plugins/runner/routino/RoutinoRunner.cpp
+++ b/src/plugins/runner/routino/RoutinoRunner.cpp
@@ -245,7 +245,7 @@ void RoutinoRunner::retrieveRoute( const RouteRequest *route )
QString transport = settings["transport"].toString();
params << QString( "--transport=%0" ).arg( transport );
- if ( settings["method"] == "shortest" ) {
+ if (settings["method"] == QLatin1String("shortest")) {
params << "--shortest";
} else {
params << "--quickest";
diff --git a/tests/PlacemarkPositionProviderPluginTest.cpp b/tests/PlacemarkPositionProviderPluginTest.cpp
index 69537e4..6f05fd7 100644
--- a/tests/PlacemarkPositionProviderPluginTest.cpp
+++ b/tests/PlacemarkPositionProviderPluginTest.cpp
@@ -68,7 +68,7 @@ PlacemarkPositionProviderPluginTest::PlacemarkPositionProviderPluginTest() :
PositionProviderPlugin *PlacemarkPositionProviderPluginTest::createUninitializedPlugin( const PluginManager *pluginManager )
{
foreach ( const PositionProviderPlugin *plugin, pluginManager->positionProviderPlugins() ) {
- if ( plugin->nameId() == "Placemark" ) {
+ if (plugin->nameId() == QLatin1String("Placemark")) {
PositionProviderPlugin *instance = plugin->newInstance();
return instance;
}
diff --git a/tests/TestGeoDataCoordinates.cpp b/tests/TestGeoDataCoordinates.cpp
index bd7c3fd..33ccd6c 100644
--- a/tests/TestGeoDataCoordinates.cpp
+++ b/tests/TestGeoDataCoordinates.cpp
@@ -375,13 +375,13 @@ void TestGeoDataCoordinates::testIsPole()
GeoDataCoordinates coordinates1;
- if(pole == "false_pole") {
+ if (pole == QLatin1String("false_pole")) {
coordinates1.set(lon, lat, alt, GeoDataCoordinates::Degree);
QVERIFY(coordinates1.isPole() == false);
- } else if(pole == "south_pole") {
+ } else if (pole == QLatin1String("south_pole")) {
coordinates1.set(lon, lat, alt, GeoDataCoordinates::Degree);
QVERIFY(coordinates1.isPole(SouthPole));
- } else if(pole == "north_pole") {
+ } else if (pole == QLatin1String("north_pole")) {
coordinates1.set(lon, lat, alt, GeoDataCoordinates::Degree);
QVERIFY(coordinates1.isPole(NorthPole));
}
@@ -482,7 +482,7 @@ void TestGeoDataCoordinates::testNormalize()
QFETCH(qreal, lat);
QFETCH(QString, unit);
- if(unit == "degree") {
+ if (unit == QLatin1String("degree")) {
QCOMPARE(GeoDataCoordinates::normalizeLon(lon, GeoDataCoordinates::Degree), qreal(-160));
QCOMPARE(GeoDataCoordinates::normalizeLat(lat, GeoDataCoordinates::Degree), qreal(50));
@@ -492,7 +492,7 @@ void TestGeoDataCoordinates::testNormalize()
GeoDataCoordinates::normalizeLonLat( normalized_lon, normalized_lat, GeoDataCoordinates::Degree);
QCOMPARE(normalized_lon, qreal(20));
QCOMPARE(normalized_lat, qreal(50));
- } else if (unit == "radian") {
+ } else if (unit == QLatin1String("radian")) {
// Compare up to three decimals
qreal value = GeoDataCoordinates::normalizeLon(lon, GeoDataCoordinates::Radian);
QCOMPARE(ceil(value * 1000) / 1000, qreal(-2.683));
diff --git a/tools/asc2kml/asc2kml.cpp b/tools/asc2kml/asc2kml.cpp
index 78fff6e..c421400 100644
--- a/tools/asc2kml/asc2kml.cpp
+++ b/tools/asc2kml/asc2kml.cpp
@@ -126,8 +126,7 @@ int main(int argc, char *argv[])
const int gmtoffset = ( int ) ( gmt.toFloat() * 100 );
const int dstoffset = ( int ) ( dst.toFloat() * 100 ) - gmtoffset;
- if(role != "PPLX")
- {
+ if (role != QLatin1String("PPLX")) {
targetstream << " <Placemark> \n";
targetstream << " <name>" << escapeXml( name ) << "</name> \n";
targetstream << " <state>" << escapeXml( state ) << "</state> \n";
diff --git a/tools/constellations2kml/constellations2kml.cpp b/tools/constellations2kml/constellations2kml.cpp
index 1243668..56dad78 100644
--- a/tools/constellations2kml/constellations2kml.cpp
+++ b/tools/constellations2kml/constellations2kml.cpp
@@ -128,12 +128,12 @@ int main(int argc, char *argv[])
QList<qreal> z;
int numberOfStars = 0;
for ( int i = 0; i < starIndexes.size(); ++i ) {
- if ( starIndexes.at(i) == "-1" ) {
+ if (starIndexes.at(i) == QLatin1String("-1")) {
out << " </coordinates> \n"
<< " </LineString> \n"
<< " <LineString> \n"
<< " <coordinates> \n";
- } else if ( starIndexes.at(i) == "-2" ) {
+ } else if (starIndexes.at(i) == QLatin1String("-2")) {
out << " </coordinates> \n"
<< " </LineString> \n"
<< " </MultiGeometry> \n"
@@ -143,7 +143,7 @@ int main(int argc, char *argv[])
<< " <MultiGeometry> \n"
<< " <LineString> \n"
<< " <coordinates> \n";
- } else if ( starIndexes.at(i) == "-3" ) {
+ } else if (starIndexes.at(i) == QLatin1String("-3")) {
out << " </coordinates> \n"
<< " </LineString> \n"
<< " </MultiGeometry> \n"
diff --git a/tools/iau2kml/iau2kml.cpp b/tools/iau2kml/iau2kml.cpp
index 3f71de2..1e25b98 100644
--- a/tools/iau2kml/iau2kml.cpp
+++ b/tools/iau2kml/iau2kml.cpp
@@ -110,15 +110,15 @@ int main(int argc, char *argv[])
roleString = splitline[18];
description = splitline[19];
- // if ( roleString == "SF" ) continue;
+ // if (roleString == QLatin1String("SF")) continue;
QString marbleRoleString = QLatin1String( "o" );
- if ( roleString == "AA" || roleString == "SF" ) marbleRoleString = "c";
- if ( roleString == "ME" || roleString == "OC"
- || roleString == "LC" || roleString == "SI" ) marbleRoleString = "a";
- if ( roleString == "MO" ) marbleRoleString = "m";
- if ( roleString == "VA" ) marbleRoleString = "v";
+ if (roleString == QLatin1String("AA") || roleString == QLatin1String("SF")) marbleRoleString = "c";
+ if ( roleString == QLatin1String("ME") || roleString == QLatin1String("OC")
+ || roleString == QLatin1String("LC") || roleString == QLatin1String("SI")) marbleRoleString = "a";
+ if (roleString == QLatin1String("MO")) marbleRoleString = "m";
+ if (roleString == QLatin1String("VA")) marbleRoleString = "v";
population = (int) ( 1000.0 * popString.toFloat() );
diff --git a/tools/osm-addresses/main.cpp b/tools/osm-addresses/main.cpp
index 6d9a1ec..63ae45c 100644
--- a/tools/osm-addresses/main.cpp
+++ b/tools/osm-addresses/main.cpp
@@ -86,19 +86,19 @@ int main( int argc, char *argv[] )
QString payload;
for ( int i=1; i<argc-3; ++i ) {
QString arg( argv[i] );
- if ( arg == "-v" ) {
+ if (arg == QLatin1String("-v")) {
debugLevel = Debug;
- } else if ( arg == "-q" ) {
+ } else if (arg == QLatin1String("-q")) {
debugLevel = Mute;
- } else if ( arg == "--name" ) {
+ } else if (arg == QLatin1String("--name")) {
name = argv[++i];
- } else if ( arg == "--version" ) {
+ } else if (arg == QLatin1String("--version")) {
version = argv[++i];
- } else if ( arg == "--date" ) {
+ } else if (arg == QLatin1String("--date")) {
date = argv[++i];
- } else if ( arg == "--transport" ) {
+ } else if (arg == QLatin1String("--transport")) {
transport = argv[++i];
- } else if ( arg == "--payload" ) {
+ } else if (arg == QLatin1String("--payload")) {
payload = argv[++i];
} else {
usage();
diff --git a/tools/osm-addresses/pbf/PbfParser.cpp b/tools/osm-addresses/pbf/PbfParser.cpp
index 011419c..352ac30 100644
--- a/tools/osm-addresses/pbf/PbfParser.cpp
+++ b/tools/osm-addresses/pbf/PbfParser.cpp
@@ -268,15 +268,15 @@ void PbfParser::parseNode()
QString key = QString::fromUtf8( m_primitiveBlock.stringtable().s( inputNode.keys( tag ) ).data() );
QString value = QString::fromUtf8( m_primitiveBlock.stringtable().s( inputNode.vals( tag ) ).data() );
- if ( key == "name" ) {
+ if (key == QLatin1String("name")) {
node.name = value.trimmed();
- } else if ( key == "addr:street" ) {
+ } else if (key == QLatin1String("addr:street")) {
node.street = value.trimmed();
node.save = true;
- } else if ( key == "addr:housenumber" ) {
+ } else if (key == QLatin1String("addr:housenumber")) {
node.houseNumber = value;
node.save = true;
- } else if ( key == "addr:city" ) {
+ } else if (key == QLatin1String("addr:city")) {
node.city = value;
node.save = true;
} else {
@@ -318,22 +318,22 @@ void PbfParser::parseWay()
QString key = QString::fromUtf8( m_primitiveBlock.stringtable().s( inputWay.keys( tag ) ).data() );
QString value = QString::fromUtf8( m_primitiveBlock.stringtable().s( inputWay.vals( tag ) ).data() );
- if ( key == "name" ) {
+ if (key == QLatin1String("name")) {
way.name = value.trimmed();
- } else if ( key == "addr:street" ) {
+ } else if (key == QLatin1String("addr:street")) {
way.street = value.trimmed();
way.save = true;
- } else if ( key == "addr:housenumber" ) {
+ } else if (key == QLatin1String("addr:housenumber")) {
way.houseNumber = value;
way.save = true;
- } else if ( key == "addr:city" ) {
+ } else if (key == QLatin1String("addr:city")) {
way.city = value;
way.save = true;
- } else if ( key == "building" && value == "yes" ) {
+ } else if (key == QLatin1String("building") && value == QLatin1String("yes")) {
way.isBuilding = true;
- } else if ( key == "boundary" && value == "administrative" ) {
+ } else if (key == QLatin1String("boundary") && value == QLatin1String("administrative")) {
relation.isAdministrativeBoundary = true;
- } else if ( key == "admin_level" ) {
+ } else if (key == QLatin1String("admin_level")) {
relation.adminLevel = value.toInt();
} else {
if ( shouldSave( Marble::WayType, key, value ) ) {
@@ -396,13 +396,13 @@ void PbfParser::parseRelation()
QString key = QString::fromUtf8( m_primitiveBlock.stringtable().s( inputRelation.keys( tag ) ).data() );
QString value = QString::fromUtf8( m_primitiveBlock.stringtable().s( inputRelation.vals( tag ) ).data() );
- if ( key == "boundary" && value == "administrative" ) {
+ if (key == QLatin1String("boundary") && value == QLatin1String("administrative")) {
relation.isAdministrativeBoundary = true;
- } else if ( key == "admin_level" ) {
+ } else if (key == QLatin1String("admin_level")) {
relation.adminLevel = value.toInt();
- } else if ( key == "name" ) {
+ } else if (key == QLatin1String("name")) {
relation.name = value.trimmed();
- } else if ( key == "type" && value == "multipolygon" ) {
+ } else if (key == QLatin1String("type") && value == QLatin1String("multipolygon")) {
relation.isMultipolygon = true;
}
}
@@ -469,15 +469,15 @@ void PbfParser::parseDense()
QString key = QString::fromUtf8( m_primitiveBlock.stringtable().s( dense.keys_vals( m_lastDenseTag ) ).data() );
QString value = QString::fromUtf8( m_primitiveBlock.stringtable().s( dense.keys_vals( m_lastDenseTag + 1 ) ).data() );
- if ( key == "name" ) {
+ if (key == QLatin1String("name")) {
node.name = value.trimmed();
- } else if ( key == "addr:street" ) {
+ } else if (key == QLatin1String("addr:street")) {
node.street = value.trimmed();
node.save = true;
- } else if ( key == "addr:housenumber" ) {
+ } else if (key == QLatin1String("addr:housenumber")) {
node.houseNumber = value;
node.save = true;
- } else if ( key == "addr:city" ) {
+ } else if (key == QLatin1String("addr:city")) {
node.city = value;
node.save = true;
} else {
diff --git a/tools/osm-addresses/xml/XmlParser.cpp b/tools/osm-addresses/xml/XmlParser.cpp
index 5a4e470..a0a3ec8 100644
--- a/tools/osm-addresses/xml/XmlParser.cpp
+++ b/tools/osm-addresses/xml/XmlParser.cpp
@@ -42,61 +42,61 @@ bool XmlParser::parse( const QFileInfo &content, int, bool &needAnotherPass )
bool XmlParser::startElement ( const QString & /*namespaceURI*/, const QString & /*localName*/, const QString & qName, const QXmlAttributes & atts )
{
- if ( qName == "node" ) {
+ if (qName == QLatin1String("node")) {
m_node = Node();
m_id = atts.value( "id" ).toInt();
m_node.lon = atts.value( "lon" ).toFloat();
m_node.lat = atts.value( "lat" ).toFloat();
m_element = NodeType;
- } else if ( qName == "way" ) {
+ } else if (qName == QLatin1String("way")) {
m_id = atts.value( "id" ).toInt();
m_way = Way();
m_element = WayType;
- } else if ( qName == "nd" ) {
+ } else if (qName == QLatin1String("nd")) {
m_way.nodes.push_back( atts.value( "ref" ).toInt() );
- } else if ( qName == "relation" ) {
+ } else if (qName == QLatin1String("relation")) {
m_id = atts.value( "id" ).toInt();
m_relation = Relation();
m_relation.nodes.clear();
m_element = RelationType;
- } else if ( qName == "member" ) {
- if ( atts.value( "type" ) == "node" ) {
+ } else if (qName == QLatin1String("member")) {
+ if (atts.value("type") == QLatin1String("node")) {
m_relation.nodes.push_back( atts.value( "ref" ).toInt() );
- } else if ( atts.value( "type" ) == "way" ) {
+ } else if (atts.value("type") == QLatin1String("way")) {
RelationRole role = None;
- if ( atts.value( "role" ) == "outer" ) role = Outer;
- if ( atts.value( "role" ) == "inner" ) role = Inner;
+ if (atts.value("role") == QLatin1String("outer")) role = Outer;
+ if (atts.value("role") == QLatin1String("inner")) role = Inner;
m_relation.ways.push_back( QPair<int, RelationRole>( atts.value( "ref" ).toInt(), role ) );
- } else if ( atts.value( "type" ) == "relation" ) {
+ } else if (atts.value("type") == QLatin1String("relation")) {
m_relation.relations.push_back( atts.value( "ref" ).toInt() );
} else {
qDebug() << "Unknown relation member type " << atts.value( "type" );
}
- } else if ( qName == "tag" && m_element == RelationType ) {
- if ( atts.value( "k" ) == "boundary" && atts.value( "v" ) == "administrative" ) {
+ } else if (qName == QLatin1String("tag") && m_element == RelationType) {
+ if (atts.value("k") == QLatin1String("boundary") && atts.value("v") == QLatin1String("administrative")) {
m_relation.isAdministrativeBoundary = true;
- } else if ( atts.value( "k" ) == "admin_level" ) {
+ } else if (atts.value("k") == QLatin1String("admin_level")) {
m_relation.adminLevel = atts.value( "v" ).toInt();
- } else if ( atts.value( "k" ) == "name" ) {
+ } else if (atts.value("k") == QLatin1String("name")) {
m_relation.name = atts.value( "v" );
- } else if ( atts.value( "k" ) == "type" && atts.value( "v" ) == "multipolygon" ) {
+ } else if (atts.value("k") == QLatin1String("type") && atts.value("v") == QLatin1String("multipolygon")) {
m_relation.isMultipolygon = true;
}
- } else if ( qName == "tag" && m_element == WayType ) {
+ } else if (qName == QLatin1String("tag") && m_element == WayType) {
QString const key = atts.value( "k" );
QString const value = atts.value( "v" );
- if ( key == "name" ) {
+ if (key == QLatin1String("name")) {
m_way.name = value;
- } else if ( key == "addr:street" ) {
+ } else if (key == QLatin1String("addr:street")) {
m_way.street = value;
m_way.save = true;
- } else if ( key == "addr:housenumber" ) {
+ } else if (key == QLatin1String("addr:housenumber")) {
m_way.houseNumber = value;
m_way.save = true;
- } else if ( key == "addr:city" ) {
+ } else if (key == QLatin1String("addr:city")) {
m_way.city = value;
m_way.save = true;
- } else if ( key == "building" && value == "yes" ) {
+ } else if (key == QLatin1String("building") && value == QLatin1String("yes")) {
m_way.isBuilding = true;
} else {
if ( shouldSave( WayType, key, value ) ) {
@@ -104,18 +104,18 @@ bool XmlParser::startElement ( const QString & /*namespaceURI*/, const QString &
}
setCategory( m_way, key, value );
}
- } else if ( qName == "tag" && m_element == NodeType ) {
+ } else if (qName == QLatin1String("tag") && m_element == NodeType) {
QString const key = atts.value( "k" );
QString const value = atts.value( "v" );
- if ( key == "name" ) {
+ if (key == QLatin1String("name")) {
m_node.name = value;
- } else if ( key == "addr:street" ) {
+ } else if (key == QLatin1String("addr:street")) {
m_node.street = value;
m_node.save = true;
- } else if ( key == "addr:housenumber" ) {
+ } else if (key == QLatin1String("addr:housenumber")) {
m_node.houseNumber = value;
m_node.save = true;
- } else if ( key == "addr:city" ) {
+ } else if (key == QLatin1String("addr:city")) {
m_node.city = value;
m_node.save = true;
} else {
@@ -131,11 +131,11 @@ bool XmlParser::startElement ( const QString & /*namespaceURI*/, const QString &
bool XmlParser::endElement ( const QString & /*namespaceURI*/, const QString & /*localName*/, const QString & qName )
{
- if ( qName == "node" ) {
+ if (qName == QLatin1String("node")) {
m_nodes[m_id] = m_node;
- } else if ( qName == "way" ) {
+ } else if (qName == QLatin1String("way")) {
m_ways[m_id] = m_way;
- } else if ( qName == "relation" ) {
+ } else if (qName == QLatin1String("relation")) {
m_relations[m_id] = m_relation;
}
diff --git a/tools/osm-simplify/TagsFilter.cpp b/tools/osm-simplify/TagsFilter.cpp
index 85737fd..564db6c 100644
--- a/tools/osm-simplify/TagsFilter.cpp
+++ b/tools/osm-simplify/TagsFilter.cpp
@@ -42,7 +42,7 @@ TagsFilter::TagsFilter(GeoDataDocument *document, const QStringList &tagsList, b
currentValue = currentTag[1].trimmed();
}
bool contains;
- if (currentValue == "*") {
+ if (currentValue == QLatin1String("*")) {
contains = placemark->osmData().containsTagKey(currentKey);
} else {
contains = placemark->osmData().containsTag(currentKey, currentValue);
diff --git a/tools/osm-simplify/main.cpp b/tools/osm-simplify/main.cpp
index 39eba0d..bbe8626 100644
--- a/tools/osm-simplify/main.cpp
+++ b/tools/osm-simplify/main.cpp
@@ -183,7 +183,7 @@ int main(int argc, char *argv[])
mergeMap = manager.openFile(mergeFileName, DocumentRole::MapDocument, 600000);
}
- if(file.suffix() == "shp" && parser.isSet("cut-to-tiles")) {
+ if(file.suffix() == QLatin1String("shp") && parser.isSet("cut-to-tiles")) {
ShpCoastlineProcessor processor(map);
processor.process();
GeoDataLatLonBox world(85.0, -85.0, 180.0, -180.0, GeoDataCoordinates::Degree);
@@ -197,7 +197,7 @@ int main(int argc, char *argv[])
qInfo() << tile->name() << " done";
delete tile;
}
- } else if (file.suffix() == "osm" && parser.isSet("cut-to-tiles") && parser.isSet("merge")) {
+ } else if (file.suffix() == QLatin1String("osm") && parser.isSet("cut-to-tiles") && parser.isSet("merge")) {
TinyPlanetProcessor processor(map);
processor.process();
ShpCoastlineProcessor shpProcessor(mergeMap);
@@ -217,7 +217,7 @@ int main(int argc, char *argv[])
delete tile2;
delete tile;
}
- } else if (file.suffix() == "osm" && parser.isSet("cut-to-tiles")) {
+ } else if (file.suffix() == QLatin1String("osm") && parser.isSet("cut-to-tiles")) {
TinyPlanetProcessor processor(map);
processor.process();
diff --git a/tools/osm-sisyphus/jobmanager.cpp b/tools/osm-sisyphus/jobmanager.cpp
index 8019edf..f2fc6f0 100644
--- a/tools/osm-sisyphus/jobmanager.cpp
+++ b/tools/osm-sisyphus/jobmanager.cpp
@@ -80,13 +80,13 @@ void JobManager::setRegionsFile(const QString &filename)
PendingJob job;
job.m_region = region;
job.m_transport = value.trimmed();
- if (job.m_transport == "Motorcar") {
+ if (job.m_transport == QLatin1String("Motorcar")) {
job.m_profile = "motorcar";
m_pendingJobs << job;
- } else if (job.m_transport == "Bicycle") {
+ } else if (job.m_transport == QLatin1String("Bicycle")) {
job.m_profile = "bicycle";
m_pendingJobs << job;
- } else if (job.m_transport == "Pedestrian") {
+ } else if (job.m_transport == QLatin1String("Pedestrian")) {
job.m_profile = "foot";
m_pendingJobs << job;
} else {
diff --git a/tools/osm-sisyphus/main.cpp b/tools/osm-sisyphus/main.cpp
index 9cabdb5..f537be1 100644
--- a/tools/osm-sisyphus/main.cpp
+++ b/tools/osm-sisyphus/main.cpp
@@ -33,12 +33,12 @@ int main(int argc, char *argv[])
bool uploadFiles(true);
for (int i=1; i<argc; ++i) {
QString const arg = argv[i];
- if (arg == "-h" || arg == "--help") {
+ if (arg == QLatin1String("-h") || arg == QLatin1String("--help")) {
usage(argv[0]);
return 0;
- } else if (arg == "-cd" || arg == "--cache-data") {
+ } else if (arg == QLatin1String("-cd") || arg == QLatin1String("--cache-data")) {
cacheData = true;
- } else if (arg == "-nu" || arg == "--no-uploads") {
+ } else if (arg == QLatin1String("-nu") || arg == QLatin1String("--no-uploads")) {
uploadFiles = false;
} else {
arguments << arg;
diff --git a/tools/pntreplace/svgxmlhandler.cpp b/tools/pntreplace/svgxmlhandler.cpp
index 7c73085..4cc626b 100644
--- a/tools/pntreplace/svgxmlhandler.cpp
+++ b/tools/pntreplace/svgxmlhandler.cpp
@@ -25,7 +25,7 @@ bool SVGXmlHandler::startElement(const QString& /*nspace*/,
const QString& qName,
const QXmlAttributes &atts)
{
- if ( qName == "path" && atts.value( "id" ) == m_path ) {
+ if (qName == QLatin1String("path") && atts.value("id") == m_path) {
QString coordinates = atts.value( "d" );
QStringList stringlist;
diff --git a/tools/poly2kml/main.cpp b/tools/poly2kml/main.cpp
index 0ace84a..5e2756d 100644
--- a/tools/poly2kml/main.cpp
+++ b/tools/poly2kml/main.cpp
@@ -68,13 +68,13 @@ void parseBoundingBox( const QFileInfo &file, const QString &name,
QString line = stream.readLine().trimmed();
QStringList entries = line.split( QLatin1Char( ' ' ), QString::SkipEmptyParts );
if ( entries.size() == 1 ) {
- if ( entries.first() == "END" && inside ) {
+ if (entries.first() == QLatin1String("END") && inside) {
inside = false;
if (!box->isEmpty()) {
geometry->append(box);
box = new GeoDataLinearRing;
}
- } else if ( entries.first() == "END" && !inside ) {
+ } else if (entries.first() == QLatin1String("END") && !inside) {
qDebug() << "END not expected here";
} else if ( entries.first().startsWith( QLatin1String( "!" ) ) ) {
qDebug() << "Warning: Negative polygons not supported, skipping";
@@ -164,15 +164,15 @@ int main( int argc, char* argv[] )
QString payload;
for ( int i=1; i<argc-2; ++i ) {
QString arg( argv[i] );
- if ( arg == "--name" ) {
+ if (arg == QLatin1String("--name")) {
name = argv[++i];
- } else if ( arg == "--version" ) {
+ } else if (arg == QLatin1String("--version")) {
version = argv[++i];
- } else if ( arg == "--date" ) {
+ } else if (arg == QLatin1String("--date")) {
date = argv[++i];
- } else if ( arg == "--transport" ) {
+ } else if (arg == QLatin1String("--transport")) {
transport = argv[++i];
- } else if ( arg == "--payload" ) {
+ } else if (arg == QLatin1String("--payload")) {
payload = argv[++i];
} else {
usage();
diff --git a/tools/routing-instructions/main.cpp b/tools/routing-instructions/main.cpp
index dc3dd6f..83b39e2 100644
--- a/tools/routing-instructions/main.cpp
+++ b/tools/routing-instructions/main.cpp
@@ -44,7 +44,7 @@ void loadTranslations( QCoreApplication &app, QTranslator &translator )
QString code;
int index = lang.indexOf ( '_' );
- if ( lang == "C" ) {
+ if (lang == QLatin1String("C")) {
code = "en";
}
else if ( index != -1 ) {
diff --git a/tools/shp2pn2/shp2pn2.cpp b/tools/shp2pn2/shp2pn2.cpp
index 307c625..ba014a3 100644
--- a/tools/shp2pn2/shp2pn2.cpp
+++ b/tools/shp2pn2/shp2pn2.cpp
@@ -218,7 +218,7 @@ int main(int argc, char** argv)
}
GeoDataSchema schema = document->schema( QString("default") );
- if ( schema.simpleField("mapcolor13").name() == QString("mapcolor13") ) {
+ if (schema.simpleField("mapcolor13").name() == QLatin1String("mapcolor13")) {
isMapColorField = true;
}
diff --git a/tools/speaker-files/main.cpp b/tools/speaker-files/main.cpp
index a39d21a..0cbadee 100644
--- a/tools/speaker-files/main.cpp
+++ b/tools/speaker-files/main.cpp
@@ -289,7 +289,7 @@ int process( const QDir &input, const QDir &output, const QString &xml )
createLegalFiles( extracted, name, email );
QFile::copy( extracted + "/Marble.ogg", nickDir + '/' + lang + '-' + simpleNick + ".ogg" );
convertToMarbleFormat( extracted, nickDir + '/' + lang + '-' + simpleNick + ".zip" );
- convertToTomTomFormat( extracted, nickDir, nick, simpleNick, index, gender == "male", lang );
+ convertToTomTomFormat(extracted, nickDir, nick, simpleNick, index, gender == QLatin1String("male"), lang);
convertToNewStuffFormat( extracted, nickDir + '/' + lang + '-' + simpleNick + ".tar.gz" );
xmlOut << " <stuff category=\"marble/data/audio\">\n";
diff --git a/tools/stars/stars.cpp b/tools/stars/stars.cpp
index 7a4a13b..4d6ecf2 100644
--- a/tools/stars/stars.cpp
+++ b/tools/stars/stars.cpp
@@ -71,7 +71,7 @@ void exportToDat()
int colorIdx = 2; // Default White
// Find Index of Table Entry with Closest B-V value (Smallest Difference)
- if(bvString != QString(" ")) {
+ if (bvString != QLatin1String(" ")) {
double bvValue = bvString.toDouble();
double bvMinDifference = fabs(colorTable.at(0)-bvValue);
for (int i = 1; i < colorTable.size(); ++i) {
@@ -584,7 +584,7 @@ void exportToKml()
int colorIdx = 2; // Default White
// Find Index of Table Entry with Closest B-V value (Smallest Difference)
- if(bvString != QString(" ")) {
+ if (bvString != QLatin1String(" ")) {
double bvValue = bvString.toDouble();
double bvMinDifference = fabs(colorTable.at(0)-bvValue);
for (int i = 1; i < colorTable.size(); ++i) {
@@ -645,15 +645,15 @@ void exportToKml()
out << " <Placemark> \n";
QString name = line.mid( 7, 3 );
- if ( name == "Alp" ) {
+ if (name == QLatin1String("Alp")) {
out << " <name>" << QString::fromUtf8( "α" ) << "</name> \n";
- } else if ( name == "Bet" ) {
+ } else if (name == QLatin1String("Bet")) {
out << " <name>" << QString::fromUtf8( "β" ) << "</name> \n";
- } else if ( name == "Gam" ) {
+ } else if (name == QLatin1String("Gam")) {
out << " <name>" << QString::fromUtf8( "γ" ) << "</name> \n";
- } else if ( name == "Del" ) {
+ } else if (name == QLatin1String("Del")) {
out << " <name>" << QString::fromUtf8( "δ" ) << "</name> \n";
- } else if ( name == "Eps" ) {
+ } else if (name == QLatin1String("Eps")) {
out << " <name>" << QString::fromUtf8( "ε" ) << "</name> \n";
}
diff --git a/tools/svg2pnt/svgxmlhandler.cpp b/tools/svg2pnt/svgxmlhandler.cpp
index 8a59cd5..64d6f70 100644
--- a/tools/svg2pnt/svgxmlhandler.cpp
+++ b/tools/svg2pnt/svgxmlhandler.cpp
@@ -31,12 +31,12 @@ bool SVGXmlHandler::startElement(const QString& nspace,
Q_UNUSED(localName)
qDebug();
- if ( qName == "g" ) {
+ if (qName == QLatin1String("g")) {
qDebug( "Parsing Data ..." );
m_initialized = true;
}
- if ( qName == "path" && m_initialized ) {
+ if (qName == QLatin1String("path") && m_initialized) {
QString coordinates = atts.value( "d" );
QStringList stringlist;