Commit d62df149 authored by Dennis Nienhüser's avatar Dennis Nienhüser

Fix a couple of clazy qstring-arg warnings

parent fdd68588
......@@ -472,9 +472,9 @@ void BookmarkManagerDialogPrivate::importBookmarksRecursively( GeoDataContainer
QString const question = tr( "Do you want to replace the existing bookmark with the imported one?" );
QString html = QLatin1String("<p>%1</p><table><tr><td>%2</td><td><b>%3 / %4</b></td></tr>"
"<tr><td>%5</td><td><b>%6 / %7</b></td></tr></table><p>%8</p>");
html = html.arg( intro ).arg( existingBookmark ).arg( existingFolder->name() );
html = html.arg( existingPlacemark->name() ).arg( newBookmark ).arg( newFolder->name() );
html = html.arg( newPlacemark->name() ).arg( question );
html = html.arg( intro, existingBookmark, existingFolder->name(),
existingPlacemark->name(), newBookmark, newFolder->name(),
newPlacemark->name(), question );
messageBox->setText( html );
QAbstractButton *replaceButton = messageBox->addButton(tr( "Replace" ), QMessageBox::ActionRole );
......
......@@ -307,8 +307,8 @@ void CurrentLocationWidgetPrivate::receiveGpsCoordinates( const GeoDataCoordinat
const QString altitudeString = QString( "%1 %2" ).arg( altitude, 0, 'f', 1, QChar(' ') ).arg( altitudeUnitString );
const QString distanceString = QString( "%1 %2" ).arg( length, 0, 'f', 1, QChar(' ') ).arg( distanceUnitString );
html = html.arg( position.lonToString() ).arg( position.latToString() );
html = html.arg(altitudeString).arg(speedString + QLatin1Char(' ') + unitString);
html = html.arg( position.lonToString(), position.latToString() );
html = html.arg(altitudeString, speedString + QLatin1Char(' ') + unitString);
html = html.arg( distanceString );
m_currentLocationUi.locationLabel->setText( html );
m_currentLocationUi.showTrackCheckBox->setEnabled( true );
......
......@@ -154,7 +154,7 @@ void DownloadQueueSet::retryOrBlacklistJob( HttpJob * job, const int errorCode )
if ( job->tryAgain() ) {
mDebug() << QString( "Download of %1 to %2 failed, but trying again soon" )
.arg( job->sourceUrl().toString() ).arg( job->destinationFileName() );
.arg( job->sourceUrl().toString(), job->destinationFileName() );
m_retryQueue.enqueue( job );
emit jobRetry();
}
......
......@@ -104,7 +104,7 @@ QString MapViewItemDelegate::text( const QModelIndex &index )
{
QString const title = index.data().toString();
QString const description = index.data( Qt::UserRole+2 ).toString();
return QString("<p><b>%1</b></p>%2").arg( title ).arg( description );
return QString("<p><b>%1</b></p>%2").arg( title, description );
}
}
......
......@@ -314,7 +314,7 @@ void MarbleDirs::setMarbleDataPath( const QString& adaptedPath )
{
if ( !QDir::root().exists( adaptedPath ) )
{
qWarning() << QString( "Invalid MarbleDataPath \"%1\". Using \"%2\" instead." ).arg( adaptedPath ).arg( systemPath() );
qWarning() << QString( "Invalid MarbleDataPath \"%1\". Using \"%2\" instead." ).arg( adaptedPath, systemPath() );
return;
}
......@@ -325,7 +325,7 @@ void MarbleDirs::setMarblePluginPath( const QString& adaptedPath )
{
if ( !QDir::root().exists( adaptedPath ) )
{
qWarning() << QString( "Invalid MarblePluginPath \"%1\". Using \"%2\" instead." ).arg( adaptedPath ).arg( pluginSystemPath() );
qWarning() << QString( "Invalid MarblePluginPath \"%1\". Using \"%2\" instead." ).arg( adaptedPath, pluginSystemPath() );
return;
}
......
......@@ -124,7 +124,7 @@ QString RenderState::Private::toString( const RenderState &state, int level ) co
case Marble::Incomplete: status = "Incomplete"; break;
}
QString const name = ( state.name().isEmpty() ? "Anonymous renderer" : state.name() );
QString result = QString("%1%2%3: %4").arg( prefix ).arg( indent ).arg( name ).arg( status );
QString result = QString("%1%2%3: %4").arg( prefix, indent, name, status );
for( const RenderState &child: state.d->m_children ) {
result += toString( child, level+1 );
......
......@@ -72,14 +72,14 @@ const QString RoutingRunner::durationString(const QTime& duration) const
{
const QString hoursString = duration.toString( "hh" );
const QString minutesString = duration.toString( "mm" );
const QString timeString = tr("%1:%2 h","journey duration").arg( hoursString ).arg( minutesString );
const QString timeString = tr("%1:%2 h","journey duration").arg( hoursString, minutesString );
return timeString;
}
const QString RoutingRunner::nameString(const QString& name, qreal length, const QTime& duration) const
{
const QString result = "%1; %2 (%3)";
return result.arg( lengthString( length ) ).arg( durationString( duration ) ).arg( name );
return result.arg( lengthString( length ), durationString( duration ), name );
}
const GeoDataExtendedData RoutingRunner::routeData(qreal length, const QTime& duration) const
......
......@@ -144,10 +144,10 @@ QUrl WmsServerLayout::downloadUrl( const QUrl &prototypeUrl, const Marble::TileI
url.addQueryItem( "layers", m_textureLayer->name() );
url.addQueryItem( "width", QString::number( m_textureLayer->tileSize().width() ) );
url.addQueryItem( "height", QString::number( m_textureLayer->tileSize().height() ) );
url.addQueryItem( "bbox", QString( "%1,%2,%3,%4" ).arg( QString::number( box.west( GeoDataCoordinates::Degree ), 'f', 12 ) )
.arg( QString::number( box.south( GeoDataCoordinates::Degree ), 'f', 12 ) )
.arg( QString::number( box.east( GeoDataCoordinates::Degree ), 'f', 12 ) )
.arg( QString::number( box.north( GeoDataCoordinates::Degree ), 'f', 12 ) ) );
url.addQueryItem( "bbox", QString( "%1,%2,%3,%4" ).arg( QString::number( box.west( GeoDataCoordinates::Degree ), 'f', 12 ),
QString::number( box.south( GeoDataCoordinates::Degree ), 'f', 12 ),
QString::number( box.east( GeoDataCoordinates::Degree ), 'f', 12 ),
QString::number( box.north( GeoDataCoordinates::Degree ), 'f', 12 ) ) );
QUrl finalUrl = prototypeUrl;
finalUrl.setQuery(url);
return finalUrl;
......
......@@ -273,7 +273,7 @@ void TileLoader::triggerDownload( GeoSceneTileDataset const *tileData, TileId co
QUrl const sourceUrl = tileData->downloadUrl( id );
QString const destFileName = tileData->relativeTileFileName( id );
QString const idStr = QString( "%1:%2:%3:%4:%5" ).arg( tileData->nodeType()).arg( tileData->sourceDir() ).arg( id.zoomLevel() ).arg( id.x() ).arg( id.y() );
QString const idStr = QString( "%1:%2:%3:%4:%5" ).arg( tileData->nodeType(), tileData->sourceDir() ).arg( id.zoomLevel() ).arg( id.x() ).arg( id.y() );
emit downloadTile( sourceUrl, destFileName, idStr, usage );
}
......@@ -335,7 +335,7 @@ GeoDataDocument *TileLoader::openVectorFile(const QString &fileName) const
QString error;
GeoDataDocument* document = runner->parseFile(fileName, UserDocument, error);
if (!document && !error.isEmpty()) {
mDebug() << QString("Failed to open vector tile %1: %2").arg(fileName).arg(error);
mDebug() << QString("Failed to open vector tile %1: %2").arg(fileName, error);
}
delete runner;
return document;
......
......@@ -412,7 +412,7 @@ QString GeoDataCoordinates::toString( GeoDataCoordinates::Notation notation, int
QString eastingString = QString::number(GeoDataCoordinatesPrivate::lonLatToEasting(d->m_lon, d->m_lat), 'f', 2);
QString northingString = QString::number(GeoDataCoordinatesPrivate::lonLatToNorthing(d->m_lon, d->m_lat), 'f', 2);
return QString("%1%2 %3 m E, %4 m N").arg(zoneString).arg(bandString).arg(eastingString).arg(northingString);
return QString("%1%2 %3 m E, %4 m N").arg(zoneString, bandString, eastingString, northingString);
}
else{
coordString = lonToString( d->m_lon, notation, Radian, precision )
......
......@@ -235,7 +235,7 @@ void GeoLineStringGraphicsItem::handleRelationUpdate(const QVector<const GeoData
auto const last = std::unique(references.begin(), references.end());
references.erase(last, references.end());
auto const routes = references.join(", ");
namesList << (value.isEmpty() ? routes : QStringLiteral("%1 %2").arg(value).arg(routes));
namesList << (value.isEmpty() ? routes : QStringLiteral("%1 %2").arg(value, routes));
}
auto const allRoutes = namesList.join(QStringLiteral("; "));
if (feature()->name().isEmpty()) {
......
......@@ -116,10 +116,10 @@ void RoutingInputWidgetPrivate::updateDescription()
if (address.contains(QStringLiteral("house_number"))) {
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 ) );
m_lineEdit->setText( name.arg( houseNumber, road, city ) );
} else {
QString const name = QObject::tr("%2, %3", "An address with parameters %1=road, %2=city");
m_lineEdit->setText( name.arg( road ).arg( city ) );
m_lineEdit->setText( name.arg( road, city ) );
}
}
else if ( m_route->name( m_index ).isEmpty() )
......
......@@ -101,7 +101,7 @@ void SpeakersModelPrivate::fillModel()
if ( !exists ) {
SpeakersModelItem item;
QString const path = "%1/audio/speakers/%2";
item.m_file = QFileInfo( path.arg( MarbleDirs::localPath() ).arg( name ) );
item.m_file = QFileInfo( path.arg( MarbleDirs::localPath(), name ) );
item.m_newstuffIndex = i;
m_speakers << item;
}
......
......@@ -109,7 +109,7 @@ QString VoiceNavigationModelPrivate::audioFile( const QString &name ) const
if ( m_speakerEnabled ) {
QString const audioTemplate = "%1/%2.%3";
for( const QString &format: formats ) {
QString const result = audioTemplate.arg( m_speaker ).arg( name ).arg( format );
QString const result = audioTemplate.arg( m_speaker, name, format );
QFileInfo audioFile( result );
if ( audioFile.exists() ) {
return result;
......@@ -119,7 +119,7 @@ QString VoiceNavigationModelPrivate::audioFile( const QString &name ) const
QString const audioTemplate = "audio/%1.%2";
for( const QString &format: formats ) {
QString const result = MarbleDirs::path( audioTemplate.arg( name ).arg( format ) );
QString const result = MarbleDirs::path( audioTemplate.arg( name, format ) );
if ( !result.isEmpty() ) {
return result;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment