Commit 531bebed authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Use QStringLiteral with QString keys for setting methods

parent 9c43b440
......@@ -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);
......
......@@ -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
......
......@@ -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
......
......@@ -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() );
......
......@@ -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();
}
......
......@@ -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();
}
......
......@@ -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() );
}
......
......@@ -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 ) ) {
......
......@@ -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;
......
......@@ -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 );
......
......@@ -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()
......
......@@ -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 {
......
......@@ -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() );
}
......
......@@ -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 ) {
......
......@@ -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();
......
......@@ -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 )