summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFriedrich W. H. Kossebau <kossebau@kde.org>2016-09-02 14:42:31 (GMT)
committerFriedrich W. H. Kossebau <kossebau@kde.org>2016-09-02 15:09:34 (GMT)
commit08609a15d8fdad2b41bc8a9494bc9d873c8f22db (patch)
tree70de7bb5770fe0e1470e402bca5e484255d6516a
parent81a296d856c156626172b028efedfbc1d1849003 (diff)
Use QStringLiteral with more value(QString) methods
-rw-r--r--examples/cpp/marble-game/GameMainWindow.cpp2
-rw-r--r--src/lib/marble/EditBookmarkDialog.cpp14
-rw-r--r--src/lib/marble/ExternalEditorDialog.cpp2
-rw-r--r--src/lib/marble/GeoGraphicsScene.cpp2
-rw-r--r--src/lib/marble/MapViewWidget.cpp2
-rw-r--r--src/lib/marble/MarblePlacemarkModel.cpp4
-rw-r--r--src/lib/marble/MarbleWidgetPopupMenu.cpp6
-rw-r--r--src/lib/marble/NewstuffModel.cpp2
-rw-r--r--src/lib/marble/cloudsync/OwncloudSyncBackend.cpp4
-rw-r--r--src/lib/marble/geodata/data/GeoDataFeature.cpp5
-rw-r--r--src/lib/marble/osm/OsmTagEditorWidget_p.cpp2
-rw-r--r--src/lib/marble/routing/RouteRequest.cpp2
-rw-r--r--src/lib/marble/routing/RoutingInputWidget.cpp6
-rw-r--r--src/lib/marble/routing/RoutingManager.cpp4
-rw-r--r--src/plugins/runner/monav/MonavConfigWidget.cpp2
-rw-r--r--src/plugins/runner/monav/MonavPlugin.cpp2
16 files changed, 31 insertions, 30 deletions
diff --git a/examples/cpp/marble-game/GameMainWindow.cpp b/examples/cpp/marble-game/GameMainWindow.cpp
index 9d3b186..6b36c07 100644
--- a/examples/cpp/marble-game/GameMainWindow.cpp
+++ b/examples/cpp/marble-game/GameMainWindow.cpp
@@ -83,7 +83,7 @@ Private::Private(QWidget* parent) :
QString Private::readMarbleDataPath() const
{
- return QSettings().value("MarbleWidget/marbleDataPath", "").toString();
+ return QSettings().value(QStringLiteral("MarbleWidget/marbleDataPath"), QString()).toString();
}
void Private::setupMarbleWidget()
diff --git a/src/lib/marble/EditBookmarkDialog.cpp b/src/lib/marble/EditBookmarkDialog.cpp
index 82bae90..2a71af4 100644
--- a/src/lib/marble/EditBookmarkDialog.cpp
+++ b/src/lib/marble/EditBookmarkDialog.cpp
@@ -192,17 +192,17 @@ void EditBookmarkDialogPrivate::retrieveGeocodeResult( const GeoDataCoordinates
//FIXME : Optimal logic for suggestion with distance consideration is required
if( distance >= 3500 ) {
- bookmarkName = data.value("country").value().toString() ;
+ bookmarkName = data.value(QStringLiteral("country")).value().toString();
}
else if( distance >= 200 ) {
- bookmarkName = append( data.value("city").value().toString()
- , data.value("state").value().toString() );
- bookmarkName = append( bookmarkName, data.value("country").value().toString() ) ;
+ bookmarkName = append(data.value(QStringLiteral("city")).value().toString(),
+ data.value(QStringLiteral("state")).value().toString());
+ bookmarkName = append(bookmarkName, data.value(QStringLiteral("country")).value().toString());
}
else {
- bookmarkName = append( data.value("road").value().toString()
- , data.value("city").value().toString());
- bookmarkName = append( bookmarkName, data.value("country").value().toString() ) ;
+ bookmarkName = append(data.value(QStringLiteral("road")).value().toString(),
+ data.value(QStringLiteral("city")).value().toString());
+ bookmarkName = append(bookmarkName, data.value(QStringLiteral("country")).value().toString());
}
if( bookmarkName.isEmpty() ) {
diff --git a/src/lib/marble/ExternalEditorDialog.cpp b/src/lib/marble/ExternalEditorDialog.cpp
index 7589cb6..28911fc 100644
--- a/src/lib/marble/ExternalEditorDialog.cpp
+++ b/src/lib/marble/ExternalEditorDialog.cpp
@@ -35,7 +35,7 @@ public:
ExternalEditorDialogPrivate::ExternalEditorDialogPrivate() :
m_defaultEditor( potlatch )
{
- QString path = QProcessEnvironment::systemEnvironment().value( "PATH", "/usr/local/bin:/usr/bin:/bin" );
+ QString path = QProcessEnvironment::systemEnvironment().value(QStringLiteral("PATH"), QStringLiteral("/usr/local/bin:/usr/bin:/bin"));
foreach( const QString &application, QStringList() << merkaartor << josm ) {
m_installedEditors[application] = false;
/** @todo: what's the qt way to get the path entry separator? Will be a semicolon on Windows */
diff --git a/src/lib/marble/GeoGraphicsScene.cpp b/src/lib/marble/GeoGraphicsScene.cpp
index a245c7a..39371eb 100644
--- a/src/lib/marble/GeoGraphicsScene.cpp
+++ b/src/lib/marble/GeoGraphicsScene.cpp
@@ -60,7 +60,7 @@ GeoDataStyle::Ptr GeoGraphicsScenePrivate::highlightStyle( const GeoDataDocument
const GeoDataStyleMap &styleMap )
{
// @todo Consider QUrl parsing when external styles are suppported
- QString highlightStyleId = styleMap.value("highlight");
+ QString highlightStyleId = styleMap.value(QStringLiteral("highlight"));
highlightStyleId.remove(QLatin1Char('#'));
if ( !highlightStyleId.isEmpty() ) {
GeoDataStyle::Ptr highlightStyle(new GeoDataStyle( *document->style(highlightStyleId) ));
diff --git a/src/lib/marble/MapViewWidget.cpp b/src/lib/marble/MapViewWidget.cpp
index 10503b0..6ee6e4b 100644
--- a/src/lib/marble/MapViewWidget.cpp
+++ b/src/lib/marble/MapViewWidget.cpp
@@ -286,7 +286,7 @@ MapViewWidget::MapViewWidget( QWidget *parent, Qt::WindowFlags f )
}
else {
d->m_mapViewUi.marbleThemeSelectView->setViewMode( QListView::IconMode );
- QSize const iconSize = d->m_settings.value( "MapView/iconSize", QSize( 90, 90 ) ).toSize();
+ QSize const iconSize = d->m_settings.value(QStringLiteral("MapView/iconSize"), QSize(90, 90)).toSize();
d->m_mapViewUi.marbleThemeSelectView->setIconSize( iconSize );
d->m_mapViewUi.marbleThemeSelectView->setItemDelegate( new MapViewItemDelegate( d->m_mapViewUi.marbleThemeSelectView ) );
d->m_mapViewUi.marbleThemeSelectView->setAlternatingRowColors( true );
diff --git a/src/lib/marble/MarblePlacemarkModel.cpp b/src/lib/marble/MarblePlacemarkModel.cpp
index 3fea569..a1d6bce 100644
--- a/src/lib/marble/MarblePlacemarkModel.cpp
+++ b/src/lib/marble/MarblePlacemarkModel.cpp
@@ -145,9 +145,9 @@ QVariant MarblePlacemarkModel::data( const QModelIndex &index, int role ) const
} else if ( role == StyleRole ) {
return qVariantFromValue( d->m_placemarkContainer->at( index.row() )->style().data() );
} else if ( role == GmtRole ) {
- return qVariantFromValue( d->m_placemarkContainer->at( index.row() )->extendedData().value("gmt").value() );
+ return qVariantFromValue( d->m_placemarkContainer->at( index.row() )->extendedData().value(QStringLiteral("gmt")).value() );
} else if ( role == DstRole ) {
- return qVariantFromValue( d->m_placemarkContainer->at( index.row() )->extendedData().value("dst").value() );
+ return qVariantFromValue( d->m_placemarkContainer->at( index.row() )->extendedData().value(QStringLiteral("dst")).value() );
} else if ( role == GeometryRole ) {
return qVariantFromValue( d->m_placemarkContainer->at( index.row() )->geometry() );
} else if ( role == ObjectPointerRole ) {
diff --git a/src/lib/marble/MarbleWidgetPopupMenu.cpp b/src/lib/marble/MarbleWidgetPopupMenu.cpp
index 74ebfac..bf04b00 100644
--- a/src/lib/marble/MarbleWidgetPopupMenu.cpp
+++ b/src/lib/marble/MarbleWidgetPopupMenu.cpp
@@ -395,9 +395,9 @@ void MarbleWidgetPopupMenu::Private::setupDialogCity( PopupLayer *popup, const G
doc["country"] = placemark->countryCode();
doc["state"] = placemark->state();
- QString dst = QString( "%1" ).arg( ( placemark->extendedData().value("gmt").value().toInt() +
- placemark->extendedData().value("dst").value().toInt() ) /
- ( double ) 100, 0, 'f', 1 );
+ QString dst = QStringLiteral("%1").arg((placemark->extendedData().value(QStringLiteral("gmt")).value().toInt() +
+ placemark->extendedData().value(QStringLiteral("dst")).value().toInt()) /
+ ( double ) 100, 0, 'f', 1 );
// There is an issue about UTC.
// It's possible to variants (e.g.):
// +1.0 and -1.0, but dst does not have + an the start
diff --git a/src/lib/marble/NewstuffModel.cpp b/src/lib/marble/NewstuffModel.cpp
index 29ef69d..f08efdf 100644
--- a/src/lib/marble/NewstuffModel.cpp
+++ b/src/lib/marble/NewstuffModel.cpp
@@ -320,7 +320,7 @@ void NewstuffModelPrivate::handleProviderData(QNetworkReply *reply)
bool NewstuffModelPrivate::canExecute( const QString &executable )
{
- QString path = QProcessEnvironment::systemEnvironment().value( "PATH", "/usr/local/bin:/usr/bin:/bin" );
+ QString path = QProcessEnvironment::systemEnvironment().value(QStringLiteral("PATH"), QStringLiteral("/usr/local/bin:/usr/bin:/bin"));
foreach( const QString &dir, path.split( QLatin1Char( ':' ) ) ) {
QFileInfo application( QDir( dir ), executable );
if ( application.exists() ) {
diff --git a/src/lib/marble/cloudsync/OwncloudSyncBackend.cpp b/src/lib/marble/cloudsync/OwncloudSyncBackend.cpp
index eaa8543..3836e4f 100644
--- a/src/lib/marble/cloudsync/OwncloudSyncBackend.cpp
+++ b/src/lib/marble/cloudsync/OwncloudSyncBackend.cpp
@@ -153,7 +153,7 @@ void OwncloudSyncBackend::uploadRoute( const QString &timestamp )
// Duration part
double duration =
- QTime().secsTo( QTime::fromString( placemark->extendedData().value("duration").value().toString(), Qt::ISODate ) ) / 60.0;
+ QTime().secsTo(QTime::fromString(placemark->extendedData().value(QStringLiteral("duration")).value().toString(), Qt::ISODate)) / 60.0;
mDebug() << "[Owncloud] Duration on write is" << duration;
data.append( "Content-Disposition: form-data; name=\"duration\"" );
data.append( "\r\n\r\n" );
@@ -163,7 +163,7 @@ void OwncloudSyncBackend::uploadRoute( const QString &timestamp )
// Distance part
double distance =
- placemark->extendedData().value("length").value().toDouble();
+ placemark->extendedData().value(QStringLiteral("length")).value().toDouble();
mDebug() << "[Owncloud] Distance on write is" << distance;
data.append( "Content-Disposition: form-data; name=\"distance\"" );
data.append( "\r\n\r\n" );
diff --git a/src/lib/marble/geodata/data/GeoDataFeature.cpp b/src/lib/marble/geodata/data/GeoDataFeature.cpp
index b6ef8a5..3ab8764 100644
--- a/src/lib/marble/geodata/data/GeoDataFeature.cpp
+++ b/src/lib/marble/geodata/data/GeoDataFeature.cpp
@@ -267,8 +267,9 @@ void GeoDataFeature::setStyleUrl( const QString &value )
if( object->nodeType() == GeoDataTypes::GeoDataDocumentType ) {
GeoDataDocument *doc = static_cast<GeoDataDocument*> ( object );
GeoDataStyleMap &styleMap = doc->styleMap( styleUrl );
- if( !styleMap.value( QString( "normal" ) ).isEmpty() ) {
- styleUrl = styleMap.value( QString( "normal" ) );
+ const QString normalStyleUrl = styleMap.value(QStringLiteral("normal"));
+ if (!normalStyleUrl.isEmpty()) {
+ styleUrl = normalStyleUrl;
styleUrl.remove(QLatin1Char('#'));
}
// Not calling setStyle here because we don't want
diff --git a/src/lib/marble/osm/OsmTagEditorWidget_p.cpp b/src/lib/marble/osm/OsmTagEditorWidget_p.cpp
index 4cb673d..977a526 100644
--- a/src/lib/marble/osm/OsmTagEditorWidget_p.cpp
+++ b/src/lib/marble/osm/OsmTagEditorWidget_p.cpp
@@ -153,7 +153,7 @@ QStringList OsmTagEditorWidgetPrivate::generateTagFilter() const
bool condition;
QStringList tags, tagsAux;
QString type;
- if (m_placemark->extendedData().value("osmRelation").value().toString() == QLatin1String("yes")) {
+ if (m_placemark->extendedData().value(QStringLiteral("osmRelation")).value().toString() == QLatin1String("yes")) {
type = "Relation";
}
else {
diff --git a/src/lib/marble/routing/RouteRequest.cpp b/src/lib/marble/routing/RouteRequest.cpp
index 31225f5..35df8a8 100644
--- a/src/lib/marble/routing/RouteRequest.cpp
+++ b/src/lib/marble/routing/RouteRequest.cpp
@@ -318,7 +318,7 @@ bool RouteRequest::visited( int index ) const
bool visited = false;
if ( index >= 0 && index < d->m_route.size() ) {
if ( d->m_route[index].extendedData().contains( "routingVisited" ) ) {
- visited = d->m_route[index].extendedData().value( "routingVisited" ).value().toBool();
+ visited = d->m_route[index].extendedData().value(QStringLiteral("routingVisited")).value().toBool();
}
}
return visited;
diff --git a/src/lib/marble/routing/RoutingInputWidget.cpp b/src/lib/marble/routing/RoutingInputWidget.cpp
index 45007e6..1bd3b98 100644
--- a/src/lib/marble/routing/RoutingInputWidget.cpp
+++ b/src/lib/marble/routing/RoutingInputWidget.cpp
@@ -110,11 +110,11 @@ void RoutingInputWidgetPrivate::updateDescription()
GeoDataExtendedData const address = placemark.extendedData();
if ( address.contains( "road" ) && address.contains( "city" ) )
{
- QString const road = address.value( "road" ).value().toString();
- QString const city = address.value( "city" ).value().toString();
+ QString const road = address.value(QStringLiteral("road")).value().toString();
+ QString const city = address.value(QStringLiteral("city")).value().toString();
if ( address.contains( "house_number" ) ) {
- QString const houseNumber = address.value( "house_number" ).value().toString();
+ QString const houseNumber = address.value(QStringLiteral("house_number")).value().toString();
QString const name = QObject::tr("%1 %2, %3", "An address with parameters %1=house number, %2=road, %3=city");
m_lineEdit->setText( name.arg( houseNumber ).arg( road ).arg( city ) );
} else {
diff --git a/src/lib/marble/routing/RoutingManager.cpp b/src/lib/marble/routing/RoutingManager.cpp
index 8151785..b7226fa 100644
--- a/src/lib/marble/routing/RoutingManager.cpp
+++ b/src/lib/marble/routing/RoutingManager.cpp
@@ -409,7 +409,7 @@ void RoutingManagerPrivate::importPlacemark( RouteSegment &outline, QVector<Rout
maneuver.setPosition( lineString->at( 0 ) );
if ( placemark->extendedData().contains( "turnType" ) ) {
- QVariant turnType = placemark->extendedData().value( "turnType" ).value();
+ QVariant turnType = placemark->extendedData().value(QStringLiteral("turnType")).value();
// The enum value is converted to/from an int in the QVariant
// because only a limited set of data types can be serialized with QVariant's
// toString() method (which is used to serialize <ExtendedData>/<Data> values)
@@ -417,7 +417,7 @@ void RoutingManagerPrivate::importPlacemark( RouteSegment &outline, QVector<Rout
}
if ( placemark->extendedData().contains( "roadName" ) ) {
- QVariant roadName = placemark->extendedData().value( "roadName" ).value();
+ QVariant roadName = placemark->extendedData().value(QStringLiteral("roadName")).value();
maneuver.setRoadName( roadName.toString() );
}
diff --git a/src/plugins/runner/monav/MonavConfigWidget.cpp b/src/plugins/runner/monav/MonavConfigWidget.cpp
index 989360d..b1a48d1 100644
--- a/src/plugins/runner/monav/MonavConfigWidget.cpp
+++ b/src/plugins/runner/monav/MonavConfigWidget.cpp
@@ -547,7 +547,7 @@ void MonavConfigWidget::updateProgressBar( qint64 bytesReceived, qint64 bytesTot
bool MonavConfigWidgetPrivate::canExecute( const QString &executable )
{
- QString path = QProcessEnvironment::systemEnvironment().value( "PATH", "/usr/local/bin:/usr/bin:/bin" );
+ QString path = QProcessEnvironment::systemEnvironment().value(QStringLiteral("PATH"), QStringLiteral("/usr/local/bin:/usr/bin:/bin"));
foreach( const QString &dir, path.split( QLatin1Char( ':' ) ) ) {
QFileInfo application( QDir( dir ), executable );
if ( application.exists() ) {
diff --git a/src/plugins/runner/monav/MonavPlugin.cpp b/src/plugins/runner/monav/MonavPlugin.cpp
index e1ec98c..76914b2 100644
--- a/src/plugins/runner/monav/MonavPlugin.cpp
+++ b/src/plugins/runner/monav/MonavPlugin.cpp
@@ -104,7 +104,7 @@ bool MonavPluginPrivate::isDaemonRunning()
bool MonavPluginPrivate::isDaemonInstalled()
{
- QString path = QProcessEnvironment::systemEnvironment().value( "PATH", "/usr/local/bin:/usr/bin:/bin" );
+ QString path = QProcessEnvironment::systemEnvironment().value(QStringLiteral("PATH"), QStringLiteral("/usr/local/bin:/usr/bin:/bin"));
foreach( const QString &application, QStringList() << "monav-daemon" << "MoNavD" ) {
foreach( const QString &dir, path.split( QLatin1Char( ':' ) ) ) {
QFileInfo executable( QDir( dir ), application );