Use more QLatin1String for comparing raw strings to QStrings

parent 76bc83e6
......@@ -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 ) );
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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 );
......
......@@ -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() );
......
......@@ -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()
......
......@@ -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();
......
......@@ -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 ) )
......
......@@ -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 ) {
......
......@@ -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 );
......
......@@ -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 ) );
}
}
......
......@@ -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();
......
......@@ -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());
}
......
......@@ -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 );
}
......
......@@ -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;
}
......
......@@ -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";
}
......
......@@ -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 );
......
......@@ -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 ) {
......
......@@ -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 );
}
}
......
......@@ -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 );
......
......@@ -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 );
}
}
......
......@@ -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,