summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFriedrich W. H. Kossebau <kossebau@kde.org>2016-09-02 17:00:17 (GMT)
committerFriedrich W. H. Kossebau <kossebau@kde.org>2016-09-02 17:00:17 (GMT)
commit531bebed03f7a80593e72eb9680d80dc17d33d9e (patch)
treeca66384f1731544202eff196b6e9fc9ecfd0f750
parent9c43b4403851b16829ce32533f9aa4be7ae99438 (diff)
Use QStringLiteral with QString keys for setting methods
-rw-r--r--src/lib/marble/AbstractFloatItem.cpp8
-rw-r--r--src/lib/marble/MapViewWidget.cpp14
-rw-r--r--src/lib/marble/RenderPlugin.cpp8
-rw-r--r--src/plugins/render/aprs/AprsPlugin.cpp48
-rw-r--r--src/plugins/render/compass/CompassFloatItem.cpp4
-rw-r--r--src/plugins/render/crosshairs/CrosshairsPlugin.cpp4
-rw-r--r--src/plugins/render/earthquake/EarthquakePlugin.cpp28
-rw-r--r--src/plugins/render/eclipses/EclipsesPlugin.cpp42
-rw-r--r--src/plugins/render/foursquare/FoursquarePlugin.cpp6
-rw-r--r--src/plugins/render/graticule/GraticulePlugin.cpp20
-rw-r--r--src/plugins/render/measure/MeasureToolPlugin.cpp36
-rw-r--r--src/plugins/render/navigation/NavigationFloatItem.cpp4
-rw-r--r--src/plugins/render/opendesktop/OpenDesktopPlugin.cpp4
-rw-r--r--src/plugins/render/overviewmap/OverviewMap.cpp20
-rw-r--r--src/plugins/render/photo/PhotoPlugin.cpp8
-rw-r--r--src/plugins/render/positionmarker/PositionMarker.cpp24
-rw-r--r--src/plugins/render/routing/RoutingPlugin.cpp12
-rw-r--r--src/plugins/render/satellites/SatellitesConfigLeafItem.cpp2
-rw-r--r--src/plugins/render/satellites/SatellitesModel.cpp2
-rw-r--r--src/plugins/render/satellites/SatellitesPlugin.cpp48
-rw-r--r--src/plugins/render/stars/StarsPlugin.cpp86
-rw-r--r--src/plugins/render/weather/WeatherItem.cpp16
-rw-r--r--src/plugins/render/weather/WeatherPlugin.cpp56
-rw-r--r--src/plugins/render/wikipedia/WikipediaItem.cpp2
-rw-r--r--src/plugins/render/wikipedia/WikipediaPlugin.cpp8
-rw-r--r--src/plugins/runner/cyclestreets/CycleStreetsPlugin.cpp16
-rw-r--r--src/plugins/runner/cyclestreets/CycleStreetsRunner.cpp6
-rw-r--r--src/plugins/runner/mapquest/MapQuestPlugin.cpp52
-rw-r--r--src/plugins/runner/mapquest/MapQuestRunner.cpp15
-rw-r--r--src/plugins/runner/monav/MonavConfigWidget.cpp4
-rw-r--r--src/plugins/runner/monav/MonavPlugin.cpp4
-rw-r--r--src/plugins/runner/openrouteservice/OpenRouteServicePlugin.cpp28
-rw-r--r--src/plugins/runner/openrouteservice/OpenRouteServiceRunner.cpp11
-rw-r--r--src/plugins/runner/routino/RoutinoPlugin.cpp30
-rw-r--r--src/plugins/runner/routino/RoutinoRunner.cpp6
35 files changed, 341 insertions, 341 deletions
diff --git a/src/lib/marble/AbstractFloatItem.cpp b/src/lib/marble/AbstractFloatItem.cpp
index c17c8a8..afe3f63 100644
--- a/src/lib/marble/AbstractFloatItem.cpp
+++ b/src/lib/marble/AbstractFloatItem.cpp
@@ -73,19 +73,19 @@ AbstractFloatItem::~AbstractFloatItem()
QHash<QString,QVariant> AbstractFloatItem::settings() const
{
QHash<QString,QVariant> updated = RenderPlugin::settings();
- updated["position"] = position();
+ updated.insert(QStringLiteral("position"), position());
return updated;
}
void AbstractFloatItem::setSettings(const QHash<QString, QVariant> &settings)
{
- if ( settings.value( "position" ).type() == QVariant::String ) {
+ if (settings.value(QStringLiteral("position")).type() == QVariant::String) {
// work around KConfig turning QPointFs into QStrings
- const QStringList coordinates = settings.value( "position" ).toString().split( QLatin1Char(',') );
+ const QStringList coordinates = settings.value(QStringLiteral("position")).toString().split(QLatin1Char(','));
setPosition( QPointF( coordinates.at( 0 ).toFloat(), coordinates.at( 1 ).toFloat() ) );
}
else {
- setPosition( settings.value( "position", position() ).toPointF() );
+ setPosition(settings.value(QStringLiteral("position"), position()).toPointF());
}
RenderPlugin::setSettings(settings);
diff --git a/src/lib/marble/MapViewWidget.cpp b/src/lib/marble/MapViewWidget.cpp
index 6ee6e4b..f54ab03 100644
--- a/src/lib/marble/MapViewWidget.cpp
+++ b/src/lib/marble/MapViewWidget.cpp
@@ -317,13 +317,13 @@ MapViewWidget::MapViewWidget( QWidget *parent, Qt::WindowFlags f )
connect( d->m_mapViewUi.celestialBodyComboBox, SIGNAL(activated(int)),
this, SLOT(celestialBodySelected(int)) );
- d->m_settings.beginGroup( "Favorites" );
- if( !d->m_settings.contains( "initialized" ) ) {
- d->m_settings.setValue( "initialized", true );
+ d->m_settings.beginGroup(QStringLiteral("Favorites"));
+ if (!d->m_settings.contains(QStringLiteral("initialized"))) {
+ d->m_settings.setValue(QStringLiteral("initialized"), true);
QDateTime currentDateTime = QDateTime::currentDateTime();
- d->m_settings.setValue( "Atlas", currentDateTime );
- d->m_settings.setValue( "OpenStreetMap", currentDateTime );
- d->m_settings.setValue( "Satellite View", currentDateTime );
+ d->m_settings.setValue(QStringLiteral("Atlas"), currentDateTime);
+ d->m_settings.setValue(QStringLiteral("OpenStreetMap"), currentDateTime);
+ d->m_settings.setValue(QStringLiteral("Satellite View"), currentDateTime);
}
d->m_settings.endGroup();
}
@@ -687,7 +687,7 @@ void MapViewWidget::Private::toggleIconSize()
bool const isLarge = m_mapViewUi.marbleThemeSelectView->iconSize() == QSize( 96, 96 );
int const size = isLarge ? 52 : 96;
m_mapViewUi.marbleThemeSelectView->setIconSize( QSize( size, size ) );
- m_settings.setValue("MapView/iconSize", m_mapViewUi.marbleThemeSelectView->iconSize() );
+ m_settings.setValue(QStringLiteral("MapView/iconSize"), m_mapViewUi.marbleThemeSelectView->iconSize() );
}
bool MapViewWidget::Private::isCurrentFavorite() const
diff --git a/src/lib/marble/RenderPlugin.cpp b/src/lib/marble/RenderPlugin.cpp
index 271fbcd..2cdb9f6 100644
--- a/src/lib/marble/RenderPlugin.cpp
+++ b/src/lib/marble/RenderPlugin.cpp
@@ -186,16 +186,16 @@ QHash<QString,QVariant> RenderPlugin::settings() const
{
QHash<QString,QVariant> result;
- result.insert( "enabled", enabled() );
- result.insert( "visible", visible() );
+ result.insert(QStringLiteral("enabled"), enabled());
+ result.insert(QStringLiteral("visible"), visible());
return result;
}
void RenderPlugin::setSettings( const QHash<QString,QVariant> &settings )
{
- setEnabled( settings.value( "enabled", enabled() ).toBool() );
- setVisible( settings.value( "visible", visible() ).toBool() );
+ setEnabled(settings.value(QStringLiteral("enabled"), enabled()).toBool());
+ setVisible(settings.value(QStringLiteral("visible"), visible()).toBool());
}
RenderPlugin::RenderType RenderPlugin::renderType() const
diff --git a/src/plugins/render/aprs/AprsPlugin.cpp b/src/plugins/render/aprs/AprsPlugin.cpp
index de80108..861c7e7 100644
--- a/src/plugins/render/aprs/AprsPlugin.cpp
+++ b/src/plugins/render/aprs/AprsPlugin.cpp
@@ -356,18 +356,18 @@ QHash<QString,QVariant> AprsPlugin::settings() const
{
QHash<QString, QVariant> result = RenderPlugin::settings();
- result.insert( "useInternet", m_useInternet );
- result.insert( "useTTY", m_useTty );
- result.insert( "useFile", m_useFile );
- result.insert( "APRSHost", m_aprsHost );
- result.insert( "APRSPort", m_aprsPort );
- result.insert( "TNCTTY", m_tncTty );
- result.insert( "FileName", m_aprsFile );
- result.insert( "TCPIPDump", m_dumpTcpIp );
- result.insert( "TTYDump", m_dumpTty );
- result.insert( "FileDump", m_dumpFile );
- result.insert( "fadeTime", m_fadeTime );
- result.insert( "hideTime", m_hideTime );
+ result.insert(QStringLiteral("useInternet"), m_useInternet);
+ result.insert(QStringLiteral("useTTY"), m_useTty);
+ result.insert(QStringLiteral("useFile"), m_useFile);
+ result.insert(QStringLiteral("APRSHost"), m_aprsHost);
+ result.insert(QStringLiteral("APRSPort"), m_aprsPort);
+ result.insert(QStringLiteral("TNCTTY"), m_tncTty);
+ result.insert(QStringLiteral("FileName"), m_aprsFile);
+ result.insert(QStringLiteral("TCPIPDump"), m_dumpTcpIp);
+ result.insert(QStringLiteral("TTYDump"), m_dumpTty);
+ result.insert(QStringLiteral("FileDump"), m_dumpFile);
+ result.insert(QStringLiteral("fadeTime"), m_fadeTime);
+ result.insert(QStringLiteral("hideTime"), m_hideTime);
return result;
}
@@ -376,21 +376,21 @@ void AprsPlugin::setSettings( const QHash<QString,QVariant> &settings )
{
RenderPlugin::setSettings( settings );
- m_useInternet = settings.value( "useInternet", true ).toBool();
- m_useTty = settings.value( "useTTY", false ).toBool();
- m_useFile = settings.value( "useFile", false ).toBool();
+ m_useInternet = settings.value(QStringLiteral("useInternet"), true).toBool();
+ m_useTty = settings.value(QStringLiteral("useTTY"), false).toBool();
+ m_useFile = settings.value(QStringLiteral("useFile"), false).toBool();
- m_aprsHost = settings.value( "APRSHost", "rotate.aprs.net" ).toString();
- m_aprsPort = settings.value( "APRSPort", 10253 ).toInt();
- m_tncTty = settings.value( "TNCTTY", "/dev/ttyUSB0" ).toString();
- m_aprsFile = settings.value( "FileName", "" ).toString();
+ m_aprsHost = settings.value(QStringLiteral("APRSHost"), QStringLiteral("rotate.aprs.net")).toString();
+ m_aprsPort = settings.value(QStringLiteral("APRSPort"), 10253).toInt();
+ m_tncTty = settings.value(QStringLiteral("TNCTTY"), QStringLiteral("/dev/ttyUSB0")).toString();
+ m_aprsFile = settings.value(QStringLiteral("FileName"), QString()).toString();
- m_dumpTcpIp = settings.value( "TCPIPDump", false ).toBool();
- m_dumpTty = settings.value( "TTYDump", false ).toBool();
- m_dumpFile = settings.value( "FileDump", false ).toBool();
+ m_dumpTcpIp = settings.value(QStringLiteral("TCPIPDump"), false).toBool();
+ m_dumpTty = settings.value(QStringLiteral("TTYDump"), false).toBool();
+ m_dumpFile = settings.value(QStringLiteral("FileDump"), false).toBool();
- m_fadeTime = settings.value( "fadeTime", 10 ).toInt();
- m_hideTime = settings.value( "hideTime", 45 ).toInt();
+ m_fadeTime = settings.value(QStringLiteral("fadeTime"), 10).toInt();
+ m_hideTime = settings.value(QStringLiteral("hideTime"), 45).toInt();
readSettings();
emit settingsChanged( nameId() );
diff --git a/src/plugins/render/compass/CompassFloatItem.cpp b/src/plugins/render/compass/CompassFloatItem.cpp
index a94a8c0..b7122ec 100644
--- a/src/plugins/render/compass/CompassFloatItem.cpp
+++ b/src/plugins/render/compass/CompassFloatItem.cpp
@@ -205,7 +205,7 @@ QHash<QString,QVariant> CompassFloatItem::settings() const
{
QHash<QString, QVariant> result = AbstractFloatItem::settings();
- result.insert( "theme", m_themeIndex );
+ result.insert(QStringLiteral("theme"), m_themeIndex);
return result;
}
@@ -214,7 +214,7 @@ void CompassFloatItem::setSettings( const QHash<QString,QVariant> &settings )
{
AbstractFloatItem::setSettings( settings );
- m_themeIndex = settings.value( "theme", 0 ).toInt();
+ m_themeIndex = settings.value(QStringLiteral("theme"), 0).toInt();
readSettings();
}
diff --git a/src/plugins/render/crosshairs/CrosshairsPlugin.cpp b/src/plugins/render/crosshairs/CrosshairsPlugin.cpp
index d6dda19..f81cd97 100644
--- a/src/plugins/render/crosshairs/CrosshairsPlugin.cpp
+++ b/src/plugins/render/crosshairs/CrosshairsPlugin.cpp
@@ -148,7 +148,7 @@ QHash<QString,QVariant> CrosshairsPlugin::settings() const
{
QHash<QString, QVariant> result = RenderPlugin::settings();
- result.insert( "theme", m_themeIndex );
+ result.insert(QStringLiteral("theme"), m_themeIndex);
return result;
}
@@ -157,7 +157,7 @@ void CrosshairsPlugin::setSettings( const QHash<QString,QVariant> &settings )
{
RenderPlugin::setSettings( settings );
- m_themeIndex = settings.value( "theme", 0 ).toInt();
+ m_themeIndex = settings.value(QStringLiteral("theme"), 0).toInt();
readSettings();
}
diff --git a/src/plugins/render/earthquake/EarthquakePlugin.cpp b/src/plugins/render/earthquake/EarthquakePlugin.cpp
index 4977db5..f02e8fd 100644
--- a/src/plugins/render/earthquake/EarthquakePlugin.cpp
+++ b/src/plugins/render/earthquake/EarthquakePlugin.cpp
@@ -128,13 +128,13 @@ QHash<QString,QVariant> EarthquakePlugin::settings() const
{
QHash<QString, QVariant> settings = AbstractDataPlugin::settings();
- settings.insert( "numResults", m_numResults );
- settings.insert( "minMagnitude", m_minMagnitude );
- settings.insert( "startDate", m_startDate );
- settings.insert( "endDate", m_endDate );
- settings.insert( "pastDays", m_pastDays );
- settings.insert( "timeRangeNPastDays", m_timeRangeNPastDays );
- settings.insert( "maximumNumberOfItems", m_maximumNumberOfItems );
+ settings.insert(QStringLiteral("numResults"), m_numResults);
+ settings.insert(QStringLiteral("minMagnitude"), m_minMagnitude);
+ settings.insert(QStringLiteral("startDate"), m_startDate);
+ settings.insert(QStringLiteral("endDate"), m_endDate);
+ settings.insert(QStringLiteral("pastDays"), m_pastDays);
+ settings.insert(QStringLiteral("timeRangeNPastDays"), m_timeRangeNPastDays);
+ settings.insert(QStringLiteral("maximumNumberOfItems"), m_maximumNumberOfItems);
return settings;
}
@@ -143,13 +143,13 @@ void EarthquakePlugin::setSettings( const QHash<QString,QVariant> &settings )
{
AbstractDataPlugin::setSettings( settings );
- m_numResults = settings.value( "numResults", 20 ).toInt();
- m_minMagnitude = settings.value( "minMagnitude", 0.0 ).toReal();
- m_startDate = settings.value( "startDate", QDateTime::fromString( "2006-02-04", "yyyy-MM-dd" ) ).toDateTime();
- m_endDate = settings.value( "endDate", marbleModel()->clockDateTime() ).toDateTime();
- m_pastDays = settings.value( "pastDays", 30 ).toInt();
- m_timeRangeNPastDays = settings.value( "timeRangeNPastDays", true ).toBool();
- m_maximumNumberOfItems = settings.value( "maximumNumberOfItems", m_maximumNumberOfItems ).toInt();
+ m_numResults = settings.value(QStringLiteral("numResults"), 20).toInt();
+ m_minMagnitude = settings.value(QStringLiteral("minMagnitude"), 0.0).toReal();
+ m_startDate = settings.value(QStringLiteral("startDate"), QDateTime::fromString(QStringLiteral("2006-02-04"), QStringLiteral("yyyy-MM-dd"))).toDateTime();
+ m_endDate = settings.value(QStringLiteral("endDate"), marbleModel()->clockDateTime()).toDateTime();
+ m_pastDays = settings.value(QStringLiteral("pastDays"), 30).toInt();
+ m_timeRangeNPastDays = settings.value(QStringLiteral("timeRangeNPastDays"), true).toBool();
+ m_maximumNumberOfItems = settings.value(QStringLiteral("maximumNumberOfItems"), m_maximumNumberOfItems).toInt();
emit settingsChanged( nameId() );
}
diff --git a/src/plugins/render/eclipses/EclipsesPlugin.cpp b/src/plugins/render/eclipses/EclipsesPlugin.cpp
index 1ae3970..958e80f 100644
--- a/src/plugins/render/eclipses/EclipsesPlugin.cpp
+++ b/src/plugins/render/eclipses/EclipsesPlugin.cpp
@@ -364,44 +364,44 @@ void EclipsesPlugin::setSettings( const QHash<QString, QVariant> &settings )
void EclipsesPlugin::readSettings()
{
m_configWidget->checkBoxEnableLunarEclipses->setChecked(
- m_settings.value( "enableLunarEclipses", false ).toBool() );
+ m_settings.value(QStringLiteral("enableLunarEclipses"), false).toBool());
m_configWidget->checkBoxShowMaximum->setChecked(
- m_settings.value( "showMaximum", true ).toBool() );
+ m_settings.value(QStringLiteral("showMaximum"), true).toBool());
m_configWidget->checkBoxShowUmbra->setChecked(
- m_settings.value( "showUmbra", true ).toBool() );
+ m_settings.value(QStringLiteral("showUmbra"), true).toBool());
m_configWidget->checkBoxShowSouthernPenumbra->setChecked(
- m_settings.value( "showSouthernPenumbra", true ).toBool() );
+ m_settings.value(QStringLiteral("showSouthernPenumbra"), true).toBool());
m_configWidget->checkBoxShowNorthernPenumbra->setChecked(
- m_settings.value( "showNorthernPenumbra", true ).toBool() );
+ m_settings.value(QStringLiteral("showNorthernPenumbra"), true).toBool());
m_configWidget->checkBoxShowCentralLine->setChecked(
- m_settings.value( "showCentralLine", true ).toBool() );
+ m_settings.value(QStringLiteral("showCentralLine"), true).toBool());
m_configWidget->checkBoxShowFullPenumbra->setChecked(
- m_settings.value( "showFullPenumbra", true ).toBool() );
+ m_settings.value(QStringLiteral("showFullPenumbra"), true).toBool());
m_configWidget->checkBoxShow60MagPenumbra->setChecked(
- m_settings.value( "show60MagPenumbra", false ).toBool() );
+ m_settings.value(QStringLiteral("show60MagPenumbra"), false).toBool());
m_configWidget->checkBoxShowSunBoundaries->setChecked(
- m_settings.value( "showSunBoundaries", true ).toBool() );
+ m_settings.value(QStringLiteral("showSunBoundaries"), true).toBool());
}
void EclipsesPlugin::writeSettings()
{
- m_settings.insert( "enableLunarEclipses",
+ m_settings.insert(QStringLiteral("enableLunarEclipses"),
m_configWidget->checkBoxEnableLunarEclipses->isChecked() );
- m_settings.insert( "showMaximum",
+ m_settings.insert(QStringLiteral("showMaximum"),
m_configWidget->checkBoxShowMaximum->isChecked() );
- m_settings.insert( "showUmbra",
+ m_settings.insert(QStringLiteral("showUmbra"),
m_configWidget->checkBoxShowUmbra->isChecked() );
- m_settings.insert( "showSouthernPenumbra",
+ m_settings.insert(QStringLiteral("showSouthernPenumbra"),
m_configWidget->checkBoxShowSouthernPenumbra->isChecked() );
- m_settings.insert( "showNorthernPenumbra",
+ m_settings.insert(QStringLiteral("showNorthernPenumbra"),
m_configWidget->checkBoxShowNorthernPenumbra->isChecked() );
- m_settings.insert( "showCentralLine",
+ m_settings.insert(QStringLiteral("showCentralLine"),
m_configWidget->checkBoxShowCentralLine->isChecked() );
- m_settings.insert( "showFullPenumbra",
+ m_settings.insert(QStringLiteral("showFullPenumbra"),
m_configWidget->checkBoxShowFullPenumbra->isChecked() );
- m_settings.insert( "show60MagPenumbra",
+ m_settings.insert(QStringLiteral("show60MagPenumbra"),
m_configWidget->checkBoxShow60MagPenumbra->isChecked() );
- m_settings.insert( "showSunBoundaries",
+ m_settings.insert(QStringLiteral("showSunBoundaries"),
m_configWidget->checkBoxShowSunBoundaries->isChecked() );
emit settingsChanged( nameId() );
@@ -414,9 +414,9 @@ void EclipsesPlugin::updateSettings()
}
m_browserDialog->setWithLunarEclipses(
- m_settings.value( "enableLunarEclipses" ).toBool() );
+ m_settings.value(QStringLiteral("enableLunarEclipses")).toBool());
if( m_model->withLunarEclipses() !=
- m_settings.value( "enableLunarEclipses" ).toBool() ) {
+ m_settings.value(QStringLiteral("enableLunarEclipses")).toBool()) {
updateEclipses();
}
}
@@ -425,7 +425,7 @@ void EclipsesPlugin::updateEclipses()
{
// mDebug() << "Updating eclipses....";
const int year = marbleModel()->clock()->dateTime().date().year();
- const bool lun = m_settings.value( "enableLunarEclipses" ).toBool();
+ const bool lun = m_settings.value(QStringLiteral("enableLunarEclipses")).toBool();
if( ( m_menuYear != year ) || ( m_model->withLunarEclipses() != lun ) ) {
diff --git a/src/plugins/render/foursquare/FoursquarePlugin.cpp b/src/plugins/render/foursquare/FoursquarePlugin.cpp
index 6d96853..981691b 100644
--- a/src/plugins/render/foursquare/FoursquarePlugin.cpp
+++ b/src/plugins/render/foursquare/FoursquarePlugin.cpp
@@ -80,8 +80,8 @@ QIcon FoursquarePlugin::icon() const
bool FoursquarePlugin::isAuthenticated()
{
QSettings settings;
-
- return !settings.value( "access_token" ).isNull();
+
+ return !settings.value(QStringLiteral("access_token")).isNull();
}
bool FoursquarePlugin::storeAccessToken(const QString& tokenUrl)
@@ -90,7 +90,7 @@ bool FoursquarePlugin::storeAccessToken(const QString& tokenUrl)
if( tokenUrl.startsWith( expected ) ) {
QSettings settings;
QString url = tokenUrl;
- settings.setValue( "access_token", url.remove( expected ) );
+ settings.setValue(QStringLiteral("access_token"), url.remove(expected));
return true;
} else {
return false;
diff --git a/src/plugins/render/graticule/GraticulePlugin.cpp b/src/plugins/render/graticule/GraticulePlugin.cpp
index 282df83..3131f9c 100644
--- a/src/plugins/render/graticule/GraticulePlugin.cpp
+++ b/src/plugins/render/graticule/GraticulePlugin.cpp
@@ -162,11 +162,11 @@ QHash<QString,QVariant> GraticulePlugin::settings() const
{
QHash<QString, QVariant> settings = RenderPlugin::settings();
- settings.insert( "gridColor", m_gridCirclePen.color().name() );
- settings.insert( "tropicsColor", m_tropicsCirclePen.color().name() );
- settings.insert( "equatorColor", m_equatorCirclePen.color().name() );
- settings.insert( "primarylabels", m_showPrimaryLabels );
- settings.insert( "secondaryLabels", m_showSecondaryLabels );
+ settings.insert(QStringLiteral("gridColor"), m_gridCirclePen.color().name());
+ settings.insert(QStringLiteral("tropicsColor"), m_tropicsCirclePen.color().name());
+ settings.insert(QStringLiteral("equatorColor"), m_equatorCirclePen.color().name());
+ settings.insert(QStringLiteral("primarylabels"), m_showPrimaryLabels);
+ settings.insert(QStringLiteral("secondaryLabels"), m_showSecondaryLabels);
return settings;
}
@@ -175,11 +175,11 @@ void GraticulePlugin::setSettings( const QHash<QString,QVariant> &settings )
{
RenderPlugin::setSettings( settings );
- const QColor gridColor = settings.value( "gridColor", QColor( Qt::white ) ).value<QColor>();
- const QColor tropicsColor = settings.value( "tropicsColor", QColor( Qt::yellow ) ).value<QColor>();
- const QColor equatorColor = settings.value( "equatorColor", QColor( Qt::yellow ) ).value<QColor>();
- bool primaryLabels = settings.value( "primaryLabels", true ).toBool();
- bool secondaryLabels = settings.value( "secondaryLabels", true ).toBool();
+ const QColor gridColor = settings.value(QStringLiteral("gridColor"), QColor(Qt::white)).value<QColor>();
+ const QColor tropicsColor = settings.value(QStringLiteral("tropicsColor"), QColor(Qt::yellow)).value<QColor>();
+ const QColor equatorColor = settings.value(QStringLiteral("equatorColor"), QColor(Qt::yellow)).value<QColor>();
+ bool primaryLabels = settings.value(QStringLiteral("primaryLabels"), true).toBool();
+ bool secondaryLabels = settings.value(QStringLiteral("secondaryLabels"), true).toBool();
m_gridCirclePen.setColor( gridColor );
m_tropicsCirclePen.setColor( tropicsColor );
diff --git a/src/plugins/render/measure/MeasureToolPlugin.cpp b/src/plugins/render/measure/MeasureToolPlugin.cpp
index 06229cd..0912f78 100644
--- a/src/plugins/render/measure/MeasureToolPlugin.cpp
+++ b/src/plugins/render/measure/MeasureToolPlugin.cpp
@@ -168,15 +168,15 @@ QHash<QString,QVariant> MeasureToolPlugin::settings() const
{
QHash<QString, QVariant> settings = RenderPlugin::settings();
- settings.insert( "showDistanceLabel", m_showDistanceLabel );
- settings.insert( "showBearingLabel", m_showBearingLabel );
- settings.insert( "showBearingChangeLabel", m_showBearingChangeLabel );
- settings.insert( "showPolygonArea", m_showPolygonArea );
- settings.insert( "showCircularArea", m_showCircularArea );
- settings.insert( "showRadius", m_showRadius );
- settings.insert( "showPerimeter", m_showPerimeter );
- settings.insert( "showCircumference", m_showCircumference );
- settings.insert( "paintMode", (int)m_paintMode );
+ settings.insert(QStringLiteral("showDistanceLabel"), m_showDistanceLabel);
+ settings.insert(QStringLiteral("showBearingLabel"), m_showBearingLabel);
+ settings.insert(QStringLiteral("showBearingChangeLabel"), m_showBearingChangeLabel);
+ settings.insert(QStringLiteral("showPolygonArea"), m_showPolygonArea);
+ settings.insert(QStringLiteral("showCircularArea"), m_showCircularArea);
+ settings.insert(QStringLiteral("showRadius"), m_showRadius);
+ settings.insert(QStringLiteral("showPerimeter"), m_showPerimeter);
+ settings.insert(QStringLiteral("showCircumference"), m_showCircumference);
+ settings.insert(QStringLiteral("paintMode"), (int)m_paintMode);
return settings;
}
@@ -185,15 +185,15 @@ void MeasureToolPlugin::setSettings( const QHash<QString,QVariant> &settings )
{
RenderPlugin::setSettings( settings );
- m_showDistanceLabel = settings.value( "showDistanceLabel", true ).toBool();
- m_showBearingLabel = settings.value( "showBearingLabel", true ).toBool();
- m_showBearingChangeLabel = settings.value( "showBearingChangeLabel", true ).toBool();
- m_showPolygonArea = settings.value( "showPolygonArea", false ).toBool();
- m_showCircularArea = settings.value( "showCircularArea", true ).toBool();
- m_showRadius = settings.value( "showRadius", true ).toBool();
- m_showPerimeter = settings.value( "showPerimeter", true ).toBool();
- m_showCircumference = settings.value( "showCircumference", true ).toBool();
- m_paintMode = (PaintMode)settings.value( "paintMode", 0 ).toInt();
+ m_showDistanceLabel = settings.value(QStringLiteral("showDistanceLabel"), true).toBool();
+ m_showBearingLabel = settings.value(QStringLiteral("showBearingLabel"), true).toBool();
+ m_showBearingChangeLabel = settings.value(QStringLiteral("showBearingChangeLabel"), true).toBool();
+ m_showPolygonArea = settings.value(QStringLiteral("showPolygonArea"), false).toBool();
+ m_showCircularArea = settings.value(QStringLiteral("showCircularArea"), true).toBool();
+ m_showRadius = settings.value(QStringLiteral("showRadius"), true).toBool();
+ m_showPerimeter = settings.value(QStringLiteral("showPerimeter"), true).toBool();
+ m_showCircumference = settings.value(QStringLiteral("showCircumference"), true).toBool();
+ m_paintMode = (PaintMode)settings.value(QStringLiteral("paintMode"), 0).toInt();
}
void MeasureToolPlugin::writeSettings()
diff --git a/src/plugins/render/navigation/NavigationFloatItem.cpp b/src/plugins/render/navigation/NavigationFloatItem.cpp
index 9ca47f0..a15b19a 100644
--- a/src/plugins/render/navigation/NavigationFloatItem.cpp
+++ b/src/plugins/render/navigation/NavigationFloatItem.cpp
@@ -330,14 +330,14 @@ void NavigationFloatItem::centerOnCurrentLocation()
QHash<QString,QVariant> NavigationFloatItem::settings() const
{
QHash<QString, QVariant> settings = AbstractFloatItem::settings();
- settings.insert( "showHomeButton", m_showHomeButton );
+ settings.insert(QStringLiteral("showHomeButton"), m_showHomeButton);
return settings;
}
void NavigationFloatItem::setSettings( const QHash<QString, QVariant> &settings )
{
AbstractFloatItem::setSettings( settings );
- m_showHomeButton = settings.value( "showHomeButton", true ).toBool();
+ m_showHomeButton = settings.value(QStringLiteral("showHomeButton"), true).toBool();
if ( m_showHomeButton ) {
activateHomeButton();
} else {
diff --git a/src/plugins/render/opendesktop/OpenDesktopPlugin.cpp b/src/plugins/render/opendesktop/OpenDesktopPlugin.cpp
index ed622a6..e24cf94 100644
--- a/src/plugins/render/opendesktop/OpenDesktopPlugin.cpp
+++ b/src/plugins/render/opendesktop/OpenDesktopPlugin.cpp
@@ -107,7 +107,7 @@ QHash<QString,QVariant> OpenDesktopPlugin::settings() const
{
QHash<QString, QVariant> settings = AbstractDataPlugin::settings();
- settings.insert( "itemsOnScreen", numberOfItems() );
+ settings.insert(QStringLiteral("itemsOnScreen"), numberOfItems());
return settings;
}
@@ -130,7 +130,7 @@ void OpenDesktopPlugin::setSettings( const QHash<QString,QVariant> &settings )
{
AbstractDataPlugin::setSettings( settings );
- setNumberOfItems( settings.value( "itemsOnScreen", defaultItemsOnScreen ).toInt() );
+ setNumberOfItems(settings.value(QStringLiteral("itemsOnScreen"), defaultItemsOnScreen).toInt());
emit settingsChanged( nameId() );
}
diff --git a/src/plugins/render/overviewmap/OverviewMap.cpp b/src/plugins/render/overviewmap/OverviewMap.cpp
index 003998d..efb52f4 100644
--- a/src/plugins/render/overviewmap/OverviewMap.cpp
+++ b/src/plugins/render/overviewmap/OverviewMap.cpp
@@ -315,8 +315,8 @@ void OverviewMap::setSettings( const QHash<QString,QVariant> &settings )
{
AbstractFloatItem::setSettings( settings );
- m_settings.insert( "width", settings.value( "width", m_defaultSize.toSize().width() ) );
- m_settings.insert( "height", settings.value( "height", m_defaultSize.toSize().height() ) );
+ m_settings.insert(QStringLiteral("width"), settings.value(QStringLiteral("width"), m_defaultSize.toSize().width()));
+ m_settings.insert(QStringLiteral("height"), settings.value(QStringLiteral("height"), m_defaultSize.toSize().height()));
foreach ( const QString& planet, PlanetFactory::planetList() ) {
QString mapFile = MarbleDirs::path(QLatin1String("svg/") + planet + QLatin1String("map.svg"));
@@ -332,7 +332,7 @@ void OverviewMap::setSettings( const QHash<QString,QVariant> &settings )
m_settings.insert(id, settings.value(id, mapFile));
}
- m_settings.insert( "posColor", settings.value( "posColor", QColor( Qt::white ).name() ) );
+ m_settings.insert(QStringLiteral("posColor"), settings.value(QStringLiteral("posColor"), QColor(Qt::white).name()));
m_target.clear(); // FIXME: forces execution of changeBackground() in changeViewport()
@@ -346,10 +346,10 @@ void OverviewMap::readSettings()
return;
}
- ui_configWidget->m_widthBox->setValue( m_settings.value( "width" ).toInt() );
- ui_configWidget->m_heightBox->setValue( m_settings.value( "height" ).toInt() );
+ ui_configWidget->m_widthBox->setValue( m_settings.value(QStringLiteral("width")).toInt() );
+ ui_configWidget->m_heightBox->setValue( m_settings.value(QStringLiteral("height")).toInt() );
QPalette palette = ui_configWidget->m_colorChooserButton->palette();
- palette.setColor( QPalette::Button, QColor( m_settings.value( "posColor" ).toString() ) );
+ palette.setColor(QPalette::Button, QColor(m_settings.value(QStringLiteral("posColor")).toString()));
ui_configWidget->m_colorChooserButton->setPalette( palette );
}
@@ -359,15 +359,15 @@ void OverviewMap::writeSettings()
return;
}
- m_settings.insert( "width", contentRect().width() );
- m_settings.insert( "height", contentRect().height() );
+ m_settings.insert(QStringLiteral("width"), contentRect().width());
+ m_settings.insert(QStringLiteral("height"), contentRect().height());
QStringList const planets = PlanetFactory::planetList();
foreach( const QString &planet, planets ) {
m_settings.insert(QLatin1String("path_") + planet, m_svgPaths[planet]);
}
- m_settings.insert( "posColor", m_posColor.name() );
+ m_settings.insert(QStringLiteral("posColor"), m_posColor.name());
emit settingsChanged( nameId() );
}
@@ -379,7 +379,7 @@ void OverviewMap::updateSettings()
m_svgPaths.insert(planet, m_settings.value(QLatin1String("path_") + planet, QString()).toString());
}
- m_posColor = QColor( m_settings.value( "posColor" ).toString() );
+ m_posColor = QColor(m_settings.value(QStringLiteral("posColor")).toString());
loadPlanetMaps();
if ( !m_configDialog ) {
diff --git a/src/plugins/render/photo/PhotoPlugin.cpp b/src/plugins/render/photo/PhotoPlugin.cpp
index edc2e41..8fc70a4 100644
--- a/src/plugins/render/photo/PhotoPlugin.cpp
+++ b/src/plugins/render/photo/PhotoPlugin.cpp
@@ -186,8 +186,8 @@ QHash<QString,QVariant> PhotoPlugin::settings() const
{
QHash<QString, QVariant> settings = AbstractDataPlugin::settings();
- settings.insert( "numberOfItems", numberOfItems() );
- settings.insert( "checkState", m_checkStateList.join(",") );
+ settings.insert(QStringLiteral("numberOfItems"), numberOfItems());
+ settings.insert(QStringLiteral("checkState"), m_checkStateList.join(QLatin1Char(',')));
return settings;
}
@@ -196,8 +196,8 @@ void PhotoPlugin::setSettings( const QHash<QString,QVariant> &settings )
{
AbstractDataPlugin::setSettings( settings );
- setNumberOfItems( qMin<int>( maximumNumberOfItems, settings.value( "numberOfItems", 15 ).toInt() ) );
- m_checkStateList = settings.value( "checkState", "1,2,3,4,5,6,7" ).toString().split(QLatin1Char(','), QString::SkipEmptyParts );
+ setNumberOfItems(qMin<int>(maximumNumberOfItems, settings.value(QStringLiteral("numberOfItems"), 15).toInt()));
+ m_checkStateList = settings.value(QStringLiteral("checkState"), QStringLiteral("1,2,3,4,5,6,7")).toString().split(QLatin1Char(','), QString::SkipEmptyParts);
updateSettings();
readSettings();
diff --git a/src/plugins/render/positionmarker/PositionMarker.cpp b/src/plugins/render/positionmarker/PositionMarker.cpp
index 77b5c7d..d1012aa 100644
--- a/src/plugins/render/positionmarker/PositionMarker.cpp
+++ b/src/plugins/render/positionmarker/PositionMarker.cpp
@@ -289,12 +289,12 @@ QHash<QString,QVariant> PositionMarker::settings() const
{
QHash<QString, QVariant> settings = RenderPlugin::settings();
- settings.insert( "useCustomCursor", m_useCustomCursor );
- settings.insert( "cursorPath", m_cursorPath );
- settings.insert( "cursorSize", m_cursorSize );
- settings.insert( "acColor", m_accuracyColor );
- settings.insert( "trailColor", m_trailColor );
- settings.insert( "showTrail", m_showTrail );
+ settings.insert(QStringLiteral("useCustomCursor"), m_useCustomCursor);
+ settings.insert(QStringLiteral("cursorPath"), m_cursorPath);
+ settings.insert(QStringLiteral("cursorSize"), m_cursorSize);
+ settings.insert(QStringLiteral("acColor"), m_accuracyColor);
+ settings.insert(QStringLiteral("trailColor"), m_trailColor);
+ settings.insert(QStringLiteral("showTrail"), m_showTrail);
return settings;
}
@@ -307,14 +307,14 @@ void PositionMarker::setSettings( const QHash<QString, QVariant> &settings )
QColor defaultColor = Oxygen::brickRed4;
defaultColor.setAlpha( smallScreen ? 80 : 40 );
- m_useCustomCursor = settings.value( "useCustomCursor", false ).toBool();
- m_cursorPath = settings.value( "cursorPath", m_defaultCursorPath ).toString();
- m_cursorSize = settings.value( "cursorSize", 1.0 ).toFloat();
+ m_useCustomCursor = settings.value(QStringLiteral("useCustomCursor"), false).toBool();
+ m_cursorPath = settings.value(QStringLiteral("cursorPath"), m_defaultCursorPath).toString();
+ m_cursorSize = settings.value(QStringLiteral("cursorSize"), 1.0).toFloat();
loadCustomCursor( m_cursorPath, m_useCustomCursor );
- m_accuracyColor = settings.value( "acColor", defaultColor ).value<QColor>();
- m_trailColor = settings.value( "trailColor", QColor( 0, 0, 255 ) ).value<QColor>();
- m_showTrail = settings.value( "showTrail", false ).toBool();
+ m_accuracyColor = settings.value(QStringLiteral("acColor"), defaultColor).value<QColor>();
+ m_trailColor = settings.value(QStringLiteral("trailColor"), QColor(0, 0, 255)).value<QColor>();
+ m_showTrail = settings.value(QStringLiteral("showTrail"), false).toBool();
readSettings();
}
diff --git a/src/plugins/render/routing/RoutingPlugin.cpp b/src/plugins/render/routing/RoutingPlugin.cpp
index 526feac..c7f74c4 100644
--- a/src/plugins/render/routing/RoutingPlugin.cpp
+++ b/src/plugins/render/routing/RoutingPlugin.cpp
@@ -550,9 +550,9 @@ QHash<QString,QVariant> RoutingPlugin::settings() const
{
QHash<QString, QVariant> result = AbstractFloatItem::settings();
- result.insert( "muted", d->m_audio->isMuted() );
- result.insert( "sound", d->m_audio->isSoundEnabled() );
- result.insert( "speaker", d->m_audio->speaker() );
+ result.insert(QStringLiteral("muted"), d->m_audio->isMuted());
+ result.insert(QStringLiteral("sound"), d->m_audio->isSoundEnabled());
+ result.insert(QStringLiteral("speaker"), d->m_audio->speaker());
return result;
}
@@ -561,9 +561,9 @@ void RoutingPlugin::setSettings( const QHash<QString,QVariant> &settings )
{
AbstractFloatItem::setSettings( settings );
- d->m_audio->setMuted( settings.value( "muted", false ).toBool() );
- d->m_audio->setSoundEnabled( settings.value( "sound", true ).toBool() );
- d->m_audio->setSpeaker( settings.value( "speaker" ).toString() );
+ d->m_audio->setMuted(settings.value(QStringLiteral("muted"), false).toBool());
+ d->m_audio->setSoundEnabled(settings.value(QStringLiteral("sound"), true).toBool());
+ d->m_audio->setSpeaker(settings.value(QStringLiteral("speaker")).toString());
d->readSettings();
}
diff --git a/src/plugins/render/satellites/SatellitesConfigLeafItem.cpp b/src/plugins/render/satellites/SatellitesConfigLeafItem.cpp
index 1a5241e..1fd7680 100644
--- a/src/plugins/render/satellites/SatellitesConfigLeafItem.cpp
+++ b/src/plugins/render/satellites/SatellitesConfigLeafItem.cpp
@@ -29,7 +29,7 @@ SatellitesConfigLeafItem::~SatellitesConfigLeafItem()
void SatellitesConfigLeafItem::loadSettings(const QHash<QString, QVariant> &settings)
{
- QStringList idList = settings.value( "idList" ).toStringList();
+ const QStringList idList = settings.value(QStringLiteral("idList")).toStringList();
m_isChecked = idList.contains( m_id );
}
diff --git a/src/plugins/render/satellites/SatellitesModel.cpp b/src/plugins/render/satellites/SatellitesModel.cpp
index 38503db..4b63fa5 100644
--- a/src/plugins/render/satellites/SatellitesModel.cpp
+++ b/src/plugins/render/satellites/SatellitesModel.cpp
@@ -69,7 +69,7 @@ QColor SatellitesModel::nextColor()
void SatellitesModel::loadSettings( const QHash<QString, QVariant> &settings )
{
- QStringList idList = settings["idList"].toStringList();
+ QStringList idList = settings[QStringLiteral("idList")].toStringList();
m_enabledIds = idList;
updateVisibility();
diff --git a/src/plugins/render/satellites/SatellitesPlugin.cpp b/src/plugins/render/satellites/SatellitesPlugin.cpp
index 3b248ab..d9ad3fe 100644
--- a/src/plugins/render/satellites/SatellitesPlugin.cpp
+++ b/src/plugins/render/satellites/SatellitesPlugin.cpp
@@ -279,11 +279,11 @@ void SatellitesPlugin::setSettings( const QHash<QString, QVariant> &settings )
// TODO: cancel also all on-going downloads
// add default data sources
- if( !settings.contains( "dataSources" ) ) {
+ if (!settings.contains(QStringLiteral("dataSources"))) {
QStringList dsList;
- dsList << "http://www.celestrak.com/NORAD/elements/visual.txt";
- m_settings.insert( "dataSources", dsList );
- m_settings.insert( "idList", dsList );
+ dsList << QStringLiteral("http://www.celestrak.com/NORAD/elements/visual.txt");
+ m_settings.insert(QStringLiteral("dataSources"), dsList);
+ m_settings.insert(QStringLiteral("idList"), dsList);
}
else {
// HACK: KConfig can't guess the type of the settings, when we use
@@ -292,27 +292,27 @@ void SatellitesPlugin::setSettings( const QHash<QString, QVariant> &settings )
// QVariant can handle the conversion for some types, like toDateTime()
// but when calling toStringList() on a QVariant::String, it will
// return a one element list
- if( settings.value( "dataSources" ).type() == QVariant::String ) {
- m_settings.insert( "dataSources",
- settings.value( "dataSources" ).toString().split(QLatin1Char( ',' ) ) );
+ if (settings.value(QStringLiteral("dataSources")).type() == QVariant::String) {
+ m_settings.insert(QStringLiteral("dataSources"),
+ settings.value(QStringLiteral("dataSources")).toString().split(QLatin1Char(',')));
}
- if( settings.value( "idList" ).type() == QVariant::String ) {
- m_settings.insert( "idList",
- settings.value( "idList" ).toString().split(QLatin1Char( ',' ) ) );
+ if (settings.value(QStringLiteral("idList")).type() == QVariant::String) {
+ m_settings.insert(QStringLiteral("idList"),
+ settings.value(QStringLiteral("idList")).toString().split(QLatin1Char(',')));
}
}
// add default user data source
- if( !settings.contains( "userDataSources" ) ) {
+ if (!settings.contains(QStringLiteral("userDataSources"))) {
QStringList udsList;
- udsList << "http://files.kde.org/marble/satellites/PlanetarySatellites.msc";
- m_settings.insert( "userDataSources", udsList );
+ udsList << QStringLiteral("http://files.kde.org/marble/satellites/PlanetarySatellites.msc");
+ m_settings.insert(QStringLiteral("userDataSources"), udsList);
userDataSourceAdded( udsList[0] );
}
- else if( settings.value( "userDataSources" ).type() == QVariant::String ) {
+ else if (settings.value(QStringLiteral("userDataSources")).type() == QVariant::String) {
// same HACK as above
- m_settings.insert( "userDataSources",
- settings.value( "userDataSources" ).toString().split(QLatin1Char( ',' ) ) );
+ m_settings.insert(QStringLiteral("userDataSources"),
+ settings.value(QStringLiteral("userDataSources")).toString().split(QLatin1Char(',')));
}
emit settingsChanged( nameId() );
@@ -321,16 +321,16 @@ void SatellitesPlugin::setSettings( const QHash<QString, QVariant> &settings )
void SatellitesPlugin::readSettings()
{
m_configDialog->setUserDataSources(
- m_settings.value( "userDataSources" ).toStringList() );
+ m_settings.value(QStringLiteral("userDataSources")).toStringList());
m_configModel->loadSettings( m_settings );
m_satModel->loadSettings( m_settings );
}
void SatellitesPlugin::writeSettings()
{
- m_settings.insert( "userDataSources", m_configDialog->userDataSources() );
- m_settings.insert( "dataSources", m_configModel->urlList() );
- m_settings.insert( "idList", m_configModel->idList() );
+ m_settings.insert(QStringLiteral("userDataSources"), m_configDialog->userDataSources());
+ m_settings.insert(QStringLiteral("dataSources"), m_configModel->urlList());
+ m_settings.insert(QStringLiteral("idList"), m_configModel->idList());
emit settingsChanged( nameId() );
}
@@ -348,8 +348,8 @@ void SatellitesPlugin::updateSettings()
addBuiltInDataSources();
// (re)load data sources
- QStringList dsList = m_settings["dataSources"].toStringList();
- dsList << m_settings["userDataSources"].toStringList();
+ QStringList dsList = m_settings[QStringLiteral("dataSources")].toStringList();
+ dsList << m_settings[QStringLiteral("userDataSources")].toStringList();
dsList.removeDuplicates();
foreach( const QString &ds, dsList ) {
mDebug() << "Loading satellite data from:" << ds;
@@ -434,9 +434,9 @@ void SatellitesPlugin::activateDataSource( const QString &source )
// activate the given data source (select it)
mDebug() << "Activating Data Source:" << source;
QStringList list = m_configModel->fullIdList().filter( source );
- QStringList idList = m_settings["idList"].toStringList();
+ QStringList idList = m_settings[QStringLiteral("idList")].toStringList();
idList << list;
- m_settings.insert( "idList", idList );
+ m_settings.insert(QStringLiteral("idList"), idList);
}
void SatellitesPlugin::addBuiltInDataSources()
diff --git a/src/plugins/render/stars/StarsPlugin.cpp b/src/plugins/render/stars/StarsPlugin.cpp
index c9bc5a4..b873448 100644
--- a/src/plugins/render/stars/StarsPlugin.cpp
+++ b/src/plugins/render/stars/StarsPlugin.cpp
@@ -193,32 +193,32 @@ QHash<QString, QVariant> StarsPlugin::settings() const
{
QHash<QString, QVariant> settings = RenderPlugin::settings();
- settings["nameIndex"] = m_nameIndex;
- settings["renderStars"] = m_renderStars;
- settings["renderConstellationLines"] = m_renderConstellationLines;
- settings["renderConstellationLabels"] = m_renderConstellationLabels;
- settings["renderDsos"] = m_renderDsos;
- settings["renderDsoLabels"] = m_renderDsoLabels;
- settings["renderSun"] = m_renderSun;
- settings["renderMoon"] = m_renderMoon;
+ settings.insert(QStringLiteral("nameIndex"), m_nameIndex);
+ settings.insert(QStringLiteral("renderStars"), m_renderStars);
+ settings.insert(QStringLiteral("renderConstellationLines"), m_renderConstellationLines);
+ settings.insert(QStringLiteral("renderConstellationLabels"), m_renderConstellationLabels);
+ settings.insert(QStringLiteral("renderDsos"), m_renderDsos);
+ settings.insert(QStringLiteral("renderDsoLabels"), m_renderDsoLabels);
+ settings.insert(QStringLiteral("renderSun"), m_renderSun);
+ settings.insert(QStringLiteral("renderMoon"), m_renderMoon);
QStringList planetState;
foreach (const QString &key, m_renderPlanet.keys())
planetState += key + QLatin1Char(':') + QString::number((int)m_renderPlanet[key]);
- settings["renderPlanet"] = planetState.join(QLatin1Char('|'));
-
- settings["renderEcliptic"] = m_renderEcliptic;
- settings["renderCelestialEquator"] = m_renderCelestialEquator;
- settings["renderCelestialPole"] = m_renderCelestialPole;
- settings["zoomSunMoon"] = m_zoomSunMoon;
- settings["viewSolarSystemLabel"] = m_viewSolarSystemLabel;
- settings["magnitudeLimit"] = m_magnitudeLimit;
- settings["constellationBrush"] = m_constellationBrush.color().rgb();
- settings["constellationLabelBrush"] = m_constellationLabelBrush.color().rgb();
- settings["dsoLabelBrush"] = m_dsoLabelBrush.color().rgb();
- settings["eclipticBrush"] = m_eclipticBrush.color().rgb();
- settings["celestialEaquatorBrush"] = m_celestialEquatorBrush.color().rgb();
- settings["celestialPoleBrush"] = m_celestialPoleBrush.color().rgb();
+ settings.insert(QStringLiteral("renderPlanet"), planetState.join(QLatin1Char('|')));
+
+ settings.insert(QStringLiteral("renderEcliptic"), m_renderEcliptic);
+ settings.insert(QStringLiteral("renderCelestialEquator"), m_renderCelestialEquator);
+ settings.insert(QStringLiteral("renderCelestialPole"), m_renderCelestialPole);
+ settings.insert(QStringLiteral("zoomSunMoon"), m_zoomSunMoon);
+ settings.insert(QStringLiteral("viewSolarSystemLabel"), m_viewSolarSystemLabel);
+ settings.insert(QStringLiteral("magnitudeLimit"), m_magnitudeLimit);
+ settings.insert(QStringLiteral("constellationBrush"), m_constellationBrush.color().rgb());
+ settings.insert(QStringLiteral("constellationLabelBrush"), m_constellationLabelBrush.color().rgb());
+ settings.insert(QStringLiteral("dsoLabelBrush"), m_dsoLabelBrush.color().rgb());
+ settings.insert(QStringLiteral("eclipticBrush"), m_eclipticBrush.color().rgb());
+ settings.insert(QStringLiteral("celestialEaquatorBrush"), m_celestialEquatorBrush.color().rgb());
+ settings.insert(QStringLiteral("celestialPoleBrush"), m_celestialPoleBrush.color().rgb());
return settings;
}
@@ -227,17 +227,17 @@ void StarsPlugin::setSettings( const QHash<QString, QVariant> &settings )
{
RenderPlugin::setSettings( settings );
- m_nameIndex = readSetting<int>( settings, "nameIndex", 0 );
- m_renderStars = readSetting<bool>( settings, "renderStars", true );
- m_renderConstellationLines = readSetting<bool>( settings, "renderConstellationLines", true );
- m_renderConstellationLabels = readSetting<bool>( settings, "renderConstellationLabels", true );
- m_renderDsos = readSetting<bool>( settings, "renderDsos", true );
- m_renderDsoLabels = readSetting<bool>( settings, "renderDsoLabels", true);
- m_renderSun = readSetting<bool>( settings, "renderSun", true );
- m_renderMoon = readSetting<bool>( settings, "renderMoon", true );
+ m_nameIndex = readSetting<int>(settings, QStringLiteral("nameIndex"), 0);
+ m_renderStars = readSetting<bool>(settings, QStringLiteral("renderStars"), true);
+ m_renderConstellationLines = readSetting<bool>(settings, QStringLiteral("renderConstellationLines"), true);
+ m_renderConstellationLabels = readSetting<bool>(settings, QStringLiteral("renderConstellationLabels"), true);
+ m_renderDsos = readSetting<bool>(settings, QStringLiteral("renderDsos"), true);
+ m_renderDsoLabels = readSetting<bool>(settings, QStringLiteral("renderDsoLabels"), true);
+ m_renderSun = readSetting<bool>(settings, QStringLiteral("renderSun"), true);
+ m_renderMoon = readSetting<bool>(settings, QStringLiteral("renderMoon"), true);
m_renderPlanet.clear();
- const QString renderPlanet = readSetting<QString>( settings, "renderPlanet", "" );
+ const QString renderPlanet = readSetting<QString>(settings, QStringLiteral("renderPlanet"), QString());
const QStringList renderStates = renderPlanet.split(QLatin1Char('|'));
foreach(const QString &state, renderStates) {
const QStringList stateList = state.split(QLatin1Char(':'));
@@ -245,19 +245,19 @@ void StarsPlugin::setSettings( const QHash<QString, QVariant> &settings )
m_renderPlanet[stateList[0]] = (bool)stateList[1].toInt();
}
- m_renderEcliptic = readSetting<bool>( settings, "renderEcliptic", true );
- m_renderCelestialEquator = readSetting<bool>( settings, "renderCelestialEquator", true );
- m_renderCelestialPole = readSetting<bool>( settings, "renderCelestialPole", true );
- m_zoomSunMoon = readSetting<bool>( settings, "zoomSunMoon", true );
- m_viewSolarSystemLabel = readSetting<bool>( settings, "viewSolarSystemLabel", true );
- m_magnitudeLimit = readSetting<int>( settings, "magnitudeLimit", 100 );
+ m_renderEcliptic = readSetting<bool>(settings, QStringLiteral("renderEcliptic"), true);
+ m_renderCelestialEquator = readSetting<bool>(settings, QStringLiteral("renderCelestialEquator"), true);
+ m_renderCelestialPole = readSetting<bool>(settings, QStringLiteral("renderCelestialPole"), true);
+ m_zoomSunMoon = readSetting<bool>(settings, QStringLiteral("zoomSunMoon"), true);
+ m_viewSolarSystemLabel = readSetting<bool>(settings, QStringLiteral("viewSolarSystemLabel"), true);
+ m_magnitudeLimit = readSetting<int>(settings, QStringLiteral("magnitudeLimit"), 100);
QColor const defaultColor = Marble::Oxygen::aluminumGray5;
- m_constellationBrush = QColor( readSetting<QRgb>( settings, "constellationBrush", defaultColor.rgb() ) );
- m_constellationLabelBrush = QColor( readSetting<QRgb>( settings, "constellationLabelBrush", defaultColor.rgb()) );
- m_dsoLabelBrush = QColor( readSetting<QRgb>( settings, "dsoLabelBrush", defaultColor.rgb() ) );
- m_eclipticBrush = QColor( readSetting<QRgb>( settings, "eclipticBrush", defaultColor.rgb() ) );
- m_celestialEquatorBrush = QColor( readSetting<QRgb>( settings, "celestialEquatorBrush", defaultColor.rgb() ) );
- m_celestialPoleBrush = QColor( readSetting<QRgb>( settings, "celestialPoleBrush", defaultColor.rgb() ) );
+ m_constellationBrush = QColor(readSetting<QRgb>(settings, QStringLiteral("constellationBrush"), defaultColor.rgb()));
+ m_constellationLabelBrush = QColor(readSetting<QRgb>(settings, QStringLiteral("constellationLabelBrush"), defaultColor.rgb()));
+ m_dsoLabelBrush = QColor(readSetting<QRgb>(settings, QStringLiteral("dsoLabelBrush"), defaultColor.rgb()));
+ m_eclipticBrush = QColor(readSetting<QRgb>(settings, QStringLiteral("eclipticBrush"), defaultColor.rgb()));
+ m_celestialEquatorBrush = QColor(readSetting<QRgb>(settings, QStringLiteral("celestialEquatorBrush"), defaultColor.rgb()));
+ m_celestialPoleBrush = QColor(readSetting<QRgb>(settings, QStringLiteral("celestialPoleBrush"), defaultColor.rgb()));
}
QPixmap StarsPlugin::starPixmap(qreal mag, int colorId) const
diff --git a/src/plugins/render/weather/WeatherItem.cpp b/src/plugins/render/weather/WeatherItem.cpp
index d8e3e72..9c8dbf2 100644
--- a/src/plugins/render/weather/WeatherItem.cpp
+++ b/src/plugins/render/weather/WeatherItem.cpp
@@ -212,7 +212,7 @@ class WeatherItemPrivate
void updateFavorite()
{
- QStringList items = m_settings.value( "favoriteItems" ).toString()
+ QStringList items = m_settings.value(QStringLiteral("favoriteItems")).toString()
.split(QLatin1Char(','), QString::SkipEmptyParts);
bool favorite = items.contains( m_parent->id() );
@@ -230,25 +230,25 @@ class WeatherItemPrivate
bool isConditionShown() const
{
return m_currentWeather.hasValidCondition()
- && m_settings.value( "showCondition", showConditionDefault ).toBool();
+ && m_settings.value(QStringLiteral("showCondition"), showConditionDefault).toBool();
}
bool isTemperatureShown() const
{
return m_currentWeather.hasValidTemperature()
- && m_settings.value( "showTemperature", showTemperatureDefault ).toBool();
+ && m_settings.value(QStringLiteral("showTemperature"), showTemperatureDefault).toBool();
}
bool isWindDirectionShown() const
{
return m_currentWeather.hasValidWindDirection()
- && m_settings.value( "showWindDirection", showWindDirectionDefault ).toBool();
+ && m_settings.value(QStringLiteral("showWindDirection"), showWindDirectionDefault).toBool();
}
bool isWindSpeedShown() const
{
return m_currentWeather.hasValidWindSpeed()
- && m_settings.value( "showWindSpeed", showWindSpeedDefault ).toBool();
+ && m_settings.value(QStringLiteral("showWindSpeed"), showWindSpeedDefault).toBool();
}
QString temperatureString() const
@@ -260,7 +260,7 @@ class WeatherItemPrivate
WeatherData::TemperatureUnit temperatureUnit() const
{
WeatherData::TemperatureUnit tUnit
- = (WeatherData::TemperatureUnit) m_settings.value( "temperatureUnit",
+ = (WeatherData::TemperatureUnit) m_settings.value(QStringLiteral("temperatureUnit"),
WeatherData::Celsius ).toInt();
return tUnit;
}
@@ -272,7 +272,7 @@ class WeatherItemPrivate
WeatherData::SpeedUnit speedUnit() const
{
- return (WeatherData::SpeedUnit) m_settings.value( "windSpeedUnit",
+ return (WeatherData::SpeedUnit) m_settings.value(QStringLiteral("windSpeedUnit"),
WeatherData::kph ).toInt();
}
@@ -283,7 +283,7 @@ class WeatherItemPrivate
WeatherData::PressureUnit pressureUnit() const
{
- return (WeatherData::PressureUnit) m_settings.value( "pressureUnit",
+ return (WeatherData::PressureUnit) m_settings.value(QStringLiteral("pressureUnit"),
WeatherData::HectoPascal ).toInt();
}
diff --git a/src/plugins/render/weather/WeatherPlugin.cpp b/src/plugins/render/weather/WeatherPlugin.cpp
index c722bac..357cd40 100644
--- a/src/plugins/render/weather/WeatherPlugin.cpp
+++ b/src/plugins/render/weather/WeatherPlugin.cpp
@@ -157,10 +157,10 @@ void WeatherPlugin::setSettings( const QHash<QString,QVariant> &settings )
{
AbstractDataPlugin::setSettings( settings );
- m_settings.insert( "showCondition", settings.value( "showCondigion", showConditionDefault ) );
- m_settings.insert( "showTemperature", settings.value( "showTemperature", showTemperatureDefault ) );
- m_settings.insert( "showWindDirection", settings.value( "showWindDirection", showWindDirectionDefault ) );
- m_settings.insert( "showWindSpeed", settings.value( "showWindSpeed", showWindSpeedDefault ) );
+ m_settings.insert(QStringLiteral("showCondition"), settings.value(QStringLiteral("showCondition"), showConditionDefault));
+ m_settings.insert(QStringLiteral("showTemperature"), settings.value(QStringLiteral("showTemperature"), showTemperatureDefault));
+ m_settings.insert(QStringLiteral("showWindDirection"), settings.value(QStringLiteral("showWindDirection"), showWindDirectionDefault));
+ m_settings.insert(QStringLiteral("showWindSpeed"), settings.value(QStringLiteral("showWindSpeed"), showWindSpeedDefault));
// Units
// The default units depend on the global measure system.
@@ -173,7 +173,7 @@ void WeatherPlugin::setSettings( const QHash<QString,QVariant> &settings )
else {
temperatureUnit = WeatherData::Fahrenheit;
}
- m_settings.insert( "temperatureUnit", settings.value( "temperatureUnit", temperatureUnit ) );
+ m_settings.insert(QStringLiteral("temperatureUnit"), settings.value(QStringLiteral("temperatureUnit"), temperatureUnit));
int windSpeedUnit;
if ( locale->measurementSystem() == MarbleLocale::MetricSystem ) {
@@ -182,7 +182,7 @@ void WeatherPlugin::setSettings( const QHash<QString,QVariant> &settings )
else {
windSpeedUnit = WeatherData::mph;
}
- m_settings.insert( "windSpeedUnit", settings.value( "windSpeedUnit", windSpeedUnit ) );
+ m_settings.insert(QStringLiteral("windSpeedUnit"), settings.value(QStringLiteral("windSpeedUnit"), windSpeedUnit));
int pressureUnit;
if ( locale->measurementSystem() == MarbleLocale::MetricSystem ) {
@@ -191,7 +191,7 @@ void WeatherPlugin::setSettings( const QHash<QString,QVariant> &settings )
else {
pressureUnit = WeatherData::inchHg;
}
- m_settings.insert( "pressureUnit", settings.value( "pressureUnit", pressureUnit ) );
+ m_settings.insert(QStringLiteral("pressureUnit"), settings.value(QStringLiteral("pressureUnit"), pressureUnit));
readSettings();
@@ -220,69 +220,69 @@ void WeatherPlugin::readSettings()
}
// Information
- if ( m_settings.value( "showCondition" ).toBool() )
+ if (m_settings.value(QStringLiteral("showCondition")).toBool())
ui_configWidget->m_weatherConditionBox->setCheckState( Qt::Checked );
else
ui_configWidget->m_weatherConditionBox->setCheckState( Qt::Unchecked );
- if ( m_settings.value( "showTemperature" ).toBool() )
+ if (m_settings.value(QStringLiteral("showTemperature")).toBool())
ui_configWidget->m_temperatureBox->setCheckState( Qt::Checked );
else
ui_configWidget->m_temperatureBox->setCheckState( Qt::Unchecked );
- if ( m_settings.value( "showWindDirection" ).toBool() )
+ if (m_settings.value(QStringLiteral("showWindDirection")).toBool())
ui_configWidget->m_windDirectionBox->setCheckState( Qt::Checked );
else
ui_configWidget->m_windDirectionBox->setCheckState( Qt::Unchecked );
- if ( m_settings.value( "showWindSpeed" ).toBool() )
+ if (m_settings.value(QStringLiteral("showWindSpeed")).toBool())
ui_configWidget->m_windSpeedBox->setCheckState( Qt::Checked );
else
ui_configWidget->m_windSpeedBox->setCheckState( Qt::Unchecked );
- if ( m_settings.value( "onlyFavorites" ).toBool() )
+ if (m_settings.value(QStringLiteral("onlyFavorites")).toBool())
ui_configWidget->m_onlyFavoritesBox->setCheckState( Qt::Checked );
else
ui_configWidget->m_onlyFavoritesBox->setCheckState( Qt::Unchecked );
// Units
ui_configWidget->m_temperatureComboBox
- ->setCurrentIndex( m_settings.value( "temperatureUnit" ).toInt() );
+ ->setCurrentIndex(m_settings.value(QStringLiteral("temperatureUnit")).toInt());
ui_configWidget->m_windSpeedComboBox
- ->setCurrentIndex( m_settings.value( "windSpeedUnit" ).toInt() );
+ ->setCurrentIndex(m_settings.value(QStringLiteral("windSpeedUnit")).toInt());
ui_configWidget->m_pressureComboBox
- ->setCurrentIndex( m_settings.value( "pressureUnit" ).toInt() );
+ ->setCurrentIndex(m_settings.value(QStringLiteral("pressureUnit")).toInt());
// Misc
ui_configWidget->m_updateIntervalBox
- ->setValue( m_settings.value( "updateInterval", 3 ).toInt() );
+ ->setValue(m_settings.value(QStringLiteral("updateInterval"), 3).toInt());
}
void WeatherPlugin::writeSettings()
{
// Information
- m_settings.insert( "showCondition",
+ m_settings.insert(QStringLiteral("showCondition"),
ui_configWidget->m_weatherConditionBox->checkState() == Qt::Checked );
- m_settings.insert( "showTemperature",
+ m_settings.insert(QStringLiteral("showTemperature"),
ui_configWidget->m_temperatureBox->checkState() == Qt::Checked );
- m_settings.insert( "showWindDirection",
+ m_settings.insert(QStringLiteral("showWindDirection"),
ui_configWidget->m_windDirectionBox->checkState() == Qt::Checked );
- m_settings.insert( "showWindSpeed",
+ m_settings.insert(QStringLiteral("showWindSpeed"),
ui_configWidget->m_windSpeedBox->checkState() == Qt::Checked );
// Units
- m_settings.insert( "temperatureUnit", ui_configWidget->m_temperatureComboBox->currentIndex() );
- m_settings.insert( "windSpeedUnit", ui_configWidget->m_windSpeedComboBox->currentIndex() );
- m_settings.insert( "pressureUnit", ui_configWidget->m_pressureComboBox->currentIndex() );
+ m_settings.insert(QStringLiteral("temperatureUnit"), ui_configWidget->m_temperatureComboBox->currentIndex());
+ m_settings.insert(QStringLiteral("windSpeedUnit"), ui_configWidget->m_windSpeedComboBox->currentIndex());
+ m_settings.insert(QStringLiteral("pressureUnit"), ui_configWidget->m_pressureComboBox->currentIndex());
// Misc
bool onlyFavorites = ( ui_configWidget->m_onlyFavoritesBox->checkState() == Qt::Checked );
- m_settings.insert( "onlyFavorites", onlyFavorites );
+ m_settings.insert(QStringLiteral("onlyFavorites"), onlyFavorites);
m_updateInterval = ui_configWidget->m_updateIntervalBox->value();
- m_settings.insert( "updateInterval", m_updateInterval );
+ m_settings.insert(QStringLiteral("updateInterval"), m_updateInterval);
emit settingsChanged( nameId() );
updateSettings();
@@ -291,8 +291,8 @@ void WeatherPlugin::writeSettings()
void WeatherPlugin::updateSettings()
{
if ( model() ) {
- bool favoritesOnly = m_settings.value( "onlyFavorites", false ).toBool();
- QList<QString> favoriteItems = m_settings.value( "favoriteItems" ).toString()
+ bool favoritesOnly = m_settings.value(QStringLiteral("onlyFavorites"), false).toBool();
+ QList<QString> favoriteItems = m_settings.value(QStringLiteral("favoriteItems")).toString()
.split(QLatin1Char(','), QString::SkipEmptyParts);
model()->setFavoriteItems( favoriteItems );
@@ -311,7 +311,7 @@ void WeatherPlugin::updateItemSettings()
void WeatherPlugin::favoriteItemsChanged( const QStringList& favoriteItems )
{
- m_settings["favoriteItems"] = favoriteItems.join(QLatin1Char(','));
+ m_settings[QStringLiteral("favoriteItems")] = favoriteItems.join(QLatin1Char(','));
emit settingsChanged( nameId() );
updateSettings();
}
diff --git a/src/plugins/render/wikipedia/WikipediaItem.cpp b/src/plugins/render/wikipedia/WikipediaItem.cpp
index 7c1bd3e..1a87d87 100644
--- a/src/plugins/render/wikipedia/WikipediaItem.cpp
+++ b/src/plugins/render/wikipedia/WikipediaItem.cpp
@@ -192,7 +192,7 @@ void WikipediaItem::setIcon( const QIcon& icon )
void WikipediaItem::setSettings( const QHash<QString, QVariant>& settings )
{
- const bool showThumbnail = settings.value( "showThumbnails", false ).toBool();
+ const bool showThumbnail = settings.value(QStringLiteral("showThumbnails"), false).toBool();
if ( showThumbnail != m_showThumbnail ) {
m_showThumbnail = showThumbnail;
diff --git a/src/plugins/render/wikipedia/WikipediaPlugin.cpp b/src/plugins/render/wikipedia/WikipediaPlugin.cpp
index 8f3e0da..780478b 100644
--- a/src/plugins/render/wikipedia/WikipediaPlugin.cpp
+++ b/src/plugins/render/wikipedia/WikipediaPlugin.cpp
@@ -137,8 +137,8 @@ QHash<QString,QVariant> WikipediaPlugin::settings() const
{
QHash<QString, QVariant> settings = AbstractDataPlugin::settings();
- settings.insert( "numberOfItems", numberOfItems() );
- settings.insert( "showThumbnails", m_showThumbnails );
+ settings.insert(QStringLiteral("numberOfItems"), numberOfItems());
+ settings.insert(QStringLiteral("showThumbnails"), m_showThumbnails);
return settings;
}
@@ -147,8 +147,8 @@ void WikipediaPlugin::setSettings( const QHash<QString,QVariant> &settings )
{
AbstractDataPlugin::setSettings( settings );
- setNumberOfItems( qMin<int>( maximumNumberOfItems, settings.value( "numberOfItems", 15 ).toInt() ) );
- m_showThumbnails = settings.value( "showThumbnails", true ).toBool();
+ setNumberOfItems(qMin<int>(maximumNumberOfItems, settings.value(QStringLiteral("numberOfItems"), 15).toInt()));
+ m_showThumbnails = settings.value(QStringLiteral("showThumbnails"), true).toBool();
readSettings();
emit settingsChanged( nameId() );
diff --git a/src/plugins/runner/cyclestreets/CycleStreetsPlugin.cpp b/src/plugins/runner/cyclestreets/CycleStreetsPlugin.cpp
index 5a6c7ad..9116be5 100644
--- a/src/plugins/runner/cyclestreets/CycleStreetsPlugin.cpp
+++ b/src/plugins/runner/cyclestreets/CycleStreetsPlugin.cpp
@@ -58,24 +58,24 @@ void CycleStreetsConfigWidget::loadSettings( const QHash<QString, QVariant> &set
QHash<QString, QVariant> settings = settings_;
// Check if all fields are filled and fill them with default values.
- if ( !settings.contains( "plan" ) ) {
- settings.insert( "plan", "balanced" );
+ if (!settings.contains(QStringLiteral("plan"))) {
+ settings.insert(QStringLiteral("plan"), QStringLiteral("balanced"));
}
- if ( !settings.contains( "speed" ) ) {
- settings.insert( "speed", "20" );
+ if (!settings.contains(QStringLiteral("speed"))) {
+ settings.insert(QStringLiteral("speed"), QStringLiteral("20"));
}
ui_configWidget->plan->setCurrentIndex(
- ui_configWidget->plan->findData( settings.value( "plan" ) ));
+ ui_configWidget->plan->findData(settings.value(QStringLiteral("plan"))));
ui_configWidget->speed->setCurrentIndex(
- ui_configWidget->speed->findData( settings.value( "speed" ) ));
+ ui_configWidget->speed->findData(settings.value(QStringLiteral("speed"))));
}
QHash<QString, QVariant> CycleStreetsConfigWidget::settings() const
{
QHash<QString,QVariant> settings;
- settings.insert( "plan",
+ settings.insert(QStringLiteral("plan"),
ui_configWidget->plan->itemData( ui_configWidget->plan->currentIndex() ) );
- settings.insert( "speed",
+ settings.insert(QStringLiteral("speed"),
ui_configWidget->speed->itemData( ui_configWidget->speed->currentIndex() ) );
return settings;
}
diff --git a/src/plugins/runner/cyclestreets/CycleStreetsRunner.cpp b/src/plugins/runner/cyclestreets/CycleStreetsRunner.cpp
index c54bd92..215da2f 100644
--- a/src/plugins/runner/cyclestreets/CycleStreetsRunner.cpp
+++ b/src/plugins/runner/cyclestreets/CycleStreetsRunner.cpp
@@ -65,14 +65,14 @@ void CycleStreetsRunner::retrieveRoute( const RouteRequest *route )
return;
}
- QHash<QString, QVariant> settings = route->routingProfile().pluginSettings()["cyclestreets"];
+ QHash<QString, QVariant> settings = route->routingProfile().pluginSettings()[QStringLiteral("cyclestreets")];
QUrl url("http://www.cyclestreets.net/api/journey.xml");
QMap<QString, QString> queryStrings;
queryStrings["key"] = "cdccf13997d59e70";
queryStrings["useDom"] = QLatin1Char('1');
- queryStrings["plan"] = settings["plan"].toString();
- queryStrings["speed"] = settings["speed"].toString();
+ queryStrings["plan"] = settings[QStringLiteral("plan")].toString();
+ queryStrings["speed"] = settings[QStringLiteral("speed")].toString();
GeoDataCoordinates::Unit const degree = GeoDataCoordinates::Degree;
QString itinerarypoints;
itinerarypoints.append(QString::number(route->source().longitude(degree), 'f', 6) + QLatin1Char(',') + QString::number(route->source().latitude(degree), 'f', 6));
diff --git a/src/plugins/runner/mapquest/MapQuestPlugin.cpp b/src/plugins/runner/mapquest/MapQuestPlugin.cpp
index b069bad..b77397b 100644
--- a/src/plugins/runner/mapquest/MapQuestPlugin.cpp
+++ b/src/plugins/runner/mapquest/MapQuestPlugin.cpp
@@ -97,42 +97,42 @@ public:
QHash<QString, QVariant> settings = settings_;
// Check if all fields are filled and fill them with default values.
- if ( !settings.contains( "preference" ) ) {
- settings.insert( "preference", "fastest" );
+ if (!settings.contains(QStringLiteral("preference"))) {
+ settings.insert(QStringLiteral("preference"), QStringLiteral("fastest"));
}
- if ( !settings.contains( "ascending" ) ) {
- settings.insert( "ascending", "DEFAULT_STRATEGY" );
+ if (!settings.contains(QStringLiteral("ascending"))) {
+ settings.insert(QStringLiteral("ascending"), QStringLiteral("DEFAULT_STRATEGY"));
}
- if ( !settings.contains( "descending" ) ) {
- settings.insert( "descending", "DEFAULT_STRATEGY" );
+ if (!settings.contains(QStringLiteral("descending"))) {
+ settings.insert(QStringLiteral("descending"), QStringLiteral("DEFAULT_STRATEGY"));
}
- if ( !settings.contains( "appKey" ) ) {
- settings.insert( "appKey", "" );
+ if (!settings.contains(QStringLiteral("appKey"))) {
+ settings.insert(QStringLiteral("appKey"), QString());
}
- ui_configWidget->appKey->setText( settings.value( "appKey" ).toString() );
+ ui_configWidget->appKey->setText(settings.value(QStringLiteral("appKey")).toString() );
ui_configWidget->preference->setCurrentIndex(
- ui_configWidget->preference->findData( settings.value( "preference" ).toString() ) );
- ui_configWidget->noMotorways->setCheckState( static_cast<Qt::CheckState>( settings.value( "noMotorways" ).toInt() ) );
- ui_configWidget->noTollways->setCheckState( static_cast<Qt::CheckState>( settings.value( "noTollways" ).toInt() ) );
- ui_configWidget->noFerries->setCheckState( static_cast<Qt::CheckState>( settings.value( "noFerries" ).toInt() ) );
+ ui_configWidget->preference->findData(settings.value(QStringLiteral("preference")).toString()));
+ ui_configWidget->noMotorways->setCheckState( static_cast<Qt::CheckState>(settings.value(QStringLiteral("noMotorways")).toInt()));
+ ui_configWidget->noTollways->setCheckState( static_cast<Qt::CheckState>(settings.value(QStringLiteral("noTollways")).toInt()));
+ ui_configWidget->noFerries->setCheckState( static_cast<Qt::CheckState>(settings.value(QStringLiteral("noFerries")).toInt()));
ui_configWidget->ascending->setCurrentIndex(
- ui_configWidget->ascending->findData( settings.value( "ascending" ).toString() ) );
+ ui_configWidget->ascending->findData(settings.value(QStringLiteral("ascending")).toString()));
ui_configWidget->descending->setCurrentIndex(
- ui_configWidget->descending->findData( settings.value( "descending" ).toString() ) );
+ ui_configWidget->descending->findData(settings.value(QStringLiteral("descending")).toString()));
}
virtual QHash<QString, QVariant> settings() const
{
QHash<QString,QVariant> settings;
- settings.insert( "appKey", ui_configWidget->appKey->text() );
- settings.insert( "preference",
+ settings.insert(QStringLiteral("appKey"), ui_configWidget->appKey->text());
+ settings.insert(QStringLiteral("preference"),
ui_configWidget->preference->itemData( ui_configWidget->preference->currentIndex() ) );
- settings.insert( "noMotorways", ui_configWidget->noMotorways->checkState() );
- settings.insert( "noTollways", ui_configWidget->noTollways->checkState() );
- settings.insert( "noFerries", ui_configWidget->noFerries->checkState() );
- settings.insert( "ascending",
+ settings.insert(QStringLiteral("noMotorways"), ui_configWidget->noMotorways->checkState());
+ settings.insert(QStringLiteral("noTollways"), ui_configWidget->noTollways->checkState());
+ settings.insert(QStringLiteral("noFerries"), ui_configWidget->noFerries->checkState());
+ settings.insert(QStringLiteral("ascending"),
ui_configWidget->ascending->itemData( ui_configWidget->ascending->currentIndex() ) );
- settings.insert( "descending",
+ settings.insert(QStringLiteral("descending"),
ui_configWidget->descending->itemData( ui_configWidget->descending->currentIndex() ) );
return settings;
}
@@ -161,18 +161,18 @@ QHash< QString, QVariant > MapQuestPlugin::templateSettings( RoutingProfilesMode
QHash<QString, QVariant> result;
switch ( profileTemplate ) {
case RoutingProfilesModel::CarFastestTemplate:
- result["preference"] = "fastest";
+ result.insert(QStringLiteral("preference"), QStringLiteral("fastest"));
break;
case RoutingProfilesModel::CarShortestTemplate:
- result["preference"] = "shortest";
+ result.insert(QStringLiteral("preference"), QStringLiteral("shortest"));
break;
case RoutingProfilesModel::CarEcologicalTemplate:
break;
case RoutingProfilesModel::BicycleTemplate:
- result["preference"] = "bicycle";
+ result.insert(QStringLiteral("preference"), QStringLiteral("bicycle"));
break;
case RoutingProfilesModel::PedestrianTemplate:
- result["preference"] = "pedestrian";
+ result.insert(QStringLiteral("preference"), QStringLiteral("pedestrian"));
break;
case RoutingProfilesModel::LastTemplate:
Q_ASSERT( false );
diff --git a/src/plugins/runner/mapquest/MapQuestRunner.cpp b/src/plugins/runner/mapquest/MapQuestRunner.cpp
index df7621d..1ad7f23 100644
--- a/src/plugins/runner/mapquest/MapQuestRunner.cpp
+++ b/src/plugins/runner/mapquest/MapQuestRunner.cpp
@@ -53,8 +53,7 @@ void MapQuestRunner::retrieveRoute( const RouteRequest *route )
QHash<QString, QVariant> settings = route->routingProfile().pluginSettings()["mapquest"];
- if ( settings.value( "appKey" ).toString().isEmpty() )
- {
+ if (settings.value(QStringLiteral("appKey")).toString().isEmpty()) {
return;
}
@@ -68,18 +67,18 @@ void MapQuestRunner::retrieveRoute( const RouteRequest *route )
QString const unit = MarbleGlobal::getInstance()->locale()->measurementSystem() == MarbleLocale::MetricSystem ? "k" : "m";
append( &url, "units", unit );
- if ( settings["noMotorways"].toInt() ) {
+ if (settings[QStringLiteral("noMotorways")].toInt()) {
append( &url, "avoids", "Limited Access" );
}
- if ( settings["noTollroads"].toInt() ) {
+ if (settings[QStringLiteral("noTollroads")].toInt()) {
append( &url, "avoids", "Toll road" );
}
- if ( settings["noFerries"].toInt() ) {
+ if (settings[QStringLiteral("noFerries")].toInt()) {
append( &url, "avoids", "Ferry" );
}
- if ( !settings["preference"].toString().isEmpty() ) {
- append( &url, "routeType", settings["preference"].toString() );
+ if (!settings[QStringLiteral("preference")].toString().isEmpty()) {
+ append(&url, QStringLiteral("routeType"), settings[QStringLiteral("preference")].toString());
}
const QString ascendingSetting = settings[QStringLiteral("ascending")].toString();
@@ -114,7 +113,7 @@ void MapQuestRunner::retrieveRoute( const RouteRequest *route )
QUrl qurl(url);
// FIXME: verify that this works with special characters.
QUrlQuery urlQuery;
- urlQuery.addQueryItem( "key", settings.value( "appKey" ).toByteArray() );
+ urlQuery.addQueryItem(QStringLiteral("key"), settings.value(QStringLiteral("appKey")).toByteArray());
qurl.setQuery(urlQuery);
m_request.setUrl( qurl );
m_request.setRawHeader( "User-Agent", HttpDownloadManager::userAgent( "Browser", "MapQuestRunner" ) );
diff --git a/src/plugins/runner/monav/MonavConfigWidget.cpp b/src/plugins/runner/monav/MonavConfigWidget.cpp
index b1a48d1..fc5d758 100644
--- a/src/plugins/runner/monav/MonavConfigWidget.cpp
+++ b/src/plugins/runner/monav/MonavConfigWidget.cpp
@@ -353,7 +353,7 @@ MonavConfigWidget::~MonavConfigWidget()
void MonavConfigWidget::loadSettings( const QHash<QString, QVariant> &settings )
{
- d->m_transport = settings["transport"].toString();
+ d->m_transport = settings[QStringLiteral("transport")].toString();
d->updateTransportPreference();
}
@@ -384,7 +384,7 @@ void MonavConfigWidgetPrivate::updateTransportPreference()
QHash<QString, QVariant> MonavConfigWidget::settings() const
{
QHash<QString, QVariant> settings;
- settings["transport"] = d->m_transport;
+ settings.insert(QStringLiteral("transport"), d->m_transport);
return settings;
}
diff --git a/src/plugins/runner/monav/MonavPlugin.cpp b/src/plugins/runner/monav/MonavPlugin.cpp
index 76914b2..411df92 100644
--- a/src/plugins/runner/monav/MonavPlugin.cpp
+++ b/src/plugins/runner/monav/MonavPlugin.cpp
@@ -292,7 +292,7 @@ QString MonavPlugin::mapDirectoryForRequest( const RouteRequest* request ) const
d->initialize();
QHash<QString, QVariant> settings = request->routingProfile().pluginSettings()[nameId()];
- QString transport = settings["transport"].toString();
+ const QString transport = settings[QStringLiteral("transport")].toString();
for ( int j=0; j<d->m_maps.size(); ++j ) {
bool valid = true;
@@ -326,7 +326,7 @@ QStringList MonavPlugin::mapDirectoriesForRequest( const RouteRequest* request )
QStringList result;
d->initialize();
QHash<QString, QVariant> settings = request->routingProfile().pluginSettings()[nameId()];
- QString transport = settings["transport"].toString();
+ const QString transport = settings[QStringLiteral("transport")].toString();
for ( int j=0; j<d->m_maps.size(); ++j ) {
bool valid = true;
diff --git a/src/plugins/runner/openrouteservice/OpenRouteServicePlugin.cpp b/src/plugins/runner/openrouteservice/OpenRouteServicePlugin.cpp
index 84c56ef..3f65a6d 100644
--- a/src/plugins/runner/openrouteservice/OpenRouteServicePlugin.cpp
+++ b/src/plugins/runner/openrouteservice/OpenRouteServicePlugin.cpp
@@ -92,24 +92,24 @@ public:
QHash<QString, QVariant> settings = settings_;
// Check if all fields are filled and fill them with default values.
- if ( !settings.contains( "preference" ) ) {
- settings.insert( "preference", "Fastest" );
+ if (!settings.contains(QStringLiteral("preference"))) {
+ settings.insert(QStringLiteral("preference"), QStringLiteral("Fastest"));
}
ui_configWidget->preference->setCurrentIndex(
- ui_configWidget->preference->findData( settings.value( "preference" ).toString() ) );
- ui_configWidget->noMotorways->setCheckState( static_cast<Qt::CheckState>( settings.value( "noMotorways" ).toInt() ) );
- ui_configWidget->noTollways->setCheckState( static_cast<Qt::CheckState>( settings.value( "noTollways" ).toInt() ) );
- ui_configWidget->noFerries->setCheckState( static_cast<Qt::CheckState>( settings.value( "noFerries" ).toInt() ) );
+ ui_configWidget->preference->findData(settings.value(QStringLiteral("preference")).toString()));
+ ui_configWidget->noMotorways->setCheckState(static_cast<Qt::CheckState>(settings.value(QStringLiteral("noMotorways")).toInt()));
+ ui_configWidget->noTollways->setCheckState(static_cast<Qt::CheckState>(settings.value(QStringLiteral("noTollways")).toInt()));
+ ui_configWidget->noFerries->setCheckState(static_cast<Qt::CheckState>(settings.value(QStringLiteral("noFerries")).toInt()));
}
virtual QHash<QString, QVariant> settings() const
{
QHash<QString,QVariant> settings;
- settings.insert( "preference",
+ settings.insert(QStringLiteral("preference"),
ui_configWidget->preference->itemData( ui_configWidget->preference->currentIndex() ) );
- settings.insert( "noMotorways", ui_configWidget->noMotorways->checkState() );
- settings.insert( "noTollways", ui_configWidget->noTollways->checkState() );
- settings.insert( "noFerries", ui_configWidget->noFerries->checkState() );
+ settings.insert(QStringLiteral("noMotorways"), ui_configWidget->noMotorways->checkState());
+ settings.insert(QStringLiteral("noTollways"), ui_configWidget->noTollways->checkState());
+ settings.insert(QStringLiteral("noFerries"), ui_configWidget->noFerries->checkState());
return settings;
}
private:
@@ -137,18 +137,18 @@ QHash< QString, QVariant > OpenRouteServicePlugin::templateSettings( RoutingProf
QHash<QString, QVariant> result;
switch ( profileTemplate ) {
case RoutingProfilesModel::CarFastestTemplate:
- result["preference"] = "Fastest";
+ result.insert(QStringLiteral("preference"), QStringLiteral("Fastest"));
break;
case RoutingProfilesModel::CarShortestTemplate:
- result["preference"] = "Shortest";
+ result.insert(QStringLiteral("preference"), QStringLiteral("Shortest"));
break;
case RoutingProfilesModel::CarEcologicalTemplate:
break;
case RoutingProfilesModel::BicycleTemplate:
- result["preference"] = "Bicycle";
+ result.insert(QStringLiteral("preference"), QStringLiteral("Bicycle"));
break;
case RoutingProfilesModel::PedestrianTemplate:
- result["preference"] = "Pedestrian";
+ result.insert(QStringLiteral("preference"), QStringLiteral("Pedestrian"));
break;
case RoutingProfilesModel::LastTemplate:
Q_ASSERT( false );
diff --git a/src/plugins/runner/openrouteservice/OpenRouteServiceRunner.cpp b/src/plugins/runner/openrouteservice/OpenRouteServiceRunner.cpp
index fe38de1..7c39f86 100644
--- a/src/plugins/runner/openrouteservice/OpenRouteServiceRunner.cpp
+++ b/src/plugins/runner/openrouteservice/OpenRouteServiceRunner.cpp
@@ -54,8 +54,8 @@ void OpenRouteServiceRunner::retrieveRoute( const RouteRequest *route )
QString request = xmlHeader();
QString unit = "KM";
QString preference = "Fastest";
- if ( settings.contains( "preference" ) ) {
- preference = settings["preference"].toString();
+ if (settings.contains(QStringLiteral("preference"))) {
+ preference = settings[QStringLiteral("preference")].toString();
}
if (preference == QLatin1String("Pedestrian")) {
unit = QStringLiteral("M");
@@ -169,12 +169,13 @@ QString OpenRouteServiceRunner::requestFooter( const QHash<QString, QVariant>& s
{
QString result = QLatin1String("</xls:WayPointList>\n");
- if (settings["noMotorways"].toInt() || settings["noTollways"].toInt() ) {
+ if (settings[QStringLiteral("noMotorways")].toInt() ||
+ settings[QStringLiteral("noTollways")].toInt()) {
result += QLatin1String("<xls:AvoidList>\n");
- if ( settings["noTollways"].toInt() ) {
+ if (settings[QStringLiteral("noTollways")].toInt()) {
result += QLatin1String("<xls:AvoidFeature>Tollway</xls:AvoidFeature>");
}
- if ( settings["noMotorways"].toInt() ) {
+ if (settings[QStringLiteral("noMotorways")].toInt()) {
result += QLatin1String("<xls:AvoidFeature>Highway</xls:AvoidFeature>");
}
result += QLatin1String("</xls:AvoidList>\n");
diff --git a/src/plugins/runner/routino/RoutinoPlugin.cpp b/src/plugins/runner/routino/RoutinoPlugin.cpp
index 002d7f7..529069c 100644
--- a/src/plugins/runner/routino/RoutinoPlugin.cpp
+++ b/src/plugins/runner/routino/RoutinoPlugin.cpp
@@ -90,12 +90,12 @@ public:
QHash<QString, QVariant> settings = settings_;
// Check if all fields are filled and fill them with default values.
- if ( !settings.contains( "transport" ) ) {
- settings.insert( "transport", "motorcar" );
+ if (!settings.contains(QStringLiteral("transport"))) {
+ settings.insert(QStringLiteral("transport"), QStringLiteral("motorcar"));
}
ui_configWidget->transport->setCurrentIndex(
- ui_configWidget->transport->findData( settings.value( "transport" ).toString() ) );
- if (settings.value("method").toString() == QLatin1String("shortest")) {
+ ui_configWidget->transport->findData(settings.value(QStringLiteral("transport")).toString()));
+ if (settings.value(QStringLiteral("method")).toString() == QLatin1String("shortest")) {
ui_configWidget->shortest->setChecked( true );
} else {
ui_configWidget->fastest->setChecked( true );
@@ -105,13 +105,13 @@ public:
virtual QHash<QString, QVariant> settings() const
{
QHash<QString,QVariant> settings;
- settings.insert( "transport",
+ settings.insert(QStringLiteral("transport"),
ui_configWidget->transport->itemData( ui_configWidget->transport->currentIndex() ) );
if ( ui_configWidget->shortest->isChecked() ) {
- settings.insert( "method", "shortest" );
+ settings.insert(QStringLiteral("method"), QStringLiteral("shortest"));
} else {
- settings.insert( "method", "fastest" );
+ settings.insert(QStringLiteral("method"), QStringLiteral("fastest"));
}
return settings;
}
@@ -139,22 +139,22 @@ QHash< QString, QVariant > RoutinoPlugin::templateSettings(RoutingProfilesModel:
QHash<QString, QVariant> result;
switch ( profileTemplate ) {
case RoutingProfilesModel::CarFastestTemplate:
- result["transport"] = "motorcar";
- result["method"] = "fastest";
+ result.insert(QStringLiteral("transport"), QStringLiteral("motorcar"));
+ result.insert(QStringLiteral("method"), QStringLiteral("fastest"));
break;
case RoutingProfilesModel::CarShortestTemplate:
- result["transport"] = "motorcar";
- result["method"] = "shortest";
+ result.insert(QStringLiteral("transport"), QStringLiteral("motorcar"));
+ result.insert(QStringLiteral("method"), QStringLiteral("shortest"));
break;
case RoutingProfilesModel::CarEcologicalTemplate:
break;
case RoutingProfilesModel::BicycleTemplate:
- result["transport"] = "bicycle";
- result["method"] = "shortest";
+ result.insert(QStringLiteral("transport"), QStringLiteral("bicycle"));
+ result.insert(QStringLiteral("method"), QStringLiteral("shortest"));
break;
case RoutingProfilesModel::PedestrianTemplate:
- result["transport"] = "foot";
- result["method"] = "shortest";
+ result.insert(QStringLiteral("transport"), QStringLiteral("foot"));
+ result.insert(QStringLiteral("method"), QStringLiteral("shortest"));
break;
case RoutingProfilesModel::LastTemplate:
Q_ASSERT( false );
diff --git a/src/plugins/runner/routino/RoutinoRunner.cpp b/src/plugins/runner/routino/RoutinoRunner.cpp
index 7f8738b..d9ce81d 100644
--- a/src/plugins/runner/routino/RoutinoRunner.cpp
+++ b/src/plugins/runner/routino/RoutinoRunner.cpp
@@ -241,11 +241,11 @@ void RoutinoRunner::retrieveRoute( const RouteRequest *route )
params << QString("--lon%1=%2").arg(i+1).arg(fLon, 0, 'f', 8);
}
- QHash<QString, QVariant> settings = route->routingProfile().pluginSettings()["routino"];
- QString transport = settings["transport"].toString();
+ QHash<QString, QVariant> settings = route->routingProfile().pluginSettings()[QStringLiteral("routino")];
+ QString transport = settings[QStringLiteral("transport")].toString();
params << QString( "--transport=%0" ).arg( transport );
- if (settings["method"] == QLatin1String("shortest")) {
+ if (settings[QStringLiteral("method")] == QLatin1String("shortest")) {
params << "--shortest";
} else {
params << "--quickest";