diff --git a/python/core/qgsfield.sip b/python/core/qgsfield.sip index ff7a9133581..840087ec9df 100644 --- a/python/core/qgsfield.sip +++ b/python/core/qgsfield.sip @@ -155,7 +155,7 @@ class QgsField if ( !sipRes ) { PyErr_SetString(PyExc_ValueError, - QString( "Value %1 (%2) could not be converted to field type %3." ).arg( a0->toString() ).arg ( a0->typeName() ).arg( sipCpp->type() ).toUtf8().constData() ); + QString( "Value %1 (%2) could not be converted to field type %3." ).arg( a0->toString(), a0->typeName() ).arg( sipCpp->type() ).toUtf8().constData() ); sipError = sipErrorFail; } diff --git a/src/analysis/openstreetmap/qgsosmdatabase.cpp b/src/analysis/openstreetmap/qgsosmdatabase.cpp index ee95131b55f..e6bedcfb614 100644 --- a/src/analysis/openstreetmap/qgsosmdatabase.cpp +++ b/src/analysis/openstreetmap/qgsosmdatabase.cpp @@ -282,7 +282,7 @@ bool QgsOSMDatabase::prepareStatements() { const char* errMsg = sqlite3_errmsg( mDatabase ); // does not require free mError = QString( "Error preparing SQL command:\n%1\nSQL:\n%2" ) - .arg( QString::fromUtf8( errMsg ) ).arg( QString::fromUtf8( sql[i] ) ); + .arg( QString::fromUtf8( errMsg ), QString::fromUtf8( sql[i] ) ); return false; } } @@ -348,8 +348,8 @@ bool QgsOSMDatabase::createSpatialTable( const QString& tableName, const QString } QString sqlAddGeomColumn = QString( "SELECT AddGeometryColumn(%1, 'geometry', 4326, %2, 'XY')" ) - .arg( quotedValue( tableName ) ) - .arg( quotedValue( geometryType ) ); + .arg( quotedValue( tableName ), + quotedValue( geometryType ) ); ret = sqlite3_exec( mDatabase, sqlAddGeomColumn.toUtf8().constData(), NULL, NULL, &errMsg ); if ( ret != SQLITE_OK ) { diff --git a/src/analysis/openstreetmap/qgsosmimport.cpp b/src/analysis/openstreetmap/qgsosmimport.cpp index 1326f06a27e..d4e27c0d603 100644 --- a/src/analysis/openstreetmap/qgsosmimport.cpp +++ b/src/analysis/openstreetmap/qgsosmimport.cpp @@ -169,7 +169,7 @@ bool QgsOSMXmlImport::createDatabase() if ( sqlite3_exec( mDatabase, sqlInitStatements[i], 0, 0, &errMsg ) != SQLITE_OK ) { mError = QString( "Error executing SQL command:\n%1\nSQL:\n%2" ) - .arg( QString::fromUtf8( errMsg ) ).arg( QString::fromUtf8( sqlInitStatements[i] ) ); + .arg( QString::fromUtf8( errMsg ), QString::fromUtf8( sqlInitStatements[i] ) ); sqlite3_free( errMsg ); closeDatabase(); return false; @@ -201,7 +201,7 @@ bool QgsOSMXmlImport::createDatabase() { const char* errMsg = sqlite3_errmsg( mDatabase ); // does not require free mError = QString( "Error preparing SQL command:\n%1\nSQL:\n%2" ) - .arg( QString::fromUtf8( errMsg ) ).arg( QString::fromUtf8( sqlInsertStatements[i] ) ); + .arg( QString::fromUtf8( errMsg ), QString::fromUtf8( sqlInsertStatements[i] ) ); closeDatabase(); return false; } diff --git a/src/analysis/raster/qgsalignraster.cpp b/src/analysis/raster/qgsalignraster.cpp index 28aa090e049..65d03432836 100644 --- a/src/analysis/raster/qgsalignraster.cpp +++ b/src/analysis/raster/qgsalignraster.cpp @@ -272,9 +272,9 @@ bool QgsAlignRaster::checkInputParameters() mErrorMessage = QString( "Failed to get suggested warp output.\n\n" "File:\n%1\n\n" "Source WKT:\n%2\n\nDestination WKT:\n%3" ) - .arg( r.inputFilename ) - .arg( info.mCrsWkt ) - .arg( mCrsWkt ); + .arg( r.inputFilename, + info.mCrsWkt, + mCrsWkt ); return false; } diff --git a/src/app/composer/qgsatlascompositionwidget.cpp b/src/app/composer/qgsatlascompositionwidget.cpp index f8c9fbe59e4..18d66db7c18 100644 --- a/src/app/composer/qgsatlascompositionwidget.cpp +++ b/src/app/composer/qgsatlascompositionwidget.cpp @@ -118,8 +118,8 @@ void QgsAtlasCompositionWidget::on_mAtlasFilenamePatternEdit_editingFinished() QMessageBox::warning( this , tr( "Could not evaluate filename pattern" ) , tr( "Could not set filename pattern as '%1'.\nParser error:\n%2" ) - .arg( mAtlasFilenamePatternEdit->text() ) - .arg( atlasMap->filenamePatternErrorString() ) + .arg( mAtlasFilenamePatternEdit->text(), + atlasMap->filenamePatternErrorString() ) ); } } @@ -149,8 +149,8 @@ void QgsAtlasCompositionWidget::on_mAtlasFilenameExpressionButton_clicked() QMessageBox::warning( this , tr( "Could not evaluate filename pattern" ) , tr( "Could not set filename pattern as '%1'.\nParser error:\n%2" ) - .arg( expression ) - .arg( atlasMap->filenamePatternErrorString() ) + .arg( expression, + atlasMap->filenamePatternErrorString() ) ); } } diff --git a/src/app/gps/qgsgpsinformationwidget.cpp b/src/app/gps/qgsgpsinformationwidget.cpp index c53c2f163d4..f6aa4ae4f5d 100644 --- a/src/app/gps/qgsgpsinformationwidget.cpp +++ b/src/app/gps/qgsgpsinformationwidget.cpp @@ -410,7 +410,7 @@ void QgsGPSInformationWidget::connectGps() } else if ( mRadGpsd->isChecked() ) { - port = QString( "%1:%2:%3" ).arg( mGpsdHost->text() ).arg( mGpsdPort->text() ).arg( mGpsdDevice->text() ); + port = QString( "%1:%2:%3" ).arg( mGpsdHost->text(), mGpsdPort->text(), mGpsdDevice->text() ); } else if ( mRadInternal->isChecked() ) { @@ -847,8 +847,8 @@ void QgsGPSInformationWidget::on_mBtnCloseFeature_clicked() QMessageBox::information( this, tr( "Error" ), tr( "Could not commit changes to layer %1\n\nErrors: %2\n" ) - .arg( vlayer->name() ) - .arg( vlayer->commitErrors().join( "\n " ) ) ); + .arg( vlayer->name(), + vlayer->commitErrors().join( "\n " ) ) ); } vlayer->startEditing(); @@ -977,8 +977,8 @@ void QgsGPSInformationWidget::on_mBtnCloseFeature_clicked() QMessageBox::information( this, tr( "Error" ), tr( "Could not commit changes to layer %1\n\nErrors: %2\n" ) - .arg( vlayer->name() ) - .arg( vlayer->commitErrors().join( "\n " ) ) ); + .arg( vlayer->name(), + vlayer->commitErrors().join( "\n " ) ) ); } vlayer->startEditing(); diff --git a/src/app/main.cpp b/src/app/main.cpp index 19490dbbd01..0c5ff731b69 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -947,7 +947,7 @@ int main( int argc, char *argv[] ) } else { - qWarning( "loading of qgis translation failed [%s]", QString( "%1/qgis_%2" ).arg( i18nPath ).arg( myTranslationCode ).toLocal8Bit().constData() ); + qWarning( "loading of qgis translation failed [%s]", QString( "%1/qgis_%2" ).arg( i18nPath, myTranslationCode ).toLocal8Bit().constData() ); } /* Translation file for Qt. @@ -961,7 +961,7 @@ int main( int argc, char *argv[] ) } else { - qWarning( "loading of qt translation failed [%s]", QString( "%1/qt_%2" ).arg( QLibraryInfo::location( QLibraryInfo::TranslationsPath ) ).arg( myTranslationCode ).toLocal8Bit().constData() ); + qWarning( "loading of qt translation failed [%s]", QString( "%1/qt_%2" ).arg( QLibraryInfo::location( QLibraryInfo::TranslationsPath ), myTranslationCode ).toLocal8Bit().constData() ); } } diff --git a/src/app/ogr/qgsvectorlayersaveasdialog.cpp b/src/app/ogr/qgsvectorlayersaveasdialog.cpp index 66555d0f8f8..62d5f0bb5a9 100644 --- a/src/app/ogr/qgsvectorlayersaveasdialog.cpp +++ b/src/app/ogr/qgsvectorlayersaveasdialog.cpp @@ -343,7 +343,7 @@ QStringList QgsVectorLayerSaveAsDialog::datasourceOptions() const { QComboBox* cb = mDatasourceOptionsGroupBox->findChild( it.key() ); if ( cb && !cb->itemData( cb->currentIndex() ).isNull() ) - options << QString( "%1=%2" ).arg( it.key() ).arg( cb->currentText() ); + options << QString( "%1=%2" ).arg( it.key(), cb->currentText() ); break; } @@ -351,7 +351,7 @@ QStringList QgsVectorLayerSaveAsDialog::datasourceOptions() const { QLineEdit* le = mDatasourceOptionsGroupBox->findChild( it.key() ); if ( le ) - options << QString( "%1=%2" ).arg( it.key() ).arg( le->text() ); + options << QString( "%1=%2" ).arg( it.key(), le->text() ); break; } @@ -359,7 +359,7 @@ QStringList QgsVectorLayerSaveAsDialog::datasourceOptions() const { QgsVectorFileWriter::HiddenOption *opt = dynamic_cast( it.value() ); - options << QString( "%1=%2" ).arg( it.key() ).arg( opt->mValue ); + options << QString( "%1=%2" ).arg( it.key(), opt->mValue ); break; } } @@ -393,14 +393,14 @@ QStringList QgsVectorLayerSaveAsDialog::layerOptions() const case QgsVectorFileWriter::Set: { QComboBox* cb = mLayerOptionsGroupBox->findChild( it.key() ); - options << QString( "%1=%2" ).arg( it.key() ).arg( cb->currentText() ); + options << QString( "%1=%2" ).arg( it.key(), cb->currentText() ); break; } case QgsVectorFileWriter::String: { QLineEdit* le = mLayerOptionsGroupBox->findChild( it.key() ); - options << QString( "%1=%2" ).arg( it.key() ).arg( le->text() ); + options << QString( "%1=%2" ).arg( it.key(), le->text() ); break; } @@ -408,7 +408,7 @@ QStringList QgsVectorLayerSaveAsDialog::layerOptions() const { QgsVectorFileWriter::HiddenOption *opt = dynamic_cast( it.value() ); - options << QString( "%1=%2" ).arg( it.key() ).arg( opt->mValue ); + options << QString( "%1=%2" ).arg( it.key(), opt->mValue ); break; } } diff --git a/src/app/openstreetmap/qgsosmexportdialog.cpp b/src/app/openstreetmap/qgsosmexportdialog.cpp index ffe967a7c63..fda5166c74c 100644 --- a/src/app/openstreetmap/qgsosmexportdialog.cpp +++ b/src/app/openstreetmap/qgsosmexportdialog.cpp @@ -78,7 +78,7 @@ void QgsOSMExportDialog::updateLayerName() layerType = "polylines"; else layerType = "polygons"; - editLayerName->setText( QString( "%1_%2" ).arg( baseName ).arg( layerType ) ); + editLayerName->setText( QString( "%1_%2" ).arg( baseName, layerType ) ); } diff --git a/src/app/pluginmanager/qgspluginmanager.cpp b/src/app/pluginmanager/qgspluginmanager.cpp index c6dc89bd542..8375196f3fd 100644 --- a/src/app/pluginmanager/qgspluginmanager.cpp +++ b/src/app/pluginmanager/qgspluginmanager.cpp @@ -322,7 +322,7 @@ void QgsPluginManager::getCppPluginsMetadata() for ( uint i = 0; i < pluginDir.count(); i++ ) { - QString lib = QString( "%1/%2" ).arg( myPluginDir ).arg( pluginDir[i] ); + QString lib = QString( "%1/%2" ).arg( myPluginDir, pluginDir[i] ); #ifdef TESTLIB // This doesn't work on windows and causes problems with plugins @@ -354,7 +354,7 @@ void QgsPluginManager::getCppPluginsMetadata() bool loaded = myLib->load(); if ( !loaded ) { - QgsDebugMsg( QString( "Failed to load: %1 (%2)" ).arg( myLib->fileName() ).arg( myLib->errorString() ) ); + QgsDebugMsg( QString( "Failed to load: %1 (%2)" ).arg( myLib->fileName(), myLib->errorString() ) ); delete myLib; continue; } @@ -680,15 +680,15 @@ void QgsPluginManager::showPluginDetails( QStandardItem * item ) QString errorMsg; if ( metadata->value( "error" ) == "incompatible" ) { - errorMsg = QString( "%1
%2" ).arg( tr( "This plugin is incompatible with this version of QGIS" ) ).arg( tr( "Plugin designed for QGIS %1", "compatible QGIS version(s)" ).arg( metadata->value( "error_details" ) ) ); + errorMsg = QString( "%1
%2" ).arg( tr( "This plugin is incompatible with this version of QGIS" ), tr( "Plugin designed for QGIS %1", "compatible QGIS version(s)" ).arg( metadata->value( "error_details" ) ) ); } else if ( metadata->value( "error" ) == "dependent" ) { - errorMsg = QString( "%1:
%2" ).arg( tr( "This plugin requires a missing module" ) ).arg( metadata->value( "error_details" ) ); + errorMsg = QString( "%1:
%2" ).arg( tr( "This plugin requires a missing module" ), metadata->value( "error_details" ) ); } else { - errorMsg = QString( "%1
%2" ).arg( tr( "This plugin is broken" ) ).arg( metadata->value( "error_details" ) ); + errorMsg = QString( "%1
%2" ).arg( tr( "This plugin is broken" ), metadata->value( "error_details" ) ); } html += QString( "" " " @@ -780,26 +780,26 @@ void QgsPluginManager::showPluginDetails( QStandardItem * item ) if ( ! metadata->value( "category" ).isEmpty() ) { - html += QString( "%1: %2
" ).arg( tr( "Category" ) ).arg( metadata->value( "category" ) ); + html += QString( "%1: %2
" ).arg( tr( "Category" ), metadata->value( "category" ) ); } if ( ! metadata->value( "tags" ).isEmpty() ) { - html += QString( "%1: %2
" ).arg( tr( "Tags" ) ).arg( metadata->value( "tags" ) ); + html += QString( "%1: %2
" ).arg( tr( "Tags" ), metadata->value( "tags" ) ); } if ( ! metadata->value( "homepage" ).isEmpty() || ! metadata->value( "tracker" ).isEmpty() || ! metadata->value( "code_repository" ).isEmpty() ) { html += QString( "%1: " ).arg( tr( "More info" ) ); if ( ! metadata->value( "homepage" ).isEmpty() ) { - html += QString( "%2   " ).arg( metadata->value( "homepage" ) ).arg( tr( "homepage" ) ); + html += QString( "%2   " ).arg( metadata->value( "homepage" ), tr( "homepage" ) ); } if ( ! metadata->value( "tracker" ).isEmpty() ) { - html += QString( "%2   " ).arg( metadata->value( "tracker" ) ).arg( tr( "tracker" ) ); + html += QString( "%2   " ).arg( metadata->value( "tracker" ), tr( "tracker" ) ); } if ( ! metadata->value( "code_repository" ).isEmpty() ) { - html += QString( "%2" ).arg( metadata->value( "code_repository" ) ).arg( tr( "code_repository" ) ); + html += QString( "%2" ).arg( metadata->value( "code_repository" ), tr( "code_repository" ) ); } html += "
"; } @@ -807,12 +807,12 @@ void QgsPluginManager::showPluginDetails( QStandardItem * item ) if ( ! metadata->value( "author_email" ).isEmpty() ) { - html += QString( "%1: %3" ).arg( tr( "Author" ) ).arg( metadata->value( "author_email" ) ).arg( metadata->value( "author_name" ) ); + html += QString( "%1: %3" ).arg( tr( "Author" ), metadata->value( "author_email" ), metadata->value( "author_name" ) ); html += "

"; } else if ( ! metadata->value( "author_name" ).isEmpty() ) { - html += QString( "%1: %2" ).arg( tr( "Author" ) ).arg( metadata->value( "author_name" ) ); + html += QString( "%1: %2" ).arg( tr( "Author" ), metadata->value( "author_name" ) ); html += "

"; } @@ -820,11 +820,11 @@ void QgsPluginManager::showPluginDetails( QStandardItem * item ) { QString ver = metadata->value( "version_installed" ); if ( ver == "-1" ) ver = "?"; - html += tr( "Installed version: %1 (in %2)
" ).arg( ver ).arg( metadata->value( "library" ) ); + html += tr( "Installed version: %1 (in %2)
" ).arg( ver, metadata->value( "library" ) ); } if ( ! metadata->value( "version_available" ).isEmpty() ) { - html += tr( "Available version: %1 (in %2)
" ).arg( metadata->value( "version_available" ) ).arg( metadata->value( "zip_repository" ) ); + html += tr( "Available version: %1 (in %2)
" ).arg( metadata->value( "version_available" ), metadata->value( "zip_repository" ) ); } if ( ! metadata->value( "changelog" ).isEmpty() ) @@ -1160,8 +1160,8 @@ void QgsPluginManager::on_wvDetails_linkClicked( const QUrl & url ) QString params = url.path(); QString response; QgsPythonRunner::eval( QString( "pyplugin_installer.instance().sendVote('%1', '%2')" ) - .arg( params.split( "/" )[1] ) - .arg( params.split( "/" )[2] ), response ); + .arg( params.split( "/" )[1], + params.split( "/" )[2] ), response ); if ( response == "True" ) { pushMessage( tr( "Vote sent successfully" ), QgsMessageBar::INFO ); @@ -1460,7 +1460,7 @@ void QgsPluginManager::updateWindowTitle() QListWidgetItem *curitem = mOptListWidget->currentItem(); if ( curitem ) { - QString title = QString( "%1 | %2" ).arg( tr( "Plugins" ) ).arg( curitem->text() ); + QString title = QString( "%1 | %2" ).arg( tr( "Plugins" ), curitem->text() ); if ( mOptionsListWidget->currentRow() < mOptionsListWidget->count() - 1 ) { // if it's not the Settings tab, add the plugin count diff --git a/src/app/qgisapp.cpp b/src/app/qgisapp.cpp index 021f28eaef2..2352d59e11b 100644 --- a/src/app/qgisapp.cpp +++ b/src/app/qgisapp.cpp @@ -475,14 +475,14 @@ void QgisApp::validateSrs( QgsCoordinateReferenceSystem &srs ) authid = QgisApp::instance()->mapCanvas()->mapSettings().destinationCrs().authid(); srs.createFromOgcWmsCrs( authid ); QgsDebugMsg( "Layer srs set from project: " + authid ); - messageBar()->pushMessage( tr( "CRS was undefined" ), tr( "defaulting to project CRS %1 - %2" ).arg( authid ).arg( srs.description() ), QgsMessageBar::WARNING, messageTimeout() ); + messageBar()->pushMessage( tr( "CRS was undefined" ), tr( "defaulting to project CRS %1 - %2" ).arg( authid, srs.description() ), QgsMessageBar::WARNING, messageTimeout() ); } else ///Projections/defaultBehaviour==useGlobal { authid = mySettings.value( "/Projections/layerDefaultCrs", GEO_EPSG_CRS_AUTHID ).toString(); srs.createFromOgcWmsCrs( authid ); QgsDebugMsg( "Layer srs set from default: " + authid ); - messageBar()->pushMessage( tr( "CRS was undefined" ), tr( "defaulting to CRS %1 - %2" ).arg( authid ).arg( srs.description() ), QgsMessageBar::WARNING, messageTimeout() ); + messageBar()->pushMessage( tr( "CRS was undefined" ), tr( "defaulting to CRS %1 - %2" ).arg( authid, srs.description() ), QgsMessageBar::WARNING, messageTimeout() ); } } @@ -748,7 +748,7 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent, connect( QgsMapLayerActionRegistry::instance(), SIGNAL( changed() ), this, SLOT( refreshActionFeatureAction() ) ); // set application's caption - QString caption = tr( "QGIS - %1 ('%2')" ).arg( QGis::QGIS_VERSION ).arg( QGis::QGIS_RELEASE_NAME ); + QString caption = tr( "QGIS - %1 ('%2')" ).arg( QGis::QGIS_VERSION, QGis::QGIS_RELEASE_NAME ); setWindowTitle( caption ); QgsMessageLog::logMessage( tr( "QGIS starting..." ), QString::null, QgsMessageLog::INFO ); @@ -2811,7 +2811,7 @@ void QgisApp::updateRecentProjectPaths() Q_FOREACH ( const QgsWelcomePageItemsModel::RecentProjectData& recentProject, mRecentProjects ) { - QAction* action = mRecentProjectsMenu->addAction( QString( "%1 (%2)" ).arg( recentProject.title != recentProject.path ? recentProject.title : QFileInfo( recentProject.path ).baseName() ).arg( recentProject.path ) ); + QAction* action = mRecentProjectsMenu->addAction( QString( "%1 (%2)" ).arg( recentProject.title != recentProject.path ? recentProject.title : QFileInfo( recentProject.path ).baseName(), recentProject.path ) ); action->setEnabled( QFile::exists(( recentProject.path ) ) ); action->setData( recentProject.path ); } @@ -2840,7 +2840,7 @@ void QgisApp::saveRecentProjectPath( const QString& projectPath, bool savePrevie // Generate a unique file name QString fileName( QCryptographicHash::hash(( projectData.path.toUtf8() ), QCryptographicHash::Md5 ).toHex() ); QString previewDir = QString( "%1/previewImages" ).arg( QgsApplication::qgisSettingsDirPath() ); - projectData.previewImagePath = QString( "%1/%2.png" ).arg( previewDir ).arg( fileName ); + projectData.previewImagePath = QString( "%1/%2.png" ).arg( previewDir, fileName ); QDir().mkdir( previewDir ); // Render the map canvas @@ -3281,15 +3281,15 @@ bool QgisApp::askUserForZipItemLayers( QString path ) QgsLayerItem *layerItem = dynamic_cast( item ); if ( layerItem ) { - QgsDebugMsgLevel( QString( "item path=%1 provider=%2" ).arg( item->path() ).arg( layerItem->providerKey() ), 2 ); + QgsDebugMsgLevel( QString( "item path=%1 provider=%2" ).arg( item->path(), layerItem->providerKey() ), 2 ); } if ( layerItem && layerItem->providerKey() == "gdal" ) { - layers << QString( "%1|%2|%3" ).arg( i ).arg( item->name() ).arg( "Raster" ); + layers << QString( "%1|%2|%3" ).arg( i ).arg( item->name(), "Raster" ); } else if ( layerItem && layerItem->providerKey() == "ogr" ) { - layers << QString( "%1|%2|%3" ).arg( i ).arg( item->name() ).arg( tr( "Vector" ) ); + layers << QString( "%1|%2|%3" ).arg( i ).arg( item->name(), tr( "Vector" ) ); } } @@ -3317,7 +3317,7 @@ bool QgisApp::askUserForZipItemLayers( QString path ) if ( !layerItem ) continue; - QgsDebugMsg( QString( "item path=%1 provider=%2" ).arg( item->path() ).arg( layerItem->providerKey() ) ); + QgsDebugMsg( QString( "item path=%1 provider=%2" ).arg( item->path(), layerItem->providerKey() ) ); if ( layerItem->providerKey() == "gdal" ) { if ( addRasterLayer( item->path(), QFileInfo( item->name() ).completeBaseName() ) ) @@ -4382,8 +4382,8 @@ bool QgisApp::fileSave() tr( "The loaded project file on disk was meanwhile changed. Do you want to overwrite the changes?\n" "\nLast modification date on load was: %1" "\nCurrent last modification date is: %2" ) - .arg( mProjectLastModified.toString( Qt::DefaultLocaleLongDate ) ) - .arg( fi.lastModified().toString( Qt::DefaultLocaleLongDate ) ), + .arg( mProjectLastModified.toString( Qt::DefaultLocaleLongDate ), + fi.lastModified().toString( Qt::DefaultLocaleLongDate ) ), QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Cancel ) return false; } @@ -5141,7 +5141,7 @@ void QgisApp::labelingFontNotFound( QgsVectorLayer* vlayer, const QString& fontf // no timeout set, since notice needs attention and is only shown first time layer is labeled QgsMessageBarItem* fontMsg = new QgsMessageBarItem( tr( "Labeling" ), - tr( "Font for layer %1 was not found (%2). %3" ).arg( vlayer->name() ).arg( fontfamily ).arg( substitute ), + tr( "Font for layer %1 was not found (%2). %3" ).arg( vlayer->name(), fontfamily, substitute ), btnOpenPrefs, QgsMessageBar::WARNING, 0, @@ -6686,11 +6686,11 @@ QgsVectorLayer *QgisApp::pasteToNewMemoryVector() Q_FOREACH ( QgsField f, clipboard()->fields().toList() ) { - QgsDebugMsg( QString( "field %1 (%2)" ).arg( f.name() ).arg( QVariant::typeToName( f.type() ) ) ); + QgsDebugMsg( QString( "field %1 (%2)" ).arg( f.name(), QVariant::typeToName( f.type() ) ) ); if ( !layer->addAttribute( f ) ) { QMessageBox::warning( this, tr( "Warning" ), - tr( "Cannot create field %1 (%2,%3)" ).arg( f.name() ).arg( f.typeName() ).arg( QVariant::typeToName( f.type() ) ), + tr( "Cannot create field %1 (%2,%3)" ).arg( f.name(), f.typeName(), QVariant::typeToName( f.type() ) ), QMessageBox::Ok ); delete layer; return 0; @@ -7035,9 +7035,9 @@ void QgisApp::cancelEdits( QgsMapLayer *layer, bool leaveEditable, bool triggerR QMessageBox::information( 0, tr( "Error" ), tr( "Could not %1 changes to layer %2\n\nErrors: %3\n" ) - .arg( leaveEditable ? tr( "rollback" ) : tr( "cancel" ) ) - .arg( vlayer->name() ) - .arg( vlayer->commitErrors().join( "\n " ) ) ); + .arg( leaveEditable ? tr( "rollback" ) : tr( "cancel" ), + vlayer->name(), + vlayer->commitErrors().join( "\n " ) ) ); } mMapCanvas->freeze( false ); @@ -7135,8 +7135,8 @@ bool QgisApp::verifyEditsActionDialog( const QString& act, const QString& upon ) switch ( QMessageBox::information( 0, tr( "Current edits" ), tr( "%1 current changes for %2 layer(s)?" ) - .arg( act ) - .arg( upon ), + .arg( act, + upon ), QMessageBox::Cancel | QMessageBox::Ok ) ) { case QMessageBox::Ok: @@ -7509,8 +7509,8 @@ void QgisApp::duplicateLayers( const QList& lyrList ) msgBars.append( new QgsMessageBarItem( tr( "Duplicate layer: " ), tr( "%1 (%2 type unsupported)" ) - .arg( selectedLyr->name() ) - .arg( !unSppType.isEmpty() ? QString( "'" ) + unSppType + "' " : "" ), + .arg( selectedLyr->name(), + !unSppType.isEmpty() ? QString( "'" ) + unSppType + "' " : "" ), QgsMessageBar::WARNING, 0, mInfoBar ) ); @@ -7810,7 +7810,7 @@ void QgisApp::loadPythonSupport() pythonlibName.prepend( "lib" ); #endif QString version = QString( "%1.%2.%3" ).arg( QGis::QGIS_VERSION_INT / 10000 ).arg( QGis::QGIS_VERSION_INT / 100 % 100 ).arg( QGis::QGIS_VERSION_INT % 100 ); - QgsDebugMsg( QString( "load library %1 (%2)" ).arg( pythonlibName ).arg( version ) ); + QgsDebugMsg( QString( "load library %1 (%2)" ).arg( pythonlibName, version ) ); QLibrary pythonlib( pythonlibName, version ); // It's necessary to set these two load hints, otherwise Python library won't work correctly // see http://lists.kde.org/?l=pykde&m=117190116820758&w=2 @@ -10232,11 +10232,11 @@ void QgisApp::oldProjectVersionWarning( const QString& oldVersion ) "

To remove this warning when opening an older project file, " "uncheck the box '%5' in the %4 menu." "

Version of the project file: %1
Current version of QGIS: %2" ) - .arg( oldVersion ) - .arg( QGis::QGIS_VERSION ) - .arg( "http://hub.qgis.org/projects/quantum-gis " ) - .arg( tr( "Settings:Options:General", "Menu path to setting options" ) ) - .arg( tr( "Warn me when opening a project file saved with an older version of QGIS" ) ); + .arg( oldVersion, + QGis::QGIS_VERSION, + "http://hub.qgis.org/projects/quantum-gis ", + tr( "Settings:Options:General", "Menu path to setting options" ), + tr( "Warn me when opening a project file saved with an older version of QGIS" ) ); QString title = tr( "Project file is older" ); #ifdef ANDROID @@ -10478,7 +10478,7 @@ void QgisApp::namAuthenticationRequired( QNetworkReply *reply, QAuthenticator *a for ( ;; ) { bool ok = QgsCredentials::instance()->get( - QString( "%1 at %2" ).arg( auth->realm() ).arg( reply->url().host() ), + QString( "%1 at %2" ).arg( auth->realm(), reply->url().host() ), username, password, tr( "Authentication required" ) ); if ( !ok ) @@ -10492,13 +10492,13 @@ void QgisApp::namAuthenticationRequired( QNetworkReply *reply, QAuthenticator *a // credentials didn't change - stored ones probably wrong? clear password and retry QgsCredentials::instance()->put( - QString( "%1 at %2" ).arg( auth->realm() ).arg( reply->url().host() ), + QString( "%1 at %2" ).arg( auth->realm(), reply->url().host() ), username, QString::null ); } // save credentials QgsCredentials::instance()->put( - QString( "%1 at %2" ).arg( auth->realm() ).arg( reply->url().host() ), + QString( "%1 at %2" ).arg( auth->realm(), reply->url().host() ), username, password ); } @@ -10571,7 +10571,7 @@ void QgisApp::namSslErrors( QNetworkReply *reply, const QList &errors .arg( reply->url().port() != -1 ? reply->url().port() : 443 ) .trimmed() ); QString digest( QgsAuthCertUtils::shaHexForCert( reply->sslConfiguration().peerCertificate() ) ); - QString dgsthostport( QString( "%1:%2" ).arg( digest ).arg( hostport ) ); + QString dgsthostport( QString( "%1:%2" ).arg( digest, hostport ) ); const QHash > &errscache( QgsAuthManager::instance()->getIgnoredSslErrorCache() ); @@ -10602,8 +10602,8 @@ void QgisApp::namSslErrors( QNetworkReply *reply, const QList &errors } QgsDebugMsg( QString( "Errors %1 for cached item for %2" ) - .arg( errenums.isEmpty() ? "not found" : "did not match" ) - .arg( hostport ) ); + .arg( errenums.isEmpty() ? "not found" : "did not match", + hostport ) ); } diff --git a/src/app/qgisappstylesheet.cpp b/src/app/qgisappstylesheet.cpp index cb7ed3ccbd5..2c4295182fb 100644 --- a/src/app/qgisappstylesheet.cpp +++ b/src/app/qgisappstylesheet.cpp @@ -110,7 +110,7 @@ void QgisAppStyleSheet::buildStyleSheet( const QMap& opts ) QgsDebugMsg( QString( "fontFamily: %1" ).arg( fontFamily ) ); if ( fontFamily.isEmpty() ) { return; } - ss += QString( "* { font: %1pt \"%2\"} " ).arg( fontSize ).arg( fontFamily ); + ss += QString( "* { font: %1pt \"%2\"} " ).arg( fontSize, fontFamily ); // QGroupBox and QgsCollapsibleGroupBox, mostly for Ubuntu and Mac bool gbxCustom = opts.value( "groupBoxCustom" ).toBool(); @@ -172,8 +172,8 @@ void QgisAppStyleSheet::buildStyleSheet( const QMap& opts ) "selection-background-color: %1;" "selection-color: %2;" "}" ) - .arg( palette.highlight().color().name() ) - .arg( palette.highlightedText().color().name() ); + .arg( palette.highlight().color().name(), + palette.highlightedText().color().name() ); QgsDebugMsg( QString( "Stylesheet built: %1" ).arg( ss ) ); diff --git a/src/app/qgsapplayertreeviewmenuprovider.cpp b/src/app/qgsapplayertreeviewmenuprovider.cpp index 9a9aea290ac..68b76c2ce15 100644 --- a/src/app/qgsapplayertreeviewmenuprovider.cpp +++ b/src/app/qgsapplayertreeviewmenuprovider.cpp @@ -266,7 +266,7 @@ QList< LegendLayerAction > QgsAppLayerTreeViewMenuProvider::legendLayerActions( Q_FOREACH ( const LegendLayerAction& lyrAction, mLegendLayerActionMap[ type ] ) { Q_UNUSED( lyrAction ); - QgsDebugMsg( QString( "%1/%2 - %3 layers" ).arg( lyrAction.menu ).arg( lyrAction.action->text() ).arg( lyrAction.layers.count() ) ); + QgsDebugMsg( QString( "%1/%2 - %3 layers" ).arg( lyrAction.menu, lyrAction.action->text() ).arg( lyrAction.layers.count() ) ); } } #endif diff --git a/src/app/qgsattributetabledialog.cpp b/src/app/qgsattributetabledialog.cpp index 0b98aa7a6e7..415a55faeab 100644 --- a/src/app/qgsattributetabledialog.cpp +++ b/src/app/qgsattributetabledialog.cpp @@ -693,7 +693,7 @@ void QgsAttributeTableDialog::on_mAddAttribute_clicked() else { mLayer->destroyEditCommand(); - QMessageBox::critical( this, tr( "Failed to add field" ), tr( "Failed to add field '%1' of type '%2'. Is the field name unique?" ).arg( dialog.field().name() ).arg( dialog.field().typeName() ) ); + QMessageBox::critical( this, tr( "Failed to add field" ), tr( "Failed to add field '%1' of type '%2'. Is the field name unique?" ).arg( dialog.field().name(), dialog.field().typeName() ) ); } diff --git a/src/app/qgsattributetypedialog.cpp b/src/app/qgsattributetypedialog.cpp index f963cd1c6a4..31267879aea 100644 --- a/src/app/qgsattributetypedialog.cpp +++ b/src/app/qgsattributetypedialog.cpp @@ -43,7 +43,7 @@ QgsAttributeTypeDialog::QgsAttributeTypeDialog( QgsVectorLayer *vl, int fieldIdx , mFieldIdx( fieldIdx ) { setupUi( this ); - setWindowTitle( tr( "Edit Widget Properties - %1 (%2)" ).arg( vl->fields()[fieldIdx].name() ).arg( vl->name() ) ); + setWindowTitle( tr( "Edit Widget Properties - %1 (%2)" ).arg( vl->fields()[fieldIdx].name(), vl->name() ) ); connect( selectionListWidget, SIGNAL( currentRowChanged( int ) ), this, SLOT( setStackPage( int ) ) ); diff --git a/src/app/qgsbookmarks.cpp b/src/app/qgsbookmarks.cpp index 9da304cab8b..b1d7b84f79f 100644 --- a/src/app/qgsbookmarks.cpp +++ b/src/app/qgsbookmarks.cpp @@ -67,9 +67,9 @@ QgsBookmarks::QgsBookmarks( QWidget *parent ) : QDockWidget( parent ) { QMessageBox::warning( this, tr( "Error" ), tr( "Unable to open bookmarks database.\nDatabase: %1\nDriver: %2\nDatabase: %3" ) - .arg( QgsApplication::qgisUserDbFilePath() ) - .arg( db.lastError().driverText() ) - .arg( db.lastError().databaseText() ) + .arg( QgsApplication::qgisUserDbFilePath(), + db.lastError().driverText(), + db.lastError().databaseText() ) ); deleteLater(); return; @@ -163,8 +163,8 @@ void QgsBookmarks::addClicked() else { QMessageBox::warning( this, tr( "Error" ), tr( "Unable to create the bookmark.\nDriver:%1\nDatabase:%2" ) - .arg( query.lastError().driverText() ) - .arg( query.lastError().databaseText() ) ); + .arg( query.lastError().driverText(), + query.lastError().databaseText() ) ); } } @@ -302,8 +302,8 @@ void QgsBookmarks::importFromXML() if ( !query.exec( queryTxt ) ) { QMessageBox::warning( this, tr( "Error" ), tr( "Unable to create the bookmark.\nDriver: %1\nDatabase: %2" ) - .arg( query.lastError().driverText() ) - .arg( query.lastError().databaseText() ) ); + .arg( query.lastError().driverText(), + query.lastError().databaseText() ) ); } query.finish(); } diff --git a/src/app/qgsbrowserdockwidget.cpp b/src/app/qgsbrowserdockwidget.cpp index 967057f28a3..9643c36e2d7 100644 --- a/src/app/qgsbrowserdockwidget.cpp +++ b/src/app/qgsbrowserdockwidget.cpp @@ -130,7 +130,7 @@ class QgsBrowserTreeFilterProxyModel : public QSortFilterProxyModel void updateFilter() { - QgsDebugMsg( QString( "filter = %1 syntax = %2" ).arg( mFilter ).arg( mPatternSyntax ) ); + QgsDebugMsg( QString( "filter = %1 syntax = %2" ).arg( mFilter, mPatternSyntax ) ); mREList.clear(); if ( mPatternSyntax == "normal" ) { @@ -176,7 +176,7 @@ class QgsBrowserTreeFilterProxyModel : public QSortFilterProxyModel { Q_FOREACH ( const QRegExp& rx, mREList ) { - QgsDebugMsg( QString( "value: [%1] rx: [%2] match: %3" ).arg( value ).arg( rx.pattern() ).arg( rx.exactMatch( value ) ) ); + QgsDebugMsg( QString( "value: [%1] rx: [%2] match: %3" ).arg( value, rx.pattern() ).arg( rx.exactMatch( value ) ) ); if ( rx.exactMatch( value ) ) return true; } @@ -185,7 +185,7 @@ class QgsBrowserTreeFilterProxyModel : public QSortFilterProxyModel { Q_FOREACH ( const QRegExp& rx, mREList ) { - QgsDebugMsg( QString( "value: [%1] rx: [%2] match: %3" ).arg( value ).arg( rx.pattern() ).arg( rx.indexIn( value ) ) ); + QgsDebugMsg( QString( "value: [%1] rx: [%2] match: %3" ).arg( value, rx.pattern() ).arg( rx.indexIn( value ) ) ); if ( rx.indexIn( value ) != -1 ) return true; } diff --git a/src/app/qgsconfigureshortcutsdialog.cpp b/src/app/qgsconfigureshortcutsdialog.cpp index 3471c3d513b..27e0431c0ec 100644 --- a/src/app/qgsconfigureshortcutsdialog.cpp +++ b/src/app/qgsconfigureshortcutsdialog.cpp @@ -115,8 +115,8 @@ void QgsConfigureShortcutsDialog::saveShortcuts() { QMessageBox::warning( this, tr( "Saving shortcuts" ), tr( "Cannot write file %1:\n%2." ) - .arg( fileName ) - .arg( file.errorString() ) ); + .arg( fileName, + file.errorString() ) ); return; } @@ -163,8 +163,8 @@ void QgsConfigureShortcutsDialog::loadShortcuts() { QMessageBox::warning( this, tr( "Loading shortcuts" ), tr( "Cannot read file %1:\n%2." ) - .arg( fileName ) - .arg( file.errorString() ) ); + .arg( fileName, + file.errorString() ) ); return; } diff --git a/src/app/qgscustomization.cpp b/src/app/qgscustomization.cpp index 2ba5f674ffd..9e8e28ac358 100644 --- a/src/app/qgscustomization.cpp +++ b/src/app/qgscustomization.cpp @@ -808,7 +808,7 @@ void QgsCustomization::customizeWidget( QWidget * widget, QEvent * event, QSetti QgsDebugMsg( QString( "objectName = %1 event type = %2" ).arg( widget->objectName() ).arg( event->type() ) ); - QgsDebugMsg( QString( "%1 x %2" ).arg( widget->metaObject()->className() ).arg( QDialog::staticMetaObject.className() ) ); + QgsDebugMsg( QString( "%1 x %2" ).arg( widget->metaObject()->className(), QDialog::staticMetaObject.className() ) ); QString path = "/Customization/Widgets/"; QgsCustomization::customizeWidget( path, widget, settings ); diff --git a/src/app/qgscustomprojectiondialog.cpp b/src/app/qgscustomprojectiondialog.cpp index 056b56b713b..35cc953a830 100644 --- a/src/app/qgscustomprojectiondialog.cpp +++ b/src/app/qgscustomprojectiondialog.cpp @@ -155,7 +155,7 @@ bool QgsCustomProjectionDialog::deleteCRS( const QString& id ) myResult = sqlite3_open( QgsApplication::qgisUserDbFilePath().toUtf8(), &myDatabase ); if ( myResult != SQLITE_OK ) { - QgsDebugMsg( QString( "Can't open database: %1 \n please notify QGIS developers of this error \n %2 (file name) " ).arg( sqlite3_errmsg( myDatabase ) ).arg( QgsApplication::qgisUserDbFilePath() ) ); + QgsDebugMsg( QString( "Can't open database: %1 \n please notify QGIS developers of this error \n %2 (file name) " ).arg( sqlite3_errmsg( myDatabase ), QgsApplication::qgisUserDbFilePath() ) ); // XXX This will likely never happen since on open, sqlite creates the // database if it does not exist. Q_ASSERT( myResult == SQLITE_OK ); @@ -164,7 +164,7 @@ bool QgsCustomProjectionDialog::deleteCRS( const QString& id ) // XXX Need to free memory from the error msg if one is set if ( myResult != SQLITE_OK || sqlite3_step( myPreparedStatement ) != SQLITE_DONE ) { - QgsDebugMsg( QString( "failed to remove CRS from database in custom projection dialog: %1 [%2]" ).arg( mySql ).arg( sqlite3_errmsg( myDatabase ) ) ); + QgsDebugMsg( QString( "failed to remove CRS from database in custom projection dialog: %1 [%2]" ).arg( mySql, sqlite3_errmsg( myDatabase ) ) ); } sqlite3_close( myDatabase ); @@ -184,7 +184,7 @@ void QgsCustomProjectionDialog::insertProjection( const QString& myProjectionAc int myResult = sqlite3_open( QgsApplication::qgisUserDbFilePath().toUtf8(), &myDatabase ); if ( myResult != SQLITE_OK ) { - QgsDebugMsg( QString( "Can't open database: %1 \n please notify QGIS developers of this error \n %2 (file name) " ).arg( sqlite3_errmsg( myDatabase ) ).arg( QgsApplication::qgisUserDbFilePath() ) ); + QgsDebugMsg( QString( "Can't open database: %1 \n please notify QGIS developers of this error \n %2 (file name) " ).arg( sqlite3_errmsg( myDatabase ), QgsApplication::qgisUserDbFilePath() ) ); // XXX This will likely never happen since on open, sqlite creates the // database if it does not exist. Q_ASSERT( myResult == SQLITE_OK ); @@ -192,7 +192,7 @@ void QgsCustomProjectionDialog::insertProjection( const QString& myProjectionAc int srsResult = sqlite3_open( QgsApplication::srsDbFilePath().toUtf8(), &srsDatabase ); if ( myResult != SQLITE_OK ) { - QgsDebugMsg( QString( "Can't open database %1 [%2]" ).arg( QgsApplication::srsDbFilePath() ).arg( sqlite3_errmsg( srsDatabase ) ) ); + QgsDebugMsg( QString( "Can't open database %1 [%2]" ).arg( QgsApplication::srsDbFilePath(), sqlite3_errmsg( srsDatabase ) ) ); } else { @@ -219,7 +219,7 @@ void QgsCustomProjectionDialog::insertProjection( const QString& myProjectionAc myResult = sqlite3_prepare( myDatabase, mySql.toUtf8(), mySql.length(), &myPreparedStatement, &myTail ); if ( myResult != SQLITE_OK || sqlite3_step( myPreparedStatement ) != SQLITE_DONE ) { - QgsDebugMsg( QString( "Update or insert failed in custom projection dialog: %1 [%2]" ).arg( mySql ).arg( sqlite3_errmsg( myDatabase ) ) ); + QgsDebugMsg( QString( "Update or insert failed in custom projection dialog: %1 [%2]" ).arg( mySql, sqlite3_errmsg( myDatabase ) ) ); } sqlite3_finalize( myPreparedStatement ); @@ -229,7 +229,7 @@ void QgsCustomProjectionDialog::insertProjection( const QString& myProjectionAc } else { - QgsDebugMsg( QString( "prepare failed: %1 [%2]" ).arg( srsSql ).arg( sqlite3_errmsg( srsDatabase ) ) ); + QgsDebugMsg( QString( "prepare failed: %1 [%2]" ).arg( srsSql, sqlite3_errmsg( srsDatabase ) ) ); } sqlite3_close( srsDatabase ); @@ -244,7 +244,7 @@ bool QgsCustomProjectionDialog::saveCRS( QgsCoordinateReferenceSystem myCRS, con int return_id; QString myProjectionAcronym = myCRS.projectionAcronym(); QString myEllipsoidAcronym = myCRS.ellipsoidAcronym(); - QgsDebugMsg( QString( "Saving a CRS:%1, %2, %3" ).arg( myName ).arg( myCRS.toProj4() ).arg( newEntry ) ); + QgsDebugMsg( QString( "Saving a CRS:%1, %2, %3" ).arg( myName, myCRS.toProj4() ).arg( newEntry ) ); if ( newEntry ) { return_id = myCRS.saveAsUserCRS( myName ); @@ -272,7 +272,7 @@ bool QgsCustomProjectionDialog::saveCRS( QgsCoordinateReferenceSystem myCRS, con myResult = sqlite3_open( QgsApplication::qgisUserDbFilePath().toUtf8(), &myDatabase ); if ( myResult != SQLITE_OK ) { - QgsDebugMsg( QString( "Can't open database: %1 \n please notify QGIS developers of this error \n %2 (file name) " ).arg( sqlite3_errmsg( myDatabase ) ).arg( QgsApplication::qgisUserDbFilePath() ) ); + QgsDebugMsg( QString( "Can't open database: %1 \n please notify QGIS developers of this error \n %2 (file name) " ).arg( sqlite3_errmsg( myDatabase ), QgsApplication::qgisUserDbFilePath() ) ); // XXX This will likely never happen since on open, sqlite creates the // database if it does not exist. Q_ASSERT( myResult == SQLITE_OK ); @@ -281,7 +281,7 @@ bool QgsCustomProjectionDialog::saveCRS( QgsCoordinateReferenceSystem myCRS, con // XXX Need to free memory from the error msg if one is set if ( myResult != SQLITE_OK || sqlite3_step( myPreparedStatement ) != SQLITE_DONE ) { - QgsDebugMsg( QString( "failed to write to database in custom projection dialog: %1 [%2]" ).arg( mySql ).arg( sqlite3_errmsg( myDatabase ) ) ); + QgsDebugMsg( QString( "failed to write to database in custom projection dialog: %1 [%2]" ).arg( mySql, sqlite3_errmsg( myDatabase ) ) ); } sqlite3_finalize( myPreparedStatement ); diff --git a/src/app/qgsdecorationitem.cpp b/src/app/qgsdecorationitem.cpp index 606fd434b9f..cad74654de5 100644 --- a/src/app/qgsdecorationitem.cpp +++ b/src/app/qgsdecorationitem.cpp @@ -76,5 +76,5 @@ void QgsDecorationItem::setName( const char *name ) mNameConfig = name; mNameConfig.remove( " " ); mNameTranslated = tr( name ); - QgsDebugMsg( QString( "name=%1 nameconfig=%2 nametrans=%3" ).arg( mName ).arg( mNameConfig ).arg( mNameTranslated ) ); + QgsDebugMsg( QString( "name=%1 nameconfig=%2 nametrans=%3" ).arg( mName, mNameConfig, mNameTranslated ) ); } diff --git a/src/app/qgsfieldsproperties.cpp b/src/app/qgsfieldsproperties.cpp index 2c7092493d6..bea9b01bec5 100644 --- a/src/app/qgsfieldsproperties.cpp +++ b/src/app/qgsfieldsproperties.cpp @@ -513,7 +513,7 @@ bool QgsFieldsProperties::addAttribute( const QgsField &field ) else { mLayer->destroyEditCommand(); - QMessageBox::critical( this, tr( "Failed to add field" ), tr( "Failed to add field '%1' of type '%2'. Is the field name unique?" ).arg( field.name() ).arg( field.typeName() ) ); + QMessageBox::critical( this, tr( "Failed to add field" ), tr( "Failed to add field '%1' of type '%2'. Is the field name unique?" ).arg( field.name(), field.typeName() ) ); return false; } } diff --git a/src/app/qgshandlebadlayers.cpp b/src/app/qgshandlebadlayers.cpp index af75f0fc5e0..71665e6a050 100644 --- a/src/app/qgshandlebadlayers.cpp +++ b/src/app/qgshandlebadlayers.cpp @@ -103,10 +103,10 @@ QgsHandleBadLayers::QgsHandleBadLayers( const QList &layers, const QDo bool providerFileBased = ( QgsProviderRegistry::instance()->providerCapabilities( provider ) & QgsDataProvider::File ) != 0; QgsDebugMsg( QString( "name=%1 type=%2 provider=%3 datasource='%4'" ) - .arg( name ) - .arg( type ) - .arg( vectorProvider ) - .arg( datasource ) ); + .arg( name, + type, + vectorProvider, + datasource ) ); mLayerList->setRowCount( j + 1 ); diff --git a/src/app/qgsidentifyresultsdialog.cpp b/src/app/qgsidentifyresultsdialog.cpp index 73bed8ece96..3f0e50df3be 100644 --- a/src/app/qgsidentifyresultsdialog.cpp +++ b/src/app/qgsidentifyresultsdialog.cpp @@ -518,7 +518,7 @@ void QgsIdentifyResultsDialog::addFeature( QgsVectorLayer *vlayer, const QgsFeat tblResults->setRowCount( j + 1 ); - QgsDebugMsg( QString( "adding item #%1 / %2 / %3 / %4" ).arg( j ).arg( vlayer->name() ).arg( vlayer->attributeDisplayName( i ) ).arg( value2 ) ); + QgsDebugMsg( QString( "adding item #%1 / %2 / %3 / %4" ).arg( j ).arg( vlayer->name(), vlayer->attributeDisplayName( i ), value2 ) ); QTableWidgetItem *item = new QTableWidgetItem( vlayer->name() ); item->setData( Qt::UserRole, QVariant::fromValue( qobject_cast( vlayer ) ) ); @@ -784,7 +784,7 @@ void QgsIdentifyResultsDialog::addFeature( QgsRasterLayer *layer, for ( QMap::const_iterator it = attributes.begin(); it != attributes.end(); ++it ) { - QgsDebugMsg( QString( "adding item #%1 / %2 / %3 / %4" ).arg( j ).arg( layer->name() ).arg( it.key() ).arg( it.value() ) ); + QgsDebugMsg( QString( "adding item #%1 / %2 / %3 / %4" ).arg( j ).arg( layer->name(), it.key(), it.value() ) ); QTableWidgetItem *item = new QTableWidgetItem( layer->name() ); item->setData( Qt::UserRole, QVariant::fromValue( qobject_cast( layer ) ) ); item->setData( Qt::UserRole + 1, layer->id() ); @@ -1696,7 +1696,7 @@ void QgsIdentifyResultsDialog::copyFeatureAttributes() if ( attrIdx < 0 || attrIdx >= fields.count() ) continue; - text += QString( "%1: %2\n" ).arg( fields[attrIdx].name() ).arg( it.value().toString() ); + text += QString( "%1: %2\n" ).arg( fields[attrIdx].name(), it.value().toString() ); } } else if ( rlayer ) @@ -1710,7 +1710,7 @@ void QgsIdentifyResultsDialog::copyFeatureAttributes() QTreeWidgetItem *item = featItem->child( i ); if ( item->childCount() > 0 ) continue; - text += QString( "%1: %2\n" ).arg( item->data( 0, Qt::DisplayRole ).toString() ).arg( item->data( 1, Qt::DisplayRole ).toString() ); + text += QString( "%1: %2\n" ).arg( item->data( 0, Qt::DisplayRole ).toString(), item->data( 1, Qt::DisplayRole ).toString() ); } } diff --git a/src/app/qgsmeasuredialog.cpp b/src/app/qgsmeasuredialog.cpp index 15eb4a4edc7..9826295d0d2 100644 --- a/src/app/qgsmeasuredialog.cpp +++ b/src/app/qgsmeasuredialog.cpp @@ -280,7 +280,7 @@ void QgsMeasureDialog::updateUi() if (( mCanvasUnits == QGis::Meters && mDisplayUnits == QGis::Feet ) || ( mCanvasUnits == QGis::Feet && mDisplayUnits == QGis::Meters ) ) { - toolTip += "
* " + tr( "Finally, the value is converted from %1 to %2." ).arg( QGis::tr( mCanvasUnits ) ).arg( QGis::tr( mDisplayUnits ) ); + toolTip += "
* " + tr( "Finally, the value is converted from %1 to %2." ).arg( QGis::tr( mCanvasUnits ), QGis::tr( mDisplayUnits ) ); } editTotal->setToolTip( toolTip ); diff --git a/src/app/qgsnewspatialitelayerdialog.cpp b/src/app/qgsnewspatialitelayerdialog.cpp index 339f22efe54..84094d86556 100644 --- a/src/app/qgsnewspatialitelayerdialog.cpp +++ b/src/app/qgsnewspatialitelayerdialog.cpp @@ -353,7 +353,7 @@ bool QgsNewSpatialiteLayerDialog::apply() QTreeWidgetItemIterator it( mAttributeView ); while ( *it ) { - sql += delim + QString( "%1 %2" ).arg( quotedIdentifier(( *it )->text( 0 ) ) ).arg(( *it )->text( 1 ) ); + sql += delim + QString( "%1 %2" ).arg( quotedIdentifier(( *it )->text( 0 ) ), ( *it )->text( 1 ) ); delim = ","; @@ -368,15 +368,15 @@ bool QgsNewSpatialiteLayerDialog::apply() QgsDebugMsg( sql ); // OK QString sqlAddGeom = QString( "select AddGeometryColumn(%1,%2,%3,%4,2)" ) - .arg( quotedValue( leLayerName->text() ) ) - .arg( quotedValue( leGeometryColumn->text() ) ) + .arg( quotedValue( leLayerName->text() ), + quotedValue( leGeometryColumn->text() ) ) .arg( mCrsId.split( ':' ).value( 1, "0" ).toInt() ) .arg( quotedValue( selectedType() ) ); QgsDebugMsg( sqlAddGeom ); // OK QString sqlCreateIndex = QString( "select CreateSpatialIndex(%1,%2)" ) - .arg( quotedValue( leLayerName->text() ) ) - .arg( quotedValue( leGeometryColumn->text() ) ); + .arg( quotedValue( leLayerName->text() ), + quotedValue( leGeometryColumn->text() ) ); QgsDebugMsg( sqlCreateIndex ); // OK sqlite3 *db; @@ -395,7 +395,7 @@ bool QgsNewSpatialiteLayerDialog::apply() { QMessageBox::warning( this, tr( "Error Creating SpatiaLite Table" ), - tr( "Failed to create the SpatiaLite table %1. The database returned:\n%2" ).arg( leLayerName->text() ).arg( errmsg ) ); + tr( "Failed to create the SpatiaLite table %1. The database returned:\n%2" ).arg( leLayerName->text(), errmsg ) ); sqlite3_free( errmsg ); } else @@ -422,9 +422,9 @@ bool QgsNewSpatialiteLayerDialog::apply() } QgsVectorLayer *layer = new QgsVectorLayer( QString( "dbname='%1' table='%2'(%3) sql=" ) - .arg( mDatabaseComboBox->currentText() ) - .arg( leLayerName->text() ) - .arg( leGeometryColumn->text() ), leLayerName->text(), "spatialite" ); + .arg( mDatabaseComboBox->currentText(), + leLayerName->text(), + leGeometryColumn->text() ), leLayerName->text(), "spatialite" ); if ( layer->isValid() ) { // register this layer with the central layers registry diff --git a/src/app/qgsoptions.cpp b/src/app/qgsoptions.cpp index b2902d2cfdd..7ce7cb9680a 100644 --- a/src/app/qgsoptions.cpp +++ b/src/app/qgsoptions.cpp @@ -1748,7 +1748,7 @@ void QgsOptions::loadGdalDriverList() pszVirtualIO = "v"; else pszVirtualIO = ""; - myDriversFlags[myGdalDriverDescription] = QString( "%1%2" ).arg( pszRWFlag ).arg( pszVirtualIO ); + myDriversFlags[myGdalDriverDescription] = QString( "%1%2" ).arg( pszRWFlag, pszVirtualIO ); // get driver extensions and long name // the gdal provider can override/add extensions but there is no interface to query this diff --git a/src/app/qgspluginregistry.cpp b/src/app/qgspluginregistry.cpp index fe5482077a9..a0d54e20a19 100644 --- a/src/app/qgspluginregistry.cpp +++ b/src/app/qgspluginregistry.cpp @@ -130,9 +130,9 @@ void QgsPluginRegistry::dump() ++it ) { QgsDebugMsg( QString( "PLUGIN: %1 -> (%2, %3)" ) - .arg( it.key() ) - .arg( it->name() ) - .arg( it->library() ) ); + .arg( it.key(), + it->name(), + it->library() ) ); } if ( mPythonUtils && mPythonUtils->isEnabled() ) @@ -291,7 +291,7 @@ void QgsPluginRegistry::loadPythonPlugin( const QString& packageName ) // add to settings settings.setValue( "/PythonPlugins/" + packageName, true ); - QgsMessageLog::logMessage( QObject::tr( "Loaded %1 (package: %2)" ).arg( pluginName ).arg( packageName ), QObject::tr( "Plugins" ), QgsMessageLog::INFO ); + QgsMessageLog::logMessage( QObject::tr( "Loaded %1 (package: %2)" ).arg( pluginName, packageName ), QObject::tr( "Plugins" ), QgsMessageLog::INFO ); } } @@ -318,7 +318,7 @@ void QgsPluginRegistry::loadCppPlugin( const QString& theFullPathName ) bool loaded = myLib.load(); if ( !loaded ) { - QgsMessageLog::logMessage( QObject::tr( "Failed to load %1 (Reason: %2)" ).arg( myLib.fileName() ).arg( myLib.errorString() ), QObject::tr( "Plugins" ) ); + QgsMessageLog::logMessage( QObject::tr( "Failed to load %1 (Reason: %2)" ).arg( myLib.fileName(), myLib.errorString() ), QObject::tr( "Plugins" ) ); return; } @@ -344,7 +344,7 @@ void QgsPluginRegistry::loadCppPlugin( const QString& theFullPathName ) addPlugin( baseName, QgsPluginMetadata( myLib.fileName(), pName(), pl ) ); //add it to the qsettings file [ts] settings.setValue( "/Plugins/" + baseName, true ); - QgsMessageLog::logMessage( QObject::tr( "Loaded %1 (Path: %2)" ).arg( pName() ).arg( myLib.fileName() ), QObject::tr( "Plugins" ), QgsMessageLog::INFO ); + QgsMessageLog::logMessage( QObject::tr( "Loaded %1 (Path: %2)" ).arg( pName(), myLib.fileName() ), QObject::tr( "Plugins" ), QgsMessageLog::INFO ); QObject *o = dynamic_cast( pl ); if ( o ) @@ -545,7 +545,7 @@ bool QgsPluginRegistry::checkCppPlugin( const QString& pluginFullPath ) bool loaded = myLib.load(); if ( ! loaded ) { - QgsMessageLog::logMessage( QObject::tr( "Failed to load %1 (Reason: %2)" ).arg( myLib.fileName() ).arg( myLib.errorString() ), QObject::tr( "Plugins" ) ); + QgsMessageLog::logMessage( QObject::tr( "Failed to load %1 (Reason: %2)" ).arg( myLib.fileName(), myLib.errorString() ), QObject::tr( "Plugins" ) ); return false; } diff --git a/src/app/qgsrasterlayerproperties.cpp b/src/app/qgsrasterlayerproperties.cpp index 37e90b66126..e4be25aece1 100644 --- a/src/app/qgsrasterlayerproperties.cpp +++ b/src/app/qgsrasterlayerproperties.cpp @@ -232,9 +232,12 @@ QgsRasterLayerProperties::QgsRasterLayerProperties( QgsMapLayer* lyr, QgsMapCanv QString pyramidSentence4 = tr( "Please note that building internal pyramids may alter the original data file and once created they cannot be removed!" ); QString pyramidSentence5 = tr( "Please note that building internal pyramids could corrupt your image - always make a backup of your data first!" ); - tePyramidDescription->setHtml( pyramidFormat.arg( pyramidHeader ).arg( pyramidSentence1 ) - .arg( pyramidSentence2 ).arg( pyramidSentence3 ) - .arg( pyramidSentence4 ).arg( pyramidSentence5 ) ); + tePyramidDescription->setHtml( pyramidFormat.arg( pyramidHeader, + pyramidSentence1, + pyramidSentence2, + pyramidSentence3, + pyramidSentence4, + pyramidSentence5 ) ); tableTransparency->horizontalHeader()->setResizeMode( 0, QHeaderView::Stretch ); tableTransparency->horizontalHeader()->setResizeMode( 1, QHeaderView::Stretch ); diff --git a/src/app/qgswelcomepage.cpp b/src/app/qgswelcomepage.cpp index 0276efbee33..cfede84ee67 100644 --- a/src/app/qgswelcomepage.cpp +++ b/src/app/qgswelcomepage.cpp @@ -87,8 +87,8 @@ void QgsWelcomePage::versionInfoReceived() { mVersionInformation->setVisible( true ); mVersionInformation->setText( QString( "%1: %2" ) - .arg( tr( "There is a new QGIS version available" ) ) - .arg( versionInfo->downloadInfo() ) ); + .arg( tr( "There is a new QGIS version available" ), + versionInfo->downloadInfo() ) ); mVersionInformation->setStyleSheet( "QLabel{" " background-color: #dddd00;" " padding: 5px;" diff --git a/src/app/qgswelcomepageitemsmodel.cpp b/src/app/qgswelcomepageitemsmodel.cpp index a531ed5e760..4a42a6df025 100644 --- a/src/app/qgswelcomepageitemsmodel.cpp +++ b/src/app/qgswelcomepageitemsmodel.cpp @@ -72,7 +72,10 @@ void QgsWelcomePageItemDelegate::paint( QPainter* painter, const QStyleOptionVie int titleSize = QApplication::fontMetrics().height() * 1.1; int textSize = titleSize * 0.85; - doc.setHtml( QString( "

%3
%4
%5
" ).arg( textSize ).arg( titleSize ).arg( index.data( QgsWelcomePageItemsModel::TitleRole ).toString() ).arg( index.data( QgsWelcomePageItemsModel::PathRole ).toString() ).arg( index.data( QgsWelcomePageItemsModel::CrsRole ).toString() ) ); + doc.setHtml( QString( "
%3
%4
%5
" ).arg( textSize ).arg( titleSize ) + .arg( index.data( QgsWelcomePageItemsModel::TitleRole ).toString(), + index.data( QgsWelcomePageItemsModel::PathRole ).toString(), + index.data( QgsWelcomePageItemsModel::CrsRole ).toString() ) ); doc.setTextWidth( option.rect.width() - ( !icon.isNull() ? icon.width() + 35 : 35 ) ); if ( !icon.isNull() ) @@ -105,7 +108,10 @@ QSize QgsWelcomePageItemDelegate::sizeHint( const QStyleOptionViewItem & option, int titleSize = QApplication::fontMetrics().height() * 1.1; int textSize = titleSize * 0.85; - doc.setHtml( QString( "
%3
%4
%5
" ).arg( textSize ).arg( titleSize ).arg( index.data( QgsWelcomePageItemsModel::TitleRole ).toString() ).arg( index.data( QgsWelcomePageItemsModel::PathRole ).toString() ).arg( index.data( QgsWelcomePageItemsModel::CrsRole ).toString() ) ); + doc.setHtml( QString( "
%3
%4
%5
" ).arg( textSize ).arg( titleSize ) + .arg( index.data( QgsWelcomePageItemsModel::TitleRole ).toString(), + index.data( QgsWelcomePageItemsModel::PathRole ).toString(), + index.data( QgsWelcomePageItemsModel::CrsRole ).toString() ) ); doc.setTextWidth( width - ( !icon.isNull() ? icon.width() + 35 : 35 ) ); return QSize( width, qMax( doc.size().height() + 10, ( double )icon.height() ) + 20 ); @@ -145,7 +151,7 @@ QVariant QgsWelcomePageItemsModel::data( const QModelIndex& index, int role ) co { QgsCoordinateReferenceSystem crs; crs.createFromOgcWmsCrs( mRecentProjects.at( index.row() ).crs ); - return QString( "%1 (%2)" ).arg( mRecentProjects.at( index.row() ).crs ).arg( crs.description() ); + return QString( "%1 (%2)" ).arg( mRecentProjects.at( index.row() ).crs, crs.description() ); } else { diff --git a/src/auth/basic/qgsauthbasicmethod.cpp b/src/auth/basic/qgsauthbasicmethod.cpp index 16ae29129ca..a24ac3aaed8 100644 --- a/src/auth/basic/qgsauthbasicmethod.cpp +++ b/src/auth/basic/qgsauthbasicmethod.cpp @@ -75,7 +75,7 @@ bool QgsAuthBasicMethod::updateNetworkRequest( QNetworkRequest &request, const Q if ( !username.isEmpty() ) { - request.setRawHeader( "Authorization", "Basic " + QString( "%1:%2" ).arg( username ).arg( password ).toAscii().toBase64() ); + request.setRawHeader( "Authorization", "Basic " + QString( "%1:%2" ).arg( username, password ).toAscii().toBase64() ); } return true; } diff --git a/src/auth/identcert/qgsauthidentcertedit.cpp b/src/auth/identcert/qgsauthidentcertedit.cpp index f1484989c7e..a5b58cc4312 100644 --- a/src/auth/identcert/qgsauthidentcertedit.cpp +++ b/src/auth/identcert/qgsauthidentcertedit.cpp @@ -89,7 +89,7 @@ void QgsAuthIdentCertEdit::populateIdentityComboBox() QString org( SSL_SUBJECT_INFO( cert, QSslCertificate::Organization ) ); if ( org.isEmpty() ) org = tr( "Organization not defined" ); - idents.insert( QString( "%1 (%2)" ).arg( QgsAuthCertUtils::resolvedCertName( cert ) ).arg( org ), + idents.insert( QString( "%1 (%2)" ).arg( QgsAuthCertUtils::resolvedCertName( cert ), org ), QgsAuthCertUtils::shaHexForCert( cert ) ); } QgsStringMap::const_iterator it = idents.constBegin(); diff --git a/src/auth/pkipaths/qgsauthpkipathsedit.cpp b/src/auth/pkipaths/qgsauthpkipathsedit.cpp index 3b77af4c0cd..437d54c45d1 100644 --- a/src/auth/pkipaths/qgsauthpkipathsedit.cpp +++ b/src/auth/pkipaths/qgsauthpkipathsedit.cpp @@ -99,7 +99,7 @@ bool QgsAuthPkiPathsEdit::validateConfig() QDateTime enddate( cert.expiryDate() ); writePkiMessage( lePkiPathsMsg, - tr( "%1 thru %2" ).arg( startdate.toString() ).arg( enddate.toString() ), + tr( "%1 thru %2" ).arg( startdate.toString(), enddate.toString() ), ( certvalid ? Valid : Invalid ) ); return validityChange( certvalid ); diff --git a/src/auth/pkipkcs12/qgsauthpkcs12edit.cpp b/src/auth/pkipkcs12/qgsauthpkcs12edit.cpp index c7c7b8b3251..6d5d545d9c9 100644 --- a/src/auth/pkipkcs12/qgsauthpkcs12edit.cpp +++ b/src/auth/pkipkcs12/qgsauthpkcs12edit.cpp @@ -107,7 +107,7 @@ bool QgsAuthPkcs12Edit::validateConfig() bool bundlevalid = ( now >= startdate && now <= enddate ); writePkiMessage( lePkcs12Msg, - tr( "%1 thru %2" ).arg( startdate.toString() ).arg( enddate.toString() ), + tr( "%1 thru %2" ).arg( startdate.toString(), enddate.toString() ), ( bundlevalid ? Valid : Invalid ) ); return validityChange( bundlevalid ); diff --git a/src/browser/main.cpp b/src/browser/main.cpp index a2097063e27..6fcb897555e 100644 --- a/src/browser/main.cpp +++ b/src/browser/main.cpp @@ -95,7 +95,7 @@ int main( int argc, char ** argv ) } else { - qWarning( "loading of qgis translation failed [%s]", QString( "%1/qgis_%2" ).arg( i18nPath ).arg( myTranslationCode ).toLocal8Bit().constData() ); + qWarning( "loading of qgis translation failed [%s]", QString( "%1/qgis_%2" ).arg( i18nPath, myTranslationCode ).toLocal8Bit().constData() ); } /* Translation file for Qt. @@ -109,7 +109,7 @@ int main( int argc, char ** argv ) } else { - qWarning( "loading of qt translation failed [%s]", QString( "%1/qt_%2" ).arg( QLibraryInfo::location( QLibraryInfo::TranslationsPath ) ).arg( myTranslationCode ).toLocal8Bit().constData() ); + qWarning( "loading of qt translation failed [%s]", QString( "%1/qt_%2" ).arg( QLibraryInfo::location( QLibraryInfo::TranslationsPath ), myTranslationCode ).toLocal8Bit().constData() ); } } diff --git a/src/core/auth/qgsauthconfig.cpp b/src/core/auth/qgsauthconfig.cpp index 5dbdc42072e..755bb1c390d 100644 --- a/src/core/auth/qgsauthconfig.cpp +++ b/src/core/auth/qgsauthconfig.cpp @@ -157,7 +157,7 @@ bool QgsAuthMethodConfig::uriToResource( const QString &accessurl, QString *reso QUrl url( accessurl ); if ( url.isValid() ) { - res = QString( "%1://%2:%3%4" ).arg( url.scheme() ).arg( url.host() ) + res = QString( "%1://%2:%3%4" ).arg( url.scheme(), url.host() ) .arg( url.port() ).arg( withpath ? url.path() : "" ); } } diff --git a/src/core/auth/qgsauthmanager.cpp b/src/core/auth/qgsauthmanager.cpp index 33c0e20d4cb..8bc15bdbabb 100644 --- a/src/core/auth/qgsauthmanager.cpp +++ b/src/core/auth/qgsauthmanager.cpp @@ -837,7 +837,7 @@ void QgsAuthManager::updateConfigAuthMethods() { mConfigAuthMethods.insert( query.value( 0 ).toString(), query.value( 1 ).toString() ); - cfgmethods << QString( "%1=%2" ).arg( query.value( 0 ).toString() ).arg( query.value( 1 ).toString() ); + cfgmethods << QString( "%1=%2" ).arg( query.value( 0 ).toString(), query.value( 1 ).toString() ); } QgsDebugMsg( QString( "Stored auth config/methods:\n%1" ).arg( cfgmethods.join( ", " ) ) ); } @@ -1120,10 +1120,10 @@ bool QgsAuthManager::loadAuthenticationConfig( const QString &authcfg, QgsAuthMe } else { - QgsDebugMsg( QString( "Update of authcfg %1 FAILED for auth method %2" ).arg( authcfg ) .arg( authMethodKey ) ); + QgsDebugMsg( QString( "Update of authcfg %1 FAILED for auth method %2" ).arg( authcfg, authMethodKey ) ); } - QgsDebugMsg( QString( "Load %1 config SUCCESS for authcfg: %2" ).arg( full ? "full" : "base" ) .arg( authcfg ) ); + QgsDebugMsg( QString( "Load %1 config SUCCESS for authcfg: %2" ).arg( full ? "full" : "base", authcfg ) ); return true; } if ( query.next() ) @@ -1815,7 +1815,7 @@ bool QgsAuthManager::storeSslCertCustomConfig( const QgsAuthConfigSslServer &con return false; QgsDebugMsg( QString( "Store SSL cert custom config SUCCESS for host:port, id: %1, %2" ) - .arg( config.sslHostPort().trimmed() ).arg( id ) ); + .arg( config.sslHostPort().trimmed(), id ) ); updateIgnoredSslErrorsCacheFromConfig( config ); @@ -1849,13 +1849,13 @@ const QgsAuthConfigSslServer QgsAuthManager::getSslCertCustomConfig( const QStri config.setSslCertificate( QSslCertificate( query.value( 2 ).toByteArray(), QSsl::Pem ) ); config.setSslHostPort( query.value( 1 ).toString().trimmed() ); config.loadConfigString( query.value( 3 ).toString() ); - QgsDebugMsg( QString( "SSL cert custom config retrieved for host:port, id: %1, %2" ).arg( hostport ).arg( id ) ); + QgsDebugMsg( QString( "SSL cert custom config retrieved for host:port, id: %1, %2" ).arg( hostport, id ) ); } if ( query.next() ) { - QgsDebugMsg( QString( "Select contains more than one SSL cert custom config for host:port, id: %1, %2" ).arg( hostport ).arg( id ) ); + QgsDebugMsg( QString( "Select contains more than one SSL cert custom config for host:port, id: %1, %2" ).arg( hostport, id ) ); emit messageOut( tr( "Authentication database contains duplicate SSL cert custom configs for host:port, id: %1, %2" ) - .arg( hostport ).arg( id ), authManTag(), WARNING ); + .arg( hostport, id ), authManTag(), WARNING ); QgsAuthConfigSslServer emptyconfig; return emptyconfig; } @@ -1952,14 +1952,14 @@ bool QgsAuthManager::existsSslCertCustomConfig( const QString &id , const QStrin { if ( query.first() ) { - QgsDebugMsg( QString( "SSL cert custom config exists for host:port, id: %1, %2" ).arg( hostport ).arg( id ) ); + QgsDebugMsg( QString( "SSL cert custom config exists for host:port, id: %1, %2" ).arg( hostport, id ) ); res = true; } if ( query.next() ) { - QgsDebugMsg( QString( "Select contains more than one SSL cert custom config for host:port, id: %1, %2" ).arg( hostport ).arg( id ) ); + QgsDebugMsg( QString( "Select contains more than one SSL cert custom config for host:port, id: %1, %2" ).arg( hostport, id ) ); emit messageOut( tr( "Authentication database contains duplicate SSL cert custom configs for host:port, id: %1, %2" ) - .arg( hostport ).arg( id ), authManTag(), WARNING ); + .arg( hostport, id ), authManTag(), WARNING ); return false; } } @@ -1990,13 +1990,13 @@ bool QgsAuthManager::removeSslCertCustomConfig( const QString &id, const QString if ( !authDbCommit() ) return false; - QString shahostport( QString( "%1:%2" ).arg( id ).arg( hostport ) ); + QString shahostport( QString( "%1:%2" ).arg( id, hostport ) ); if ( mIgnoredSslErrorsCache.contains( shahostport ) ) { mIgnoredSslErrorsCache.remove( shahostport ); } - QgsDebugMsg( QString( "REMOVED SSL cert custom config for host:port, id: %1, %2" ).arg( hostport ).arg( id ) ); + QgsDebugMsg( QString( "REMOVED SSL cert custom config for host:port, id: %1, %2" ).arg( hostport, id ) ); dumpIgnoredSslErrorsCache_(); return true; } @@ -2014,7 +2014,7 @@ void QgsAuthManager::dumpIgnoredSslErrorsCache_() { errs << QgsAuthCertUtils::sslErrorEnumString( err ); } - QgsDebugMsg( QString( "%1 = %2" ).arg( i.key() ).arg( errs.join( ", " ) ) ); + QgsDebugMsg( QString( "%1 = %2" ).arg( i.key(), errs.join( ", " ) ) ); ++i; } } @@ -2033,8 +2033,8 @@ bool QgsAuthManager::updateIgnoredSslErrorsCacheFromConfig( const QgsAuthConfigS } QString shahostport( QString( "%1:%2" ) - .arg( QgsAuthCertUtils::shaHexForCert( config.sslCertificate() ).trimmed() ) - .arg( config.sslHostPort().trimmed() ) ); + .arg( QgsAuthCertUtils::shaHexForCert( config.sslCertificate() ).trimmed(), + config.sslHostPort().trimmed() ) ); if ( mIgnoredSslErrorsCache.contains( shahostport ) ) { mIgnoredSslErrorsCache.remove( shahostport ); @@ -2114,8 +2114,8 @@ bool QgsAuthManager::rebuildIgnoredSslErrorCache() while ( query.next() ) { QString shahostport( QString( "%1:%2" ) - .arg( query.value( 0 ).toString().trimmed() ) - .arg( query.value( 1 ).toString().trimmed() ) ); + .arg( query.value( 0 ).toString().trimmed(), + query.value( 1 ).toString().trimmed() ) ); QgsAuthConfigSslServer config; config.loadConfigString( query.value( 2 ).toString() ); QList errenums( config.sslIgnoredErrorEnums() ); @@ -3231,9 +3231,9 @@ bool QgsAuthManager::authDbOpen() const if ( !authdb.open() ) { QgsDebugMsg( QString( "Unable to establish database connection\nDatabase: %1\nDriver error: %2\nDatabase error: %3" ) - .arg( authenticationDbPath() ) - .arg( authdb.lastError().driverText() ) - .arg( authdb.lastError().databaseText() ) ); + .arg( authenticationDbPath(), + authdb.lastError().driverText(), + authdb.lastError().databaseText() ) ); emit messageOut( tr( "Unable to establish authentication database connection" ), authManTag(), CRITICAL ); return false; } @@ -3258,8 +3258,8 @@ bool QgsAuthManager::authDbQuery( QSqlQuery *query ) const if ( query->lastError().isValid() ) { QgsDebugMsg( QString( "Auth db query FAILED: %1\nError: %2" ) - .arg( query->executedQuery() ) - .arg( query->lastError().text() ) ); + .arg( query->executedQuery(), + query->lastError().text() ) ); emit messageOut( tr( "Auth db query FAILED" ), authManTag(), WARNING ); return false; } diff --git a/src/core/auth/qgsauthmethodregistry.cpp b/src/core/auth/qgsauthmethodregistry.cpp index 36b72eafc0e..075b1c5d15f 100644 --- a/src/core/auth/qgsauthmethodregistry.cpp +++ b/src/core/auth/qgsauthmethodregistry.cpp @@ -102,7 +102,7 @@ QgsAuthMethodRegistry::QgsAuthMethodRegistry( const QString& pluginPath ) QLibrary myLib( fi.filePath() ); if ( !myLib.load() ) { - QgsDebugMsg( QString( "Checking %1: ...invalid (lib not loadable): %2" ).arg( myLib.fileName() ).arg( myLib.errorString() ) ); + QgsDebugMsg( QString( "Checking %1: ...invalid (lib not loadable): %2" ).arg( myLib.fileName(), myLib.errorString() ) ); continue; } @@ -288,7 +288,7 @@ QgsAuthMethod *QgsAuthMethodRegistry::authMethod( const QString &authMethodKey ) QgsDebugMsg( "Auth method library name is " + myLib.fileName() ); if ( !myLib.load() ) { - QgsMessageLog::logMessage( QObject::tr( "Failed to load %1: %2" ).arg( lib ).arg( myLib.errorString() ) ); + QgsMessageLog::logMessage( QObject::tr( "Failed to load %1: %2" ).arg( lib, myLib.errorString() ) ); return 0; } diff --git a/src/core/dxf/qgsdxfexport.cpp b/src/core/dxf/qgsdxfexport.cpp index a629bd1022a..46507853f24 100644 --- a/src/core/dxf/qgsdxfexport.cpp +++ b/src/core/dxf/qgsdxfexport.cpp @@ -3351,7 +3351,7 @@ void QgsDxfExport::writePolyline( const QgsPolyline& line, const QString& layer, int n = line.size(); if ( n == 0 ) { - QgsDebugMsg( QString( "writePolyline: empty line layer=%1 lineStyleName=%2" ).arg( layer ).arg( lineStyleName ) ); + QgsDebugMsg( QString( "writePolyline: empty line layer=%1 lineStyleName=%2" ).arg( layer, lineStyleName ) ); return; } @@ -3360,7 +3360,7 @@ void QgsDxfExport::writePolyline( const QgsPolyline& line, const QString& layer, --n; if ( n < 2 ) { - QgsDebugMsg( QString( "writePolyline: line too short layer=%1 lineStyleName=%2" ).arg( layer ).arg( lineStyleName ) ); + QgsDebugMsg( QString( "writePolyline: line too short layer=%1 lineStyleName=%2" ).arg( layer, lineStyleName ) ); return; } diff --git a/src/core/geometry/qgscompoundcurvev2.cpp b/src/core/geometry/qgscompoundcurvev2.cpp index d174d8a3144..c69a83ba9fb 100644 --- a/src/core/geometry/qgscompoundcurvev2.cpp +++ b/src/core/geometry/qgscompoundcurvev2.cpp @@ -140,7 +140,7 @@ bool QgsCompoundCurveV2::fromWkt( const QString& wkt ) return false; mWkbType = parts.first; - QString defaultChildWkbType = QString( "LineString%1%2" ).arg( is3D() ? "Z" : "" ).arg( isMeasure() ? "M" : "" ); + QString defaultChildWkbType = QString( "LineString%1%2" ).arg( is3D() ? "Z" : "", isMeasure() ? "M" : "" ); Q_FOREACH ( const QString& childWkt, QgsGeometryUtils::wktGetChildBlocks( parts.second, defaultChildWkbType ) ) { diff --git a/src/core/geometry/qgscurvepolygonv2.cpp b/src/core/geometry/qgscurvepolygonv2.cpp index e5550b539b7..ba9cb5a404e 100644 --- a/src/core/geometry/qgscurvepolygonv2.cpp +++ b/src/core/geometry/qgscurvepolygonv2.cpp @@ -151,7 +151,7 @@ bool QgsCurvePolygonV2::fromWkt( const QString& wkt ) return false; mWkbType = parts.first; - QString defaultChildWkbType = QString( "LineString%1%2" ).arg( is3D() ? "Z" : "" ).arg( isMeasure() ? "M" : "" ); + QString defaultChildWkbType = QString( "LineString%1%2" ).arg( is3D() ? "Z" : "", isMeasure() ? "M" : "" ); Q_FOREACH ( const QString& childWkt, QgsGeometryUtils::wktGetChildBlocks( parts.second, defaultChildWkbType ) ) { diff --git a/src/core/geometry/qgsgeometrycollectionv2.cpp b/src/core/geometry/qgsgeometrycollectionv2.cpp index 8cfc30358a3..3402cc9cc29 100644 --- a/src/core/geometry/qgsgeometrycollectionv2.cpp +++ b/src/core/geometry/qgsgeometrycollectionv2.cpp @@ -462,7 +462,7 @@ bool QgsGeometryCollectionV2::fromCollectionWkt( const QString &wkt, const QList return false; mWkbType = parts.first; - QString defChildWkbType = QString( "%1%2%3 " ).arg( defaultChildWkbType ).arg( is3D() ? "Z" : "" ).arg( isMeasure() ? "M" : "" ); + QString defChildWkbType = QString( "%1%2%3 " ).arg( defaultChildWkbType, is3D() ? "Z" : "", isMeasure() ? "M" : "" ); Q_FOREACH ( const QString& childWkt, QgsGeometryUtils::wktGetChildBlocks( parts.second, defChildWkbType ) ) { diff --git a/src/core/qgsapplication.cpp b/src/core/qgsapplication.cpp index 5d657d55e12..a00ffa3ddda 100644 --- a/src/core/qgsapplication.cpp +++ b/src/core/qgsapplication.cpp @@ -762,15 +762,15 @@ QString QgsApplication::showSettings() "SVG Search Paths:\t%8\n" "User DB Path:\t%9\n" "Auth DB Path:\t%10\n" ) - .arg( myEnvironmentVar ) - .arg( prefixPath() ) - .arg( pluginPath() ) - .arg( pkgDataPath() ) - .arg( themeName() ) - .arg( activeThemePath() ) - .arg( defaultThemePath() ) - .arg( svgPaths().join( tr( "\n\t\t", "match indentation of application state" ) ) ) - .arg( qgisMasterDbFilePath() ) + .arg( myEnvironmentVar, + prefixPath(), + pluginPath(), + pkgDataPath(), + themeName(), + activeThemePath(), + defaultThemePath(), + svgPaths().join( tr( "\n\t\t", "match indentation of application state" ) ), + qgisMasterDbFilePath() ) .arg( qgisAuthDbFilePath() ); return myState; } diff --git a/src/core/qgsconditionalstyle.cpp b/src/core/qgsconditionalstyle.cpp index 4748c91d6b6..75a49d9b9e2 100644 --- a/src/core/qgsconditionalstyle.cpp +++ b/src/core/qgsconditionalstyle.cpp @@ -160,7 +160,7 @@ QString QgsConditionalStyle::displayText() const if ( name().isEmpty() ) return rule(); else - return QString( "%1 \n%2" ).arg( name() ).arg( rule() ); + return QString( "%1 \n%2" ).arg( name(), rule() ); } void QgsConditionalStyle::setSymbol( QgsSymbolV2* value ) diff --git a/src/core/qgscoordinatereferencesystem.cpp b/src/core/qgscoordinatereferencesystem.cpp index cfead78b9f9..3d4d070dd81 100644 --- a/src/core/qgscoordinatereferencesystem.cpp +++ b/src/core/qgscoordinatereferencesystem.cpp @@ -144,8 +144,8 @@ bool QgsCoordinateReferenceSystem::createFromString( const QString &theDefinitio if ( srsid() == 0 ) { QString myName = QString( " * %1 (%2)" ) - .arg( QObject::tr( "Generated CRS", "A CRS automatically generated from layer info get this prefix for description" ) ) - .arg( toProj4() ); + .arg( QObject::tr( "Generated CRS", "A CRS automatically generated from layer info get this prefix for description" ), + toProj4() ); saveAsUserCRS( myName ); } } @@ -198,7 +198,7 @@ void QgsCoordinateReferenceSystem::setupESRIWktFix() CPLSetConfigOption( "GDAL_FIX_ESRI_WKT", configNew ); if ( strcmp( configNew, CPLGetConfigOption( "GDAL_FIX_ESRI_WKT", "" ) ) != 0 ) QgsLogger::warning( QString( "GDAL_FIX_ESRI_WKT could not be set to %1 : %2" ) - .arg( configNew ).arg( CPLGetConfigOption( "GDAL_FIX_ESRI_WKT", "" ) ) ); + .arg( configNew, CPLGetConfigOption( "GDAL_FIX_ESRI_WKT", "" ) ) ); QgsDebugMsg( QString( "set GDAL_FIX_ESRI_WKT : %1" ).arg( configNew ) ); } else @@ -458,8 +458,8 @@ bool QgsCoordinateReferenceSystem::createFromWkt( const QString &theWkt ) if ( OSRAutoIdentifyEPSG( mCRS ) == OGRERR_NONE ) { QString authid = QString( "%1:%2" ) - .arg( OSRGetAuthorityName( mCRS, NULL ) ) - .arg( OSRGetAuthorityCode( mCRS, NULL ) ); + .arg( OSRGetAuthorityName( mCRS, NULL ), + OSRGetAuthorityCode( mCRS, NULL ) ); QgsDebugMsg( "authid recognized as " + authid ); return createFromOgcWmsCrs( authid ); } @@ -493,8 +493,8 @@ bool QgsCoordinateReferenceSystem::createFromWkt( const QString &theWkt ) if ( mSrsId == 0 ) { QString myName = QString( " * %1 (%2)" ) - .arg( QObject::tr( "Generated CRS", "A CRS automatically generated from layer info get this prefix for description" ) ) - .arg( toProj4() ); + .arg( QObject::tr( "Generated CRS", "A CRS automatically generated from layer info get this prefix for description" ), + toProj4() ); saveAsUserCRS( myName ); } @@ -1039,8 +1039,8 @@ long QgsCoordinateReferenceSystem::findMatchingProj() // needed to populate the list QString mySql = QString( "select srs_id,parameters from tbl_srs where " "projection_acronym=%1 and ellipsoid_acronym=%2 order by deprecated" ) - .arg( quotedValue( mProjectionAcronym ) ) - .arg( quotedValue( mEllipsoidAcronym ) ); + .arg( quotedValue( mProjectionAcronym ), + quotedValue( mEllipsoidAcronym ) ); // Get the full path name to the sqlite3 spatial reference database. QString myDatabaseFileName = QgsApplication::srsDbFilePath(); @@ -1250,8 +1250,8 @@ bool QgsCoordinateReferenceSystem::readXML( QDomNode & theNode ) if ( mSrsId == 0 ) { QString myName = QString( " * %1 (%2)" ) - .arg( QObject::tr( "Generated CRS", "A CRS automatically generated from layer info get this prefix for description" ) ) - .arg( toProj4() ); + .arg( QObject::tr( "Generated CRS", "A CRS automatically generated from layer info get this prefix for description" ), + toProj4() ); saveAsUserCRS( myName ); } @@ -1499,8 +1499,8 @@ bool QgsCoordinateReferenceSystem::saveAsUserCRS( const QString& name ) if ( myResult != SQLITE_OK ) { QgsDebugMsg( QString( "Can't open or create database %1: %2" ) - .arg( QgsApplication::qgisUserDbFilePath() ) - .arg( sqlite3_errmsg( myDatabase ) ) ); + .arg( QgsApplication::qgisUserDbFilePath(), + sqlite3_errmsg( myDatabase ) ) ); return false; } QgsDebugMsg( QString( "Update or insert sql \n%1" ).arg( mySql ) ); @@ -1784,7 +1784,7 @@ int QgsCoordinateReferenceSystem::syncDb() else { updated++; - QgsDebugMsgLevel( QString( "SQL: %1\n OLD:%2\n NEW:%3" ).arg( sql ).arg( srsProj4 ).arg( proj4 ), 3 ); + QgsDebugMsgLevel( QString( "SQL: %1\n OLD:%2\n NEW:%3" ).arg( sql, srsProj4, proj4 ), 3 ); } } } @@ -1809,10 +1809,10 @@ int QgsCoordinateReferenceSystem::syncDb() name = QObject::tr( "Imported from GDAL" ); sql = QString( "INSERT INTO tbl_srs(description,projection_acronym,ellipsoid_acronym,parameters,srid,auth_name,auth_id,is_geo,deprecated) VALUES (%1,%2,%3,%4,%5,'EPSG',%5,%6,0)" ) - .arg( quotedValue( name ) ) - .arg( quotedValue( projRegExp.cap( 1 ) ) ) - .arg( quotedValue( ellps ) ) - .arg( quotedValue( proj4 ) ) + .arg( quotedValue( name ), + quotedValue( projRegExp.cap( 1 ) ), + quotedValue( ellps ), + quotedValue( proj4 ) ) .arg( it.key() ) .arg( OSRIsGeographic( crs ) ); @@ -1866,11 +1866,11 @@ int QgsCoordinateReferenceSystem::syncDb() const char *auth_id = ( const char * ) sqlite3_column_text( select, 1 ); const char *params = ( const char * ) sqlite3_column_text( select, 2 ); - QString input = QString( "+init=%1:%2" ).arg( QString( auth_name ).toLower() ).arg( auth_id ); + QString input = QString( "+init=%1:%2" ).arg( QString( auth_name ).toLower(), auth_id ); projPJ pj = pj_init_plus( input.toAscii() ); if ( !pj ) { - input = QString( "+init=%1:%2" ).arg( QString( auth_name ).toUpper() ).arg( auth_id ); + input = QString( "+init=%1:%2" ).arg( QString( auth_name ).toUpper(), auth_id ); pj = pj_init_plus( input.toAscii() ); } @@ -1892,14 +1892,14 @@ int QgsCoordinateReferenceSystem::syncDb() if ( proj4 != params ) { sql = QString( "UPDATE tbl_srs SET parameters=%1 WHERE auth_name=%2 AND auth_id=%3" ) - .arg( quotedValue( proj4 ) ) - .arg( quotedValue( auth_name ) ) - .arg( quotedValue( auth_id ) ); + .arg( quotedValue( proj4 ), + quotedValue( auth_name ), + quotedValue( auth_id ) ); if ( sqlite3_exec( database, sql.toUtf8(), 0, 0, &errMsg ) == SQLITE_OK ) { updated++; - QgsDebugMsgLevel( QString( "SQL: %1\n OLD:%2\n NEW:%3" ).arg( sql ).arg( params ).arg( proj4 ), 3 ); + QgsDebugMsgLevel( QString( "SQL: %1\n OLD:%2\n NEW:%3" ).arg( sql, params, proj4 ), 3 ); } else { diff --git a/src/core/qgscoordinatetransform.cpp b/src/core/qgscoordinatetransform.cpp index da81f55361d..1bec8d7f489 100644 --- a/src/core/qgscoordinatetransform.cpp +++ b/src/core/qgscoordinatetransform.cpp @@ -701,10 +701,10 @@ void QgsCoordinateTransform::transformCoords( const int& numPoints, double *x, d "%2" "PROJ.4: %3 +to %4\n" "Error: %5" ) - .arg( dir ) - .arg( points ) - .arg( srcdef ).arg( dstdef ) - .arg( QString::fromUtf8( pj_strerrno( projResult ) ) ); + .arg( dir, + points, + srcdef, dstdef, + QString::fromUtf8( pj_strerrno( projResult ) ) ); pj_dalloc( srcdef ); pj_dalloc( dstdef ); diff --git a/src/core/qgscredentials.cpp b/src/core/qgscredentials.cpp index 10cef88cf99..3fcc297b520 100644 --- a/src/core/qgscredentials.cpp +++ b/src/core/qgscredentials.cpp @@ -53,7 +53,7 @@ bool QgsCredentials::get( const QString& realm, QString &username, QString &pass QPair credentials = mCredentialCache.take( realm ); username = credentials.first; password = credentials.second; - QgsDebugMsg( QString( "retrieved realm:%1 username:%2 password:%3" ).arg( realm ).arg( username ).arg( password ) ); + QgsDebugMsg( QString( "retrieved realm:%1 username:%2 password:%3" ).arg( realm, username, password ) ); if ( !password.isNull() ) return true; @@ -61,7 +61,7 @@ bool QgsCredentials::get( const QString& realm, QString &username, QString &pass if ( request( realm, username, password, message ) ) { - QgsDebugMsg( QString( "requested realm:%1 username:%2 password:%3" ).arg( realm ).arg( username ).arg( password ) ); + QgsDebugMsg( QString( "requested realm:%1 username:%2 password:%3" ).arg( realm, username, password ) ); return true; } else @@ -73,7 +73,7 @@ bool QgsCredentials::get( const QString& realm, QString &username, QString &pass void QgsCredentials::put( const QString& realm, const QString& username, const QString& password ) { - QgsDebugMsg( QString( "inserting realm:%1 username:%2 password:%3" ).arg( realm ).arg( username ).arg( password ) ); + QgsDebugMsg( QString( "inserting realm:%1 username:%2 password:%3" ).arg( realm, username, password ) ); mCredentialCache.insert( realm, QPair( username, password ) ); } diff --git a/src/core/qgsdartmeasurement.cpp b/src/core/qgsdartmeasurement.cpp index 468643a932f..6043c1db1a1 100644 --- a/src/core/qgsdartmeasurement.cpp +++ b/src/core/qgsdartmeasurement.cpp @@ -33,10 +33,10 @@ const QString QgsDartMeasurement::toString() const } QString dashMessage = QString( "<%1 name=\"%2\" type=\"%3\">%4" ) - .arg( elementName ) - .arg( mName ) - .arg( typeToString( mType ) ) - .arg( mValue ); + .arg( elementName, + mName, + typeToString( mType ), + mValue ); return dashMessage; } diff --git a/src/core/qgsdataitem.cpp b/src/core/qgsdataitem.cpp index 3857b9b0c11..0782b2acf95 100644 --- a/src/core/qgsdataitem.cpp +++ b/src/core/qgsdataitem.cpp @@ -223,7 +223,7 @@ QgsDataItem::QgsDataItem( QgsDataItem::Type type, QgsDataItem* parent, const QSt QgsDataItem::~QgsDataItem() { - QgsDebugMsgLevel( QString( "mName = %1 mPath = %2 mChildren.size() = %3" ).arg( mName ).arg( mPath ).arg( mChildren.size() ), 2 ); + QgsDebugMsgLevel( QString( "mName = %1 mPath = %2 mChildren.size() = %3" ).arg( mName, mPath ).arg( mChildren.size() ), 2 ); Q_FOREACH ( QgsDataItem *child, mChildren ) { if ( !child ) // should not happen @@ -1293,7 +1293,7 @@ QVector QgsZipItem::createChildren() mZipFileList.clear(); - QgsDebugMsgLevel( QString( "mFilePath = %1 path = %2 name= %3 scanZipSetting= %4 vsiPrefix= %5" ).arg( mFilePath ).arg( path() ).arg( name() ).arg( scanZipSetting ).arg( mVsiPrefix ), 2 ); + QgsDebugMsgLevel( QString( "mFilePath = %1 path = %2 name= %3 scanZipSetting= %4 vsiPrefix= %5" ).arg( mFilePath, path(), name(), scanZipSetting, mVsiPrefix ), 2 ); // if scanZipBrowser == no: skip to the next file if ( scanZipSetting == "no" ) @@ -1332,7 +1332,7 @@ QVector QgsZipItem::createChildren() dataItem_t *dataItem = mDataItemPtr[i]; if ( dataItem ) { - QgsDebugMsgLevel( QString( "trying to load item %1 with %2" ).arg( tmpPath ).arg( mProviderNames[i] ), 3 ); + QgsDebugMsgLevel( QString( "trying to load item %1 with %2" ).arg( tmpPath, mProviderNames[i] ), 3 ); QgsDataItem * item = dataItem( tmpPath, this ); if ( item ) { @@ -1370,7 +1370,7 @@ QgsDataItem* QgsZipItem::itemFromPath( QgsDataItem* parent, const QString& fileP QgsZipItem * zipItem = 0; bool populated = false; - QgsDebugMsgLevel( QString( "path = %1 name= %2 scanZipSetting= %3 vsiPrefix= %4" ).arg( path ).arg( name ).arg( scanZipSetting ).arg( vsiPrefix ), 3 ); + QgsDebugMsgLevel( QString( "path = %1 name= %2 scanZipSetting= %3 vsiPrefix= %4" ).arg( path, name, scanZipSetting, vsiPrefix ), 3 ); // don't scan if scanZipBrowser == no if ( scanZipSetting == "no" ) @@ -1400,11 +1400,11 @@ QgsDataItem* QgsZipItem::itemFromPath( QgsDataItem* parent, const QString& fileP { zipItem->populate( zipItem->createChildren() ); populated = true; // there is no QgsDataItem::isPopulated() function - QgsDebugMsgLevel( QString( "Got zipItem with %1 children, path=%2, name=%3" ).arg( zipItem->rowCount() ).arg( zipItem->path() ).arg( zipItem->name() ), 3 ); + QgsDebugMsgLevel( QString( "Got zipItem with %1 children, path=%2, name=%3" ).arg( zipItem->rowCount() ).arg( zipItem->path(), zipItem->name() ), 3 ); } else { - QgsDebugMsgLevel( QString( "Delaying populating zipItem with path=%1, name=%2" ).arg( zipItem->path() ).arg( zipItem->name() ), 3 ); + QgsDebugMsgLevel( QString( "Delaying populating zipItem with path=%1, name=%2" ).arg( zipItem->path(), zipItem->name() ), 3 ); } } @@ -1431,7 +1431,7 @@ QgsDataItem* QgsZipItem::itemFromPath( QgsDataItem* parent, const QString& fileP delete zipItem; } - QgsDebugMsgLevel( QString( "will try to create a normal dataItem from filePath= %2 or vsiPath = %3" ).arg( filePath ).arg( vsiPath ), 3 ); + QgsDebugMsgLevel( QString( "will try to create a normal dataItem from filePath= %2 or vsiPath = %3" ).arg( filePath, vsiPath ), 3 ); // try to open using registered providers (gdal and ogr) for ( int i = 0; i < mProviderNames.size(); i++ ) @@ -1467,7 +1467,7 @@ const QStringList &QgsZipItem::getZipFileList() QSettings settings; QString scanZipSetting = settings.value( "/qgis/scanZipInBrowser2", "basic" ).toString(); - QgsDebugMsgLevel( QString( "mFilePath = %1 name= %2 scanZipSetting= %3 vsiPrefix= %4" ).arg( mFilePath ).arg( name() ).arg( scanZipSetting ).arg( mVsiPrefix ), 3 ); + QgsDebugMsgLevel( QString( "mFilePath = %1 name= %2 scanZipSetting= %3 vsiPrefix= %4" ).arg( mFilePath, name(), scanZipSetting, mVsiPrefix ), 3 ); // if scanZipBrowser == no: skip to the next file if ( scanZipSetting == "no" ) diff --git a/src/core/qgsdatasourceuri.cpp b/src/core/qgsdatasourceuri.cpp index 3a63a407e7d..ba602418f80 100644 --- a/src/core/qgsdatasourceuri.cpp +++ b/src/core/qgsdatasourceuri.cpp @@ -567,9 +567,9 @@ QString QgsDataSourceURI::uri( bool expandAuthConfig ) const columnName.replace( ")", "\\)" ); theUri += QString( " table=%1%2 sql=%3" ) - .arg( quotedTablename() ) - .arg( mGeometryColumn.isNull() ? QString() : QString( " (%1)" ).arg( columnName ) ) - .arg( mSql ); + .arg( quotedTablename(), + mGeometryColumn.isNull() ? QString() : QString( " (%1)" ).arg( columnName ), + mSql ); return theUri; } @@ -608,8 +608,8 @@ QString QgsDataSourceURI::quotedTablename() const { if ( !mSchema.isEmpty() ) return QString( "\"%1\".\"%2\"" ) - .arg( escape( mSchema, '"' ) ) - .arg( escape( mTable, '"' ) ); + .arg( escape( mSchema, '"' ), + escape( mTable, '"' ) ); else return QString( "\"%1\"" ) .arg( escape( mTable, '"' ) ); diff --git a/src/core/qgsdistancearea.cpp b/src/core/qgsdistancearea.cpp index 6eacb20876b..1c52487eee5 100644 --- a/src/core/qgsdistancearea.cpp +++ b/src/core/qgsdistancearea.cpp @@ -231,8 +231,8 @@ bool QgsDistanceArea::setEllipsoid( const QString& ellipsoid ) if ( destCRS.srsid() == 0 ) { QString myName = QString( " * %1 (%2)" ) - .arg( QObject::tr( "Generated CRS", "A CRS automatically generated from layer info get this prefix for description" ) ) - .arg( destCRS.toProj4() ); + .arg( QObject::tr( "Generated CRS", "A CRS automatically generated from layer info get this prefix for description" ), + destCRS.toProj4() ); destCRS.saveAsUserCRS( myName ); } // @@ -465,7 +465,7 @@ double QgsDistanceArea::measureLine( const QgsPoint &p1, const QgsPoint &p2 ) co { QgsPoint pp1 = p1, pp2 = p2; - QgsDebugMsgLevel( QString( "Measuring from %1 to %2" ).arg( p1.toString( 4 ) ).arg( p2.toString( 4 ) ), 3 ); + QgsDebugMsgLevel( QString( "Measuring from %1 to %2" ).arg( p1.toString( 4 ), p2.toString( 4 ) ), 3 ); if ( mEllipsoidalMode && ( mEllipsoid != GEO_NONE ) ) { QgsDebugMsgLevel( QString( "Ellipsoidal calculations is enabled, using ellipsoid %1" ).arg( mEllipsoid ), 4 ); @@ -473,7 +473,7 @@ double QgsDistanceArea::measureLine( const QgsPoint &p1, const QgsPoint &p2 ) co QgsDebugMsgLevel( QString( "To proj4 : %1" ).arg( mCoordTransform->destCRS().toProj4() ), 4 ); pp1 = mCoordTransform->transform( p1 ); pp2 = mCoordTransform->transform( p2 ); - QgsDebugMsgLevel( QString( "New points are %1 and %2, calculating..." ).arg( pp1.toString( 4 ) ).arg( pp2.toString( 4 ) ), 4 ); + QgsDebugMsgLevel( QString( "New points are %1 and %2, calculating..." ).arg( pp1.toString( 4 ), pp2.toString( 4 ) ), 4 ); result = computeDistanceBearing( pp1, pp2 ); } else diff --git a/src/core/qgserror.cpp b/src/core/qgserror.cpp index 7fb82a4a7ea..b1a03da8180 100644 --- a/src/core/qgserror.cpp +++ b/src/core/qgserror.cpp @@ -110,8 +110,8 @@ QString QgsError::message( QgsErrorMessage::Format theFormat ) const QString location = QString( "%1 : %2 : %3" ).arg( file ).arg( m.line() ).arg( m.function() ); if ( !srcUrl.isEmpty() ) { - QString url = QString( "%1/%2#L%3" ).arg( srcUrl ).arg( file ).arg( m.line() ); - str += QString( "
(%2)" ).arg( url ).arg( location ); + QString url = QString( "%1/%2#L%3" ).arg( srcUrl, file ).arg( m.line() ); + str += QString( "
(%2)" ).arg( url, location ); } else { diff --git a/src/core/qgsexpression.cpp b/src/core/qgsexpression.cpp index b546845fc62..3d019e8c03c 100644 --- a/src/core/qgsexpression.cpp +++ b/src/core/qgsexpression.cpp @@ -809,7 +809,7 @@ static QVariant fcnRegexpReplace( const QVariantList& values, const QgsExpressio QRegExp re( regexp ); if ( !re.isValid() ) { - parent->setEvalErrorString( QObject::tr( "Invalid regular expression '%1': %2" ).arg( regexp ).arg( re.errorString() ) ); + parent->setEvalErrorString( QObject::tr( "Invalid regular expression '%1': %2" ).arg( regexp, re.errorString() ) ); return QVariant(); } return QVariant( str.replace( re, after ) ); @@ -823,7 +823,7 @@ static QVariant fcnRegexpMatch( const QVariantList& values, const QgsExpressionC QRegExp re( regexp ); if ( !re.isValid() ) { - parent->setEvalErrorString( QObject::tr( "Invalid regular expression '%1': %2" ).arg( regexp ).arg( re.errorString() ) ); + parent->setEvalErrorString( QObject::tr( "Invalid regular expression '%1': %2" ).arg( regexp, re.errorString() ) ); return QVariant(); } return QVariant( str.contains( re ) ? 1 : 0 ); @@ -837,7 +837,7 @@ static QVariant fcnRegexpSubstr( const QVariantList& values, const QgsExpression QRegExp re( regexp ); if ( !re.isValid() ) { - parent->setEvalErrorString( QObject::tr( "Invalid regular expression '%1': %2" ).arg( regexp ).arg( re.errorString() ) ); + parent->setEvalErrorString( QObject::tr( "Invalid regular expression '%1': %2" ).arg( regexp, re.errorString() ) ); return QVariant(); } @@ -2795,7 +2795,7 @@ bool QgsExpression::NodeUnaryOperator::prepare( QgsExpression *parent, const Qgs QString QgsExpression::NodeUnaryOperator::dump() const { - return QString( "%1 %2" ).arg( UnaryOperatorText[mOp] ).arg( mOperand->dump() ); + return QString( "%1 %2" ).arg( UnaryOperatorText[mOp], mOperand->dump() ); } // @@ -3150,7 +3150,7 @@ QString QgsExpression::NodeBinaryOperator::dump() const fmt += rOp && ( rOp->precedence() < precedence() ) ? "(%3)" : "%3"; } - return fmt.arg( mOpLeft->dump() ).arg( BinaryOperatorText[mOp] ).arg( mOpRight->dump() ); + return fmt.arg( mOpLeft->dump(), BinaryOperatorText[mOp], mOpRight->dump() ); } // @@ -3213,7 +3213,7 @@ bool QgsExpression::NodeInOperator::prepare( QgsExpression *parent, const QgsExp QString QgsExpression::NodeInOperator::dump() const { - return QString( "%1 %2 IN (%3)" ).arg( mNode->dump() ).arg( mNotIn ? "NOT" : "" ).arg( mList->dump() ); + return QString( "%1 %2 IN (%3)" ).arg( mNode->dump(), mNotIn ? "NOT" : "", mList->dump() ); } // @@ -3271,9 +3271,9 @@ QString QgsExpression::NodeFunction::dump() const { Function* fd = Functions()[mFnIndex]; if ( fd->params() == 0 ) - return QString( "%1%2" ).arg( fd->name() ).arg( fd->name().startsWith( '$' ) ? "" : "()" ); // special column + return QString( "%1%2" ).arg( fd->name(), fd->name().startsWith( '$' ) ? "" : "()" ); // special column else - return QString( "%1(%2)" ).arg( fd->name() ).arg( mArgs ? mArgs->dump() : QString() ); // function + return QString( "%1(%2)" ).arg( fd->name(), mArgs ? mArgs->dump() : QString() ); // function } QStringList QgsExpression::NodeFunction::referencedColumns() const @@ -3324,7 +3324,7 @@ QString QgsExpression::NodeLiteral::dump() const case QVariant::Double: return QString::number( mValue.toDouble() ); case QVariant::String: return quotedString( mValue.toString() ); case QVariant::Bool: return mValue.toBool() ? "TRUE" : "FALSE"; - default: return tr( "[unsupported type;%1; value:%2]" ).arg( mValue.typeName() ).arg( mValue.toString() ); + default: return tr( "[unsupported type;%1; value:%2]" ).arg( mValue.typeName(), mValue.toString() ); } } @@ -3418,7 +3418,7 @@ QString QgsExpression::NodeCondition::dump() const QString msg( "CASE" ); Q_FOREACH ( WhenThen* cond, mConditions ) { - msg += QString( " WHEN %1 THEN %2" ).arg( cond->mWhenExp->dump() ).arg( cond->mThenExp->dump() ); + msg += QString( " WHEN %1 THEN %2" ).arg( cond->mWhenExp->dump(), cond->mThenExp->dump() ); } if ( mElseExp ) msg += QString( " ELSE %1" ).arg( mElseExp->dump() ); @@ -3476,14 +3476,14 @@ QString QgsExpression::helptext( QString name ) #endif QString helpContents( QString( "

%1

\n

%2

" ) - .arg( tr( "%1 %2" ).arg( f.mType ).arg( name ) ) - .arg( f.mDescription ) ); + .arg( tr( "%1 %2" ).arg( f.mType, name ), + f.mDescription ) ); Q_FOREACH ( const HelpVariant &v, f.mVariants ) { if ( f.mVariants.size() > 1 ) { - helpContents += QString( "

%1

\n
%2

" ).arg( v.mName ).arg( v.mDescription ); + helpContents += QString( "

%1

\n
%2

" ).arg( v.mName, v.mDescription ); } if ( f.mType != tr( "group" ) ) @@ -3494,12 +3494,12 @@ QString QgsExpression::helptext( QString name ) if ( v.mArguments.size() == 1 ) { helpContents += QString( "%1 %2" ) - .arg( name ).arg( v.mArguments[0].mArg ); + .arg( name, v.mArguments[0].mArg ); } else if ( v.mArguments.size() == 2 ) { helpContents += QString( "%1 %2 %3" ) - .arg( v.mArguments[0].mArg ).arg( name ).arg( v.mArguments[1].mArg ); + .arg( v.mArguments[0].mArg, name, v.mArguments[1].mArg ); } } else if ( f.mType != tr( "group" ) ) @@ -3539,7 +3539,7 @@ QString QgsExpression::helptext( QString name ) if ( a.mSyntaxOnly ) continue; - helpContents += QString( "
" ).arg( a.mArg ).arg( a.mDescription ); + helpContents += QString( "" ).arg( a.mArg, a.mDescription ); } helpContents += "
%1
%1%2
%1%2
\n\n"; @@ -3564,7 +3564,7 @@ QString QgsExpression::helptext( QString name ) if ( !v.mNotes.isEmpty() ) { - helpContents += QString( "

%1

\n

%2

\n" ).arg( tr( "Notes" ) ).arg( v.mNotes ); + helpContents += QString( "

%1

\n

%2

\n" ).arg( tr( "Notes" ), v.mNotes ); } } diff --git a/src/core/qgsfontutils.cpp b/src/core/qgsfontutils.cpp index b2cb3a95235..3b49521001a 100644 --- a/src/core/qgsfontutils.cpp +++ b/src/core/qgsfontutils.cpp @@ -239,7 +239,7 @@ bool QgsFontUtils::loadStandardTestFonts( const QStringList& loadstyles ) { continue; } - QString familyStyle = QString( "%1 %2" ).arg( fontFamily ).arg( fontstyle ); + QString familyStyle = QString( "%1 %2" ).arg( fontFamily, fontstyle ); if ( fontFamilyHasStyle( fontFamily, fontstyle ) ) { @@ -260,7 +260,7 @@ bool QgsFontUtils::loadStandardTestFonts( const QStringList& loadstyles ) loaded = ( fontID != -1 ); fontsLoaded = ( fontsLoaded || loaded ); QgsDebugMsg( QString( "Test font '%1' %2 from filesystem [%3]" ) - .arg( familyStyle ).arg( loaded ? "loaded" : "FAILED to load" ).arg( fontPath ) ); + .arg( familyStyle, loaded ? "loaded" : "FAILED to load", fontPath ) ); QFontDatabase db; QgsDebugMsg( QString( "font families in %1: %2" ).arg( fontID ).arg( db.applicationFontFamilies( fontID ).join( "," ) ) ); } @@ -274,7 +274,7 @@ bool QgsFontUtils::loadStandardTestFonts( const QStringList& loadstyles ) fontsLoaded = ( fontsLoaded || loaded ); } QgsDebugMsg( QString( "Test font '%1' %2 from testdata.qrc" ) - .arg( familyStyle ).arg( loaded ? "loaded" : "FAILED to load" ) ); + .arg( familyStyle, loaded ? "loaded" : "FAILED to load" ) ); } } } diff --git a/src/core/qgsgml.cpp b/src/core/qgsgml.cpp index a3c362b8182..72515e1fc7b 100644 --- a/src/core/qgsgml.cpp +++ b/src/core/qgsgml.cpp @@ -98,7 +98,7 @@ int QgsGml::getFeatures( const QString& uri, QGis::WkbType* wkbType, QgsRectangl } else if ( !userName.isNull() || !password.isNull() ) { - request.setRawHeader( "Authorization", "Basic " + QString( "%1:%2" ).arg( userName ).arg( password ).toAscii().toBase64() ); + request.setRawHeader( "Authorization", "Basic " + QString( "%1:%2" ).arg( userName, password ).toAscii().toBase64() ); } QNetworkReply* reply = QgsNetworkAccessManager::instance()->get( request ); diff --git a/src/core/qgsgmlschema.cpp b/src/core/qgsgmlschema.cpp index 603e5ad1db8..6af751efdf3 100644 --- a/src/core/qgsgmlschema.cpp +++ b/src/core/qgsgmlschema.cpp @@ -196,7 +196,7 @@ bool QgsGmlSchema::xsdFeatureClass( const QDomElement &element, const QString & else { // TODO: get type from referenced element - QgsDebugMsg( QString( "field %1.%2 is referencing %3 - not supported" ).arg( typeName ).arg( fieldName ) ); + QgsDebugMsg( QString( "field %1.%2 is referencing %3 - not supported" ).arg( typeName, fieldName ) ); } continue; } @@ -218,7 +218,7 @@ bool QgsGmlSchema::xsdFeatureClass( const QDomElement &element, const QString & QVariant::Type fieldType = QVariant::String; if ( fieldTypeName.isEmpty() ) { - QgsDebugMsg( QString( "Cannot get %1.%2 field type" ).arg( typeName ).arg( fieldName ) ); + QgsDebugMsg( QString( "Cannot get %1.%2 field type" ).arg( typeName, fieldName ) ); } else { @@ -361,7 +361,7 @@ void QgsGmlSchema::startElement( const XML_Char* el, const XML_Char** attr ) mLevel++; QString elementName = QString::fromUtf8( el ); - QgsDebugMsgLevel( QString( "-> %1 %2 %3" ).arg( mLevel ).arg( elementName ).arg( mLevel >= mSkipLevel ? "skip" : "" ), 5 ); + QgsDebugMsgLevel( QString( "-> %1 %2 %3" ).arg( mLevel ).arg( elementName, mLevel >= mSkipLevel ? "skip" : "" ), 5 ); if ( mLevel >= mSkipLevel ) { diff --git a/src/core/qgslegacyhelpers.cpp b/src/core/qgslegacyhelpers.cpp index 8000b7ed131..60fa3688577 100644 --- a/src/core/qgslegacyhelpers.cpp +++ b/src/core/qgslegacyhelpers.cpp @@ -85,8 +85,8 @@ const QString QgsLegacyHelpers::convertEditType( QgsVectorLayer::EditType editTy editTypeElement.hasAttribute( "filterAttributeValue" ) ) { filterExpression = QString( "\"%1\"='%2'" ) - .arg( editTypeElement.attribute( "filterAttributeColumn" ) ) - .arg( editTypeElement.attribute( "filterAttributeValue" ) ); + .arg( editTypeElement.attribute( "filterAttributeColumn" ), + editTypeElement.attribute( "filterAttributeValue" ) ); } else { diff --git a/src/core/qgsmaplayer.cpp b/src/core/qgsmaplayer.cpp index dda96ddd644..110fdd8d547 100644 --- a/src/core/qgsmaplayer.cpp +++ b/src/core/qgsmaplayer.cpp @@ -1046,7 +1046,7 @@ QString QgsMapLayer::loadDefaultStyle( bool & theResultFlag ) bool QgsMapLayer::loadNamedStyleFromDb( const QString &db, const QString &theURI, QString &qml ) { - QgsDebugMsg( QString( "db = %1 uri = %2" ).arg( db ).arg( theURI ) ); + QgsDebugMsg( QString( "db = %1 uri = %2" ).arg( db, theURI ) ); bool theResultFlag = false; @@ -1056,7 +1056,7 @@ bool QgsMapLayer::loadNamedStyleFromDb( const QString &db, const QString &theURI const char *myTail; int myResult; - QgsDebugMsg( QString( "Trying to load style for \"%1\" from \"%2\"" ).arg( theURI ).arg( db ) ); + QgsDebugMsg( QString( "Trying to load style for \"%1\" from \"%2\"" ).arg( theURI, db ) ); if ( db.isEmpty() || !QFile( db ).exists() ) return false; @@ -1091,7 +1091,7 @@ bool QgsMapLayer::loadNamedStyleFromDb( const QString &db, const QString &theURI QString QgsMapLayer::loadNamedStyle( const QString &theURI, bool &theResultFlag ) { - QgsDebugMsg( QString( "uri = %1 myURI = %2" ).arg( theURI ).arg( publicSource() ) ); + QgsDebugMsg( QString( "uri = %1 myURI = %2" ).arg( theURI, publicSource() ) ); theResultFlag = false; @@ -1139,7 +1139,7 @@ QString QgsMapLayer::loadNamedStyle( const QString &theURI, bool &theResultFlag theResultFlag = importNamedStyle( myDocument, myErrorMessage ); if ( !theResultFlag ) - myErrorMessage = tr( "Loading style file %1 failed because:\n%2" ).arg( theURI ).arg( myErrorMessage ); + myErrorMessage = tr( "Loading style file %1 failed because:\n%2" ).arg( theURI, myErrorMessage ); return myErrorMessage; } @@ -1524,7 +1524,7 @@ QString QgsMapLayer::loadSldStyle( const QString &theURI, bool &theResultFlag ) theResultFlag = readSld( namedLayerElem, errorMsg ); if ( !theResultFlag ) { - myErrorMessage = tr( "Loading style file %1 failed because:\n%2" ).arg( theURI ).arg( errorMsg ); + myErrorMessage = tr( "Loading style file %1 failed because:\n%2" ).arg( theURI, errorMsg ); return myErrorMessage; } diff --git a/src/core/qgsmaprenderer.cpp b/src/core/qgsmaprenderer.cpp index 5603aa5a6b0..4e39c8d4db0 100644 --- a/src/core/qgsmaprenderer.cpp +++ b/src/core/qgsmaprenderer.cpp @@ -205,9 +205,9 @@ void QgsMapRenderer::adjustExtentToSize() dymax = mExtent.yMaximum() + whitespace; } - QgsDebugMsg( QString( "Map units per pixel (x,y) : %1, %2" ).arg( qgsDoubleToString( mapUnitsPerPixelX ) ).arg( qgsDoubleToString( mapUnitsPerPixelY ) ) ); - QgsDebugMsg( QString( "Pixmap dimensions (x,y) : %1, %2" ).arg( qgsDoubleToString( myWidth ) ).arg( qgsDoubleToString( myHeight ) ) ); - QgsDebugMsg( QString( "Extent dimensions (x,y) : %1, %2" ).arg( qgsDoubleToString( mExtent.width() ) ).arg( qgsDoubleToString( mExtent.height() ) ) ); + QgsDebugMsg( QString( "Map units per pixel (x,y) : %1, %2" ).arg( qgsDoubleToString( mapUnitsPerPixelX ), qgsDoubleToString( mapUnitsPerPixelY ) ) ); + QgsDebugMsg( QString( "Pixmap dimensions (x,y) : %1, %2" ).arg( qgsDoubleToString( myWidth ), qgsDoubleToString( myHeight ) ) ); + QgsDebugMsg( QString( "Extent dimensions (x,y) : %1, %2" ).arg( qgsDoubleToString( mExtent.width() ), qgsDoubleToString( mExtent.height() ) ) ); QgsDebugMsg( mExtent.toString() ); // update extent @@ -216,9 +216,9 @@ void QgsMapRenderer::adjustExtentToSize() mExtent.setYMinimum( dymin ); mExtent.setYMaximum( dymax ); - QgsDebugMsg( QString( "Adjusted map units per pixel (x,y) : %1, %2" ).arg( qgsDoubleToString( mExtent.width() / myWidth ) ).arg( qgsDoubleToString( mExtent.height() / myHeight ) ) ); + QgsDebugMsg( QString( "Adjusted map units per pixel (x,y) : %1, %2" ).arg( qgsDoubleToString( mExtent.width() / myWidth ), qgsDoubleToString( mExtent.height() / myHeight ) ) ); - QgsDebugMsg( QString( "Recalced pixmap dimensions (x,y) : %1, %2" ).arg( qgsDoubleToString( mExtent.width() / mMapUnitsPerPixel ) ).arg( qgsDoubleToString( mExtent.height() / mMapUnitsPerPixel ) ) ); + QgsDebugMsg( QString( "Recalced pixmap dimensions (x,y) : %1, %2" ).arg( qgsDoubleToString( mExtent.width() / mMapUnitsPerPixel ), qgsDoubleToString( mExtent.height() / mMapUnitsPerPixel ) ) ); // update the scale updateScale(); diff --git a/src/core/qgsmapsettings.cpp b/src/core/qgsmapsettings.cpp index fbcbd8566b1..189deea4317 100644 --- a/src/core/qgsmapsettings.cpp +++ b/src/core/qgsmapsettings.cpp @@ -183,12 +183,12 @@ void QgsMapSettings::updateDerived() } #endif - QgsDebugMsg( QString( "Map units per pixel (x,y) : %1, %2" ).arg( qgsDoubleToString( mapUnitsPerPixelX ) ).arg( qgsDoubleToString( mapUnitsPerPixelY ) ) ); - QgsDebugMsg( QString( "Pixmap dimensions (x,y) : %1, %2" ).arg( qgsDoubleToString( mSize.width() ) ).arg( qgsDoubleToString( mSize.height() ) ) ); - QgsDebugMsg( QString( "Extent dimensions (x,y) : %1, %2" ).arg( qgsDoubleToString( mExtent.width() ) ).arg( qgsDoubleToString( mExtent.height() ) ) ); + QgsDebugMsg( QString( "Map units per pixel (x,y) : %1, %2" ).arg( qgsDoubleToString( mapUnitsPerPixelX ), qgsDoubleToString( mapUnitsPerPixelY ) ) ); + QgsDebugMsg( QString( "Pixmap dimensions (x,y) : %1, %2" ).arg( qgsDoubleToString( mSize.width() ), qgsDoubleToString( mSize.height() ) ) ); + QgsDebugMsg( QString( "Extent dimensions (x,y) : %1, %2" ).arg( qgsDoubleToString( mExtent.width() ), qgsDoubleToString( mExtent.height() ) ) ); QgsDebugMsg( mExtent.toString() ); - QgsDebugMsg( QString( "Adjusted map units per pixel (x,y) : %1, %2" ).arg( qgsDoubleToString( mVisibleExtent.width() / myWidth ) ).arg( qgsDoubleToString( mVisibleExtent.height() / myHeight ) ) ); - QgsDebugMsg( QString( "Recalced pixmap dimensions (x,y) : %1, %2" ).arg( qgsDoubleToString( mVisibleExtent.width() / mMapUnitsPerPixel ) ).arg( qgsDoubleToString( mVisibleExtent.height() / mMapUnitsPerPixel ) ) ); + QgsDebugMsg( QString( "Adjusted map units per pixel (x,y) : %1, %2" ).arg( qgsDoubleToString( mVisibleExtent.width() / myWidth ), qgsDoubleToString( mVisibleExtent.height() / myHeight ) ) ); + QgsDebugMsg( QString( "Recalced pixmap dimensions (x,y) : %1, %2" ).arg( qgsDoubleToString( mVisibleExtent.width() / mMapUnitsPerPixel ), qgsDoubleToString( mVisibleExtent.height() / mMapUnitsPerPixel ) ) ); QgsDebugMsg( QString( "Scale (assuming meters as map units) = 1:%1" ).arg( qgsDoubleToString( mScale ) ) ); QgsDebugMsg( QString( "Rotation: %1 degrees" ).arg( mRotation ) ); diff --git a/src/core/qgsmessagelog.cpp b/src/core/qgsmessagelog.cpp index 870fd05fb06..a6e0e827d70 100644 --- a/src/core/qgsmessagelog.cpp +++ b/src/core/qgsmessagelog.cpp @@ -42,7 +42,7 @@ QgsMessageLog *QgsMessageLog::instance() void QgsMessageLog::logMessage( const QString& message, const QString& tag, QgsMessageLog::MessageLevel level ) { - QgsDebugMsg( QString( "%1 %2[%3] %4" ).arg( QDateTime::currentDateTime().toString( Qt::ISODate ) ).arg( tag ).arg( level ).arg( message ) ); + QgsDebugMsg( QString( "%1 %2[%3] %4" ).arg( QDateTime::currentDateTime().toString( Qt::ISODate ), tag ).arg( level ).arg( message ) ); QgsMessageLog::instance()->emitMessage( message, tag, level ); } diff --git a/src/core/qgsmimedatautils.cpp b/src/core/qgsmimedatautils.cpp index 214ae2f20c8..518d28f1ba7 100644 --- a/src/core/qgsmimedatautils.cpp +++ b/src/core/qgsmimedatautils.cpp @@ -66,9 +66,9 @@ QgsMimeDataUtils::Uri::Uri( QString& encData ) } QgsDebugMsg( QString( "type:%1 key:%2 name:%3 uri:%4 supportedCRS:%5 supportedFormats:%6" ) - .arg( layerType ).arg( providerKey ).arg( name ).arg( uri ) - .arg( supportedCrs.join( ", " ) ) - .arg( supportedFormats.join( ", " ) ) ); + .arg( layerType, providerKey, name, uri, + supportedCrs.join( ", " ), + supportedFormats.join( ", " ) ) ); } QString QgsMimeDataUtils::Uri::data() const diff --git a/src/core/qgsnetworkaccessmanager.cpp b/src/core/qgsnetworkaccessmanager.cpp index 19a64448b92..e7b98654e8b 100644 --- a/src/core/qgsnetworkaccessmanager.cpp +++ b/src/core/qgsnetworkaccessmanager.cpp @@ -71,7 +71,7 @@ class QgsNetworkProxyFactory : public QNetworkProxyFactory { if ( url.startsWith( exclude ) ) { - QgsDebugMsg( QString( "using default proxy for %1 [exclude %2]" ).arg( url ).arg( exclude ) ); + QgsDebugMsg( QString( "using default proxy for %1 [exclude %2]" ).arg( url, exclude ) ); return QList() << QNetworkProxy(); } } @@ -147,11 +147,11 @@ void QgsNetworkAccessManager::setFallbackProxyAndExcludes( const QNetworkProxy & proxy.type() == QNetworkProxy::HttpProxy ? "HttpProxy" : proxy.type() == QNetworkProxy::HttpCachingProxy ? "HttpCachingProxy" : proxy.type() == QNetworkProxy::FtpCachingProxy ? "FtpCachingProxy" : - "Undefined" ) - .arg( proxy.hostName() ) + "Undefined", + proxy.hostName() ) .arg( proxy.port() ) - .arg( proxy.user() ) - .arg( proxy.password().isEmpty() ? "not set" : "set" ) ); + .arg( proxy.user(), + proxy.password().isEmpty() ? "not set" : "set" ) ); mFallbackProxy = proxy; mExcludedURLs = excludes; @@ -349,7 +349,7 @@ void QgsNetworkAccessManager::setupDefaultProxyAndCache() QgsDebugMsg( QString( "setting proxy %1 %2:%3 %4/%5" ) .arg( proxyType ) .arg( proxyHost ).arg( proxyPort ) - .arg( proxyUser ).arg( proxyPassword ) + .arg( proxyUser, proxyPassword ) ); proxy = QNetworkProxy( proxyType, proxyHost, proxyPort, proxyUser, proxyPassword ); } diff --git a/src/core/qgsnetworkcontentfetcher.cpp b/src/core/qgsnetworkcontentfetcher.cpp index 6413f8ff0de..cb702e58c07 100644 --- a/src/core/qgsnetworkcontentfetcher.cpp +++ b/src/core/qgsnetworkcontentfetcher.cpp @@ -132,7 +132,7 @@ void QgsNetworkContentFetcher::contentLoaded( bool ok ) if ( mReply->error() != QNetworkReply::NoError ) { - QgsMessageLog::logMessage( tr( "HTTP fetch %1 failed with error %2" ).arg( mReply->url().toString() ).arg( mReply->errorString() ) ); + QgsMessageLog::logMessage( tr( "HTTP fetch %1 failed with error %2" ).arg( mReply->url().toString(), mReply->errorString() ) ); mContentLoaded = true; emit finished(); return; @@ -145,7 +145,7 @@ void QgsNetworkContentFetcher::contentLoaded( bool ok ) QVariant status = mReply->attribute( QNetworkRequest::HttpStatusCodeAttribute ); if ( !status.isNull() && status.toInt() >= 400 ) { - QgsMessageLog::logMessage( tr( "HTTP fetch %1 failed with error %2" ).arg( mReply->url().toString() ).arg( status.toString() ) ); + QgsMessageLog::logMessage( tr( "HTTP fetch %1 failed with error %2" ).arg( mReply->url().toString(), status.toString() ) ); } mContentLoaded = true; emit finished(); diff --git a/src/core/qgsofflineediting.cpp b/src/core/qgsofflineediting.cpp index e1992fe11c9..0191e8d44bf 100644 --- a/src/core/qgsofflineediting.cpp +++ b/src/core/qgsofflineediting.cpp @@ -484,10 +484,10 @@ QgsVectorLayer* QgsOfflineEditing::copyVectorLayer( QgsVectorLayer* layer, sqlit } else { - showWarning( tr( "%1: Unknown data type %2. Not using type affinity for the field." ).arg( fields[idx].name() ).arg( QVariant::typeToName( type ) ) ); + showWarning( tr( "%1: Unknown data type %2. Not using type affinity for the field." ).arg( fields[idx].name(), QVariant::typeToName( type ) ) ); } - sql += delim + QString( "'%1' %2" ).arg( fields[idx].name() ).arg( dataType ); + sql += delim + QString( "'%1' %2" ).arg( fields[idx].name(), dataType ); delim = ","; } sql += ")"; @@ -544,8 +544,8 @@ QgsVectorLayer* QgsOfflineEditing::copyVectorLayer( QgsVectorLayer* layer, sqlit { // add new layer QgsVectorLayer* newLayer = new QgsVectorLayer( QString( "dbname='%1' table='%2'%3 sql=" ) - .arg( offlineDbPath ) - .arg( tableName ).arg( layer->hasGeometryType() ? "(Geometry)" : "" ), + .arg( offlineDbPath, + tableName, layer->hasGeometryType() ? "(Geometry)" : "" ), layer->name() + " (offline)", "spatialite" ); if ( newLayer->isValid() ) { diff --git a/src/core/qgsogcutils.cpp b/src/core/qgsogcutils.cpp index 503bcbdf5aa..d879682176e 100644 --- a/src/core/qgsogcutils.cpp +++ b/src/core/qgsogcutils.cpp @@ -82,7 +82,7 @@ QgsGeometry* QgsOgcUtils::geometryFromGML( const QDomNode& geometryNode ) QgsGeometry* QgsOgcUtils::geometryFromGML( const QString& xmlString ) { // wrap the string into a root tag to have "gml" namespace (and also as a default namespace) - QString xml = QString( "%2" ).arg( GML_NAMESPACE ).arg( xmlString ); + QString xml = QString( "%2" ).arg( GML_NAMESPACE, xmlString ); QDomDocument doc; if ( !doc.setContent( xml, true ) ) return 0; diff --git a/src/core/qgspallabeling.cpp b/src/core/qgspallabeling.cpp index 0f4af05bb04..647fb6dcb22 100644 --- a/src/core/qgspallabeling.cpp +++ b/src/core/qgspallabeling.cpp @@ -2613,7 +2613,7 @@ void QgsPalLayerSettings::registerFeature( QgsFeature& f, QgsRenderContext &cont ( *labelFeature )->setLabelText( labelText ); // store the label's calculated font for later use during painting - QgsDebugMsgLevel( QString( "PAL font stored definedFont: %1, Style: %2" ).arg( labelFont.toString() ).arg( labelFont.styleName() ), 4 ); + QgsDebugMsgLevel( QString( "PAL font stored definedFont: %1, Style: %2" ).arg( labelFont.toString(), labelFont.styleName() ), 4 ); lf->setDefinedFont( labelFont ); // TODO: only for placement which needs character info diff --git a/src/core/qgspoint.cpp b/src/core/qgspoint.cpp index 37773e13bca..9d23135cdd7 100644 --- a/src/core/qgspoint.cpp +++ b/src/core/qgspoint.cpp @@ -136,7 +136,7 @@ QString QgsPoint::toString( int thePrecision ) const { QString x = qIsFinite( m_x ) ? QString::number( m_x, 'f', thePrecision ) : QObject::tr( "infinite" ); QString y = qIsFinite( m_y ) ? QString::number( m_y, 'f', thePrecision ) : QObject::tr( "infinite" ); - return QString( "%1,%2" ).arg( x ).arg( y ); + return QString( "%1,%2" ).arg( x, y ); } QString QgsPoint::toDegreesMinutesSeconds( int thePrecision, const bool useSuffix, const bool padded ) const @@ -339,7 +339,7 @@ QString QgsPoint::toDegreesMinutes( int thePrecision, const bool useSuffix, cons QString QgsPoint::wellKnownText() const { - return QString( "POINT(%1 %2)" ).arg( qgsDoubleToString( m_x ) ).arg( qgsDoubleToString( m_y ) ); + return QString( "POINT(%1 %2)" ).arg( qgsDoubleToString( m_x ), qgsDoubleToString( m_y ) ); } double QgsPoint::sqrDist( double x, double y ) const diff --git a/src/core/qgsproject.cpp b/src/core/qgsproject.cpp index 3dbbba5aa33..b138afc2cd3 100644 --- a/src/core/qgsproject.cpp +++ b/src/core/qgsproject.cpp @@ -804,7 +804,7 @@ bool QgsProject::read() imp_->file.close(); - setError( tr( "%1 for file %2" ).arg( errorString ).arg( imp_->file.fileName() ) ); + setError( tr( "%1 for file %2" ).arg( errorString, imp_->file.fileName() ) ); return false; } diff --git a/src/core/qgsprojectproperty.cpp b/src/core/qgsprojectproperty.cpp index 73a2c3bc211..51b23a7d750 100644 --- a/src/core/qgsprojectproperty.cpp +++ b/src/core/qgsprojectproperty.cpp @@ -32,12 +32,12 @@ void QgsPropertyValue::dump( int tabs ) const for ( QStringList::const_iterator i = sl.begin(); i != sl.end(); ++i ) { - QgsDebugMsg( QString( "%1[%2] " ).arg( tabString ).arg( *i ) ); + QgsDebugMsg( QString( "%1[%2] " ).arg( tabString, *i ) ); } } else { - QgsDebugMsg( QString( "%1%2" ).arg( tabString ).arg( value_.toString() ) ); + QgsDebugMsg( QString( "%1%2" ).arg( tabString, value_.toString() ) ); } } // QgsPropertyValue::dump() @@ -293,7 +293,7 @@ void QgsPropertyKey::dump( int tabs ) const tabString.fill( '\t', tabs ); - QgsDebugMsg( QString( "%1name: %2" ).arg( tabString ).arg( name() ) ); + QgsDebugMsg( QString( "%1name: %2" ).arg( tabString, name() ) ); tabs++; tabString.fill( '\t', tabs ); @@ -309,20 +309,20 @@ void QgsPropertyKey::dump( int tabs ) const if ( QVariant::StringList == propertyValue->value().type() ) { - QgsDebugMsg( QString( "%1key: <%2> value:" ).arg( tabString ).arg( i.key() ) ); + QgsDebugMsg( QString( "%1key: <%2> value:" ).arg( tabString, i.key() ) ); propertyValue->dump( tabs + 1 ); } else { - QgsDebugMsg( QString( "%1key: <%2> value: %3" ).arg( tabString ).arg( i.key() ).arg( propertyValue->value().toString() ) ); + QgsDebugMsg( QString( "%1key: <%2> value: %3" ).arg( tabString, i.key(), propertyValue->value().toString() ) ); } } else { QgsDebugMsg( QString( "%1key: <%2> subkey: <%3>" ) - .arg( tabString ) - .arg( i.key() ) - .arg( dynamic_cast( i.value() )->name() ) ); + .arg( tabString, + i.key(), + dynamic_cast( i.value() )->name() ) ); i.value()->dump( tabs + 1 ); } diff --git a/src/core/qgsproviderregistry.cpp b/src/core/qgsproviderregistry.cpp index d2b6b5ebc60..f9a096d7473 100644 --- a/src/core/qgsproviderregistry.cpp +++ b/src/core/qgsproviderregistry.cpp @@ -119,7 +119,7 @@ QgsProviderRegistry::QgsProviderRegistry( const QString& pluginPath ) QLibrary myLib( fi.filePath() ); if ( !myLib.load() ) { - QgsDebugMsg( QString( "Checking %1: ...invalid (lib not loadable): %2" ).arg( myLib.fileName() ).arg( myLib.errorString() ) ); + QgsDebugMsg( QString( "Checking %1: ...invalid (lib not loadable): %2" ).arg( myLib.fileName(), myLib.errorString() ) ); continue; } @@ -369,7 +369,7 @@ QgsDataProvider *QgsProviderRegistry::provider( QString const & providerKey, QSt QgsDebugMsg( "Library name is " + myLib.fileName() ); if ( !myLib.load() ) { - QgsMessageLog::logMessage( QObject::tr( "Failed to load %1: %2" ).arg( lib ).arg( myLib.errorString() ) ); + QgsMessageLog::logMessage( QObject::tr( "Failed to load %1: %2" ).arg( lib, myLib.errorString() ) ); return 0; } diff --git a/src/core/qgsrenderchecker.cpp b/src/core/qgsrenderchecker.cpp index 75585e79d49..7741d915612 100644 --- a/src/core/qgsrenderchecker.cpp +++ b/src/core/qgsrenderchecker.cpp @@ -125,11 +125,11 @@ bool QgsRenderChecker::isKnownAnomaly( const QString& theDiffImageFile ) QString myAnomalyHash = imageToHash( controlImagePath() + mControlName + "/" + myFile ); QString myHashMessage = QString( "Checking if anomaly %1 (hash %2)
" ) - .arg( myFile ) - .arg( myAnomalyHash ); + .arg( myFile, + myAnomalyHash ); myHashMessage += QString( "  matches %1 (hash %2)" ) - .arg( theDiffImageFile ) - .arg( myImageHash ); + .arg( theDiffImageFile, + myImageHash ); //foo CDash emitDashMessage( "Anomaly check", QgsDartMeasurement::Text, myHashMessage ); @@ -232,10 +232,10 @@ bool QgsRenderChecker::runTest( const QString& theTestName, QTextStream stream( &wldFile ); stream << QString( "%1\r\n0 \r\n0 \r\n%2\r\n%3\r\n%4\r\n" ) - .arg( qgsDoubleToString( mMapSettings.mapUnitsPerPixel() ) ) - .arg( qgsDoubleToString( -mMapSettings.mapUnitsPerPixel() ) ) - .arg( qgsDoubleToString( r.xMinimum() + mMapSettings.mapUnitsPerPixel() / 2.0 ) ) - .arg( qgsDoubleToString( r.yMaximum() - mMapSettings.mapUnitsPerPixel() / 2.0 ) ); + .arg( qgsDoubleToString( mMapSettings.mapUnitsPerPixel() ), + qgsDoubleToString( -mMapSettings.mapUnitsPerPixel() ), + qgsDoubleToString( r.xMinimum() + mMapSettings.mapUnitsPerPixel() / 2.0 ), + qgsDoubleToString( r.yMaximum() - mMapSettings.mapUnitsPerPixel() / 2.0 ) ); } return compareImages( theTestName, theMismatchCount ); @@ -349,10 +349,10 @@ bool QgsRenderChecker::compareImages( const QString& theTestName, "" "\n" "\n" ) - .arg( theTestName ) - .arg( myDiffImageFile ) - .arg( mRenderedImageFile ) - .arg( mExpectedImageFile ) + .arg( theTestName, + myDiffImageFile, + mRenderedImageFile, + mExpectedImageFile ) .arg( imgWidth ).arg( imgHeight ) .arg( renderCounter++ ); diff --git a/src/core/qgsrenderchecker.h b/src/core/qgsrenderchecker.h index 3e74aa16f41..bbf7e8ae03a 100644 --- a/src/core/qgsrenderchecker.h +++ b/src/core/qgsrenderchecker.h @@ -202,14 +202,14 @@ class CORE_EXPORT QgsRenderChecker inline bool compareWkt( const QString& a, const QString& b, double tolerance = 0.000001 ) { - QgsDebugMsg( QString( "a:%1 b:%2 tol:%3" ).arg( a ).arg( b ).arg( tolerance ) ); + QgsDebugMsg( QString( "a:%1 b:%2 tol:%3" ).arg( a, b ).arg( tolerance ) ); QRegExp re( "-?\\d+(?:\\.\\d+)?(?:[eE]\\d+)?" ); QString a0( a ), b0( b ); a0.replace( re, "#" ); b0.replace( re, "#" ); - QgsDebugMsg( QString( "a0:%1 b0:%2" ).arg( a0 ).arg( b0 ) ); + QgsDebugMsg( QString( "a0:%1 b0:%2" ).arg( a0, b0 ) ); if ( a0 != b0 ) return false; diff --git a/src/core/qgsscaleutils.cpp b/src/core/qgsscaleutils.cpp index bdbffb1934b..49c3b9b0963 100644 --- a/src/core/qgsscaleutils.cpp +++ b/src/core/qgsscaleutils.cpp @@ -36,7 +36,7 @@ bool QgsScaleUtils::saveScaleList( const QString &fileName, const QStringList &s QFile file( fileName ); if ( !file.open( QIODevice::WriteOnly | QIODevice::Text ) ) { - errorMessage = QString( "Cannot write file %1:\n%2." ).arg( fileName ).arg( file.errorString() ); + errorMessage = QString( "Cannot write file %1:\n%2." ).arg( fileName, file.errorString() ); return false; } @@ -50,7 +50,7 @@ bool QgsScaleUtils::loadScaleList( const QString &fileName, QStringList &scales, QFile file( fileName ); if ( !file.open( QIODevice::ReadOnly | QIODevice::Text ) ) { - errorMessage = QString( "Cannot read file %1:\n%2." ).arg( fileName ).arg( file.errorString() ); + errorMessage = QString( "Cannot read file %1:\n%2." ).arg( fileName, file.errorString() ); return false; } diff --git a/src/core/qgsvectordataprovider.cpp b/src/core/qgsvectordataprovider.cpp index 4ec9b47b720..3ecf1376116 100644 --- a/src/core/qgsvectordataprovider.cpp +++ b/src/core/qgsvectordataprovider.cpp @@ -252,8 +252,8 @@ bool QgsVectorDataProvider::supportedType( const QgsField &field ) const { int i; QgsDebugMsgLevel( QString( "field name = %1 type = %2 length = %3 precision = %4" ) - .arg( field.name() ) - .arg( QVariant::typeToName( field.type() ) ) + .arg( field.name(), + QVariant::typeToName( field.type() ) ) .arg( field.length() ) .arg( field.precision() ), 2 ); for ( i = 0; i < mNativeTypes.size(); i++ ) diff --git a/src/core/qgsvectorfilewriter.cpp b/src/core/qgsvectorfilewriter.cpp index 616953d0cb2..04b4a995c2d 100644 --- a/src/core/qgsvectorfilewriter.cpp +++ b/src/core/qgsvectorfilewriter.cpp @@ -126,8 +126,8 @@ QgsVectorFileWriter::QgsVectorFileWriter( if ( !poDriver ) { mErrorMessage = QObject::tr( "OGR driver for '%1' not found (OGR error: %2)" ) - .arg( driverName ) - .arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ); + .arg( driverName, + QString::fromUtf8( CPLGetLastErrorMsg() ) ); mError = ErrDriverNotFound; return; } @@ -439,8 +439,8 @@ QgsVectorFileWriter::QgsVectorFileWriter( { QgsDebugMsg( "error creating field " + attrField.name() ); mErrorMessage = QObject::tr( "creation of field %1 failed (OGR error: %2)" ) - .arg( attrField.name() ) - .arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ); + .arg( attrField.name(), + QString::fromUtf8( CPLGetLastErrorMsg() ) ); mError = ErrAttributeCreationFailed; OGR_Fld_Destroy( fld ); return; @@ -475,8 +475,8 @@ QgsVectorFileWriter::QgsVectorFileWriter( { QgsDebugMsg( "error creating field " + attrField.name() ); mErrorMessage = QObject::tr( "created field %1 not found (OGR error: %2)" ) - .arg( attrField.name() ) - .arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ); + .arg( attrField.name(), + QString::fromUtf8( CPLGetLastErrorMsg() ) ); mError = ErrAttributeCreationFailed; return; } @@ -1713,8 +1713,8 @@ OGRFeatureH QgsVectorFileWriter::createFeature( QgsFeature& feature ) mErrorMessage = QObject::tr( "Invalid variant type for field %1[%2]: received %3 with type %4" ) .arg( mFields[fldIdx].name() ) .arg( ogrField ) - .arg( attrValue.typeName() ) - .arg( attrValue.toString() ); + .arg( attrValue.typeName(), + attrValue.toString() ); QgsMessageLog::logMessage( mErrorMessage, QObject::tr( "OGR" ) ); mError = ErrFeatureWriteFailed; return 0; @@ -2123,7 +2123,7 @@ bool QgsVectorFileWriter::deleteShapeFile( const QString& theFileName ) QFile f( dir.canonicalPath() + "/" + file ); if ( !f.remove( ) ) { - QgsDebugMsg( QString( "Removing file %1 failed: %2" ).arg( file ).arg( f.errorString() ) ); + QgsDebugMsg( QString( "Removing file %1 failed: %2" ).arg( file, f.errorString() ) ); ok = false; } } diff --git a/src/core/qgsvectorlayer.cpp b/src/core/qgsvectorlayer.cpp index b166376194f..8ccb29573a9 100644 --- a/src/core/qgsvectorlayer.cpp +++ b/src/core/qgsvectorlayer.cpp @@ -3789,7 +3789,7 @@ QString QgsVectorLayer::metadata() } myMetadata += tr( "xMin,yMin %1,%2 : xMax,yMax %3,%4" ) - .arg( xMin ).arg( yMin ).arg( xMax ).arg( yMax ); + .arg( xMin, yMin, xMax, yMax ); } else { @@ -4049,7 +4049,7 @@ int QgsVectorLayer::listStylesInDatabase( QStringList &ids, QStringList &names, if ( !listStylesExternalMethod ) { delete myLib; - msgError = QObject::tr( "Provider %1 has no %2 method" ).arg( mProviderKey ).arg( "listStyles" ); + msgError = QObject::tr( "Provider %1 has no %2 method" ).arg( mProviderKey, "listStyles" ); return -1; } @@ -4070,7 +4070,7 @@ QString QgsVectorLayer::getStyleFromDatabase( const QString& styleId, QString &m if ( !getStyleByIdMethod ) { delete myLib; - msgError = QObject::tr( "Provider %1 has no %2 method" ).arg( mProviderKey ).arg( "getStyleById" ); + msgError = QObject::tr( "Provider %1 has no %2 method" ).arg( mProviderKey, "getStyleById" ); return QObject::tr( "" ); } @@ -4095,7 +4095,7 @@ void QgsVectorLayer::saveStyleToDatabase( const QString& name, const QString& de if ( !saveStyleExternalMethod ) { delete myLib; - msgError = QObject::tr( "Provider %1 has no %2 method" ).arg( mProviderKey ).arg( "saveStyle" ); + msgError = QObject::tr( "Provider %1 has no %2 method" ).arg( mProviderKey, "saveStyle" ); return; } diff --git a/src/core/qgsvectorlayereditbuffer.cpp b/src/core/qgsvectorlayereditbuffer.cpp index fb61de9aea2..adf5ffd9301 100644 --- a/src/core/qgsvectorlayereditbuffer.cpp +++ b/src/core/qgsvectorlayereditbuffer.cpp @@ -367,17 +367,17 @@ bool QgsVectorLayerEditBuffer::commitChanges( QStringList& commitErrors ) << tr( "Provider: %1" ).arg( L->providerType() ) << tr( "Storage: %1" ).arg( L->storageType() ) << QString( "%1: name=%2 type=%3 typeName=%4 len=%5 precision=%6" ) - .arg( tr( "expected field" ) ) - .arg( oldField.name() ) - .arg( QVariant::typeToName( oldField.type() ) ) - .arg( oldField.typeName() ) + .arg( tr( "expected field" ), + oldField.name(), + QVariant::typeToName( oldField.type() ), + oldField.typeName() ) .arg( oldField.length() ) .arg( oldField.precision() ) << QString( "%1: name=%2 type=%3 typeName=%4 len=%5 precision=%6" ) - .arg( tr( "retrieved field" ) ) - .arg( newField.name() ) - .arg( QVariant::typeToName( newField.type() ) ) - .arg( newField.typeName() ) + .arg( tr( "retrieved field" ), + newField.name(), + QVariant::typeToName( newField.type() ), + newField.typeName() ) .arg( newField.length() ) .arg( newField.precision() ); attributeChangesOk = false; // don't try attribute updates - they'll fail. diff --git a/src/core/qgsvectorlayerimport.cpp b/src/core/qgsvectorlayerimport.cpp index 36e1b3712f7..76e45f921ea 100644 --- a/src/core/qgsvectorlayerimport.cpp +++ b/src/core/qgsvectorlayerimport.cpp @@ -72,7 +72,7 @@ QgsVectorLayerImport::QgsVectorLayerImport( const QString &uri, { delete myLib; mError = ErrProviderUnsupportedFeature; - mErrorMessage = QObject::tr( "Provider %1 has no %2 method" ).arg( providerKey ).arg( "createEmptyLayer" ); + mErrorMessage = QObject::tr( "Provider %1 has no %2 method" ).arg( providerKey, "createEmptyLayer" ); return; } diff --git a/src/core/qgsvectorlayerlabelprovider.cpp b/src/core/qgsvectorlayerlabelprovider.cpp index 13cfdd0fe43..c3264edec07 100644 --- a/src/core/qgsvectorlayerlabelprovider.cpp +++ b/src/core/qgsvectorlayerlabelprovider.cpp @@ -296,8 +296,8 @@ void QgsVectorLayerLabelProvider::drawLabel( QgsRenderContext& context, pal::Lab //font QFont dFont = lf->definedFont(); - QgsDebugMsgLevel( QString( "PAL font tmpLyr: %1, Style: %2" ).arg( tmpLyr.textFont.toString() ).arg( tmpLyr.textFont.styleName() ), 4 ); - QgsDebugMsgLevel( QString( "PAL font definedFont: %1, Style: %2" ).arg( dFont.toString() ).arg( dFont.styleName() ), 4 ); + QgsDebugMsgLevel( QString( "PAL font tmpLyr: %1, Style: %2" ).arg( tmpLyr.textFont.toString(), tmpLyr.textFont.styleName() ), 4 ); + QgsDebugMsgLevel( QString( "PAL font definedFont: %1, Style: %2" ).arg( dFont.toString(), dFont.styleName() ), 4 ); tmpLyr.textFont = dFont; if ( tmpLyr.multilineAlign == QgsPalLayerSettings::MultiFollowPlacement ) diff --git a/src/core/raster/qgsrasterchecker.cpp b/src/core/raster/qgsrasterchecker.cpp index e15f26b985e..247ed703301 100644 --- a/src/core/raster/qgsrasterchecker.cpp +++ b/src/core/raster/qgsrasterchecker.cpp @@ -48,7 +48,7 @@ bool QgsRasterChecker::runTest( const QString& theVerifiedKey, QString theVerifi QgsRasterDataProvider* verifiedProvider = ( QgsRasterDataProvider* ) QgsProviderRegistry::instance()->provider( theVerifiedKey, theVerifiedUri ); if ( !verifiedProvider || !verifiedProvider->isValid() ) { - error( QString( "Cannot load provider %1 with URI: %2" ).arg( theVerifiedKey ).arg( theVerifiedUri ), mReport ); + error( QString( "Cannot load provider %1 with URI: %2" ).arg( theVerifiedKey, theVerifiedUri ), mReport ); ok = false; } @@ -56,7 +56,7 @@ bool QgsRasterChecker::runTest( const QString& theVerifiedKey, QString theVerifi QgsRasterDataProvider* expectedProvider = ( QgsRasterDataProvider* ) QgsProviderRegistry::instance()->provider( theExpectedKey, theExpectedUri ); if ( !expectedProvider || !expectedProvider->isValid() ) { - error( QString( "Cannot load provider %1 with URI: %2" ).arg( theExpectedKey ).arg( theExpectedUri ), mReport ); + error( QString( "Cannot load provider %1 with URI: %2" ).arg( theExpectedKey, theExpectedUri ), mReport ); ok = false; } @@ -130,9 +130,9 @@ bool QgsRasterChecker::runTest( const QString& theVerifiedKey, QString theVerifi mReport += ""; mReport += ""; - mReport += QString( "" ).arg( mCellStyle ).arg( mOkStyle ); + mReport += QString( "" ).arg( mCellStyle, mOkStyle ); mReport += ""; - mReport += QString( "" ).arg( mCellStyle ).arg( mErrStyle ); + mReport += QString( "" ).arg( mCellStyle, mErrStyle ); mReport += "
Data comparisoncorrect valuecorrect valuewrong value
expected value
wrong value
expected value
"; mReport += "
"; @@ -171,7 +171,7 @@ bool QgsRasterChecker::runTest( const QString& theVerifiedKey, QString theVerifi allOk = false; valStr = QString( "%1
%2" ).arg( verifiedVal ).arg( expectedVal ); } - htmlTable += QString( "%3" ).arg( mCellStyle ).arg( cellOk ? mOkStyle : mErrStyle ).arg( valStr ); + htmlTable += QString( "%3" ).arg( mCellStyle, cellOk ? mOkStyle : mErrStyle, valStr ); } htmlTable += ""; } @@ -231,8 +231,8 @@ void QgsRasterChecker::compare( const QString& theParamName, double verifiedVal, void QgsRasterChecker::compareRow( const QString& theParamName, const QString& verifiedVal, const QString& expectedVal, QString &theReport, bool theOk, const QString& theDifference, const QString& theTolerance ) { theReport += "\n"; - theReport += QString( "%2%4%5\n" ).arg( mCellStyle ).arg( theParamName ).arg( theOk ? mOkStyle : mErrStyle ).arg( verifiedVal ).arg( expectedVal ); - theReport += QString( "%2\n" ).arg( mCellStyle ).arg( theDifference ); - theReport += QString( "%2\n" ).arg( mCellStyle ).arg( theTolerance ); + theReport += QString( "%2%4%5\n" ).arg( mCellStyle, theParamName, theOk ? mOkStyle : mErrStyle, verifiedVal, expectedVal ); + theReport += QString( "%2\n" ).arg( mCellStyle, theDifference ); + theReport += QString( "%2\n" ).arg( mCellStyle, theTolerance ); theReport += ""; } diff --git a/src/core/raster/qgsrasterlayer.cpp b/src/core/raster/qgsrasterlayer.cpp index 9f865bf4614..3783184d2b8 100644 --- a/src/core/raster/qgsrasterlayer.cpp +++ b/src/core/raster/qgsrasterlayer.cpp @@ -665,7 +665,7 @@ void QgsRasterLayer::setDataProvider( QString const & provider ) if ( !mDataProvider->isValid() ) { setError( mDataProvider->error() ); - appendError( ERR( tr( "Provider is not valid (provider: %1, URI: %2" ).arg( mProviderKey ).arg( mDataSource ) ) ); + appendError( ERR( tr( "Provider is not valid (provider: %1, URI: %2" ).arg( mProviderKey, mDataSource ) ) ); return; } diff --git a/src/core/raster/qgsrasterpipe.cpp b/src/core/raster/qgsrasterpipe.cpp index 7c88f65a808..e0db31ea54a 100644 --- a/src/core/raster/qgsrasterpipe.cpp +++ b/src/core/raster/qgsrasterpipe.cpp @@ -65,7 +65,7 @@ bool QgsRasterPipe::connect( QVector theInterfaces ) #ifdef QGISDEBUG const QgsRasterInterface &a = *theInterfaces[i]; const QgsRasterInterface &b = *theInterfaces[i-1]; - QgsDebugMsg( QString( "cannot connect %1 to %2" ).arg( typeid( a ).name() ).arg( typeid( b ).name() ) ); + QgsDebugMsg( QString( "cannot connect %1 to %2" ).arg( typeid( a ).name(), typeid( b ).name() ) ); #endif return false; } diff --git a/src/core/raster/qgsrasterrenderer.cpp b/src/core/raster/qgsrasterrenderer.cpp index 913e3eb06ac..49b2682531d 100644 --- a/src/core/raster/qgsrasterrenderer.cpp +++ b/src/core/raster/qgsrasterrenderer.cpp @@ -230,9 +230,9 @@ QString QgsRasterRenderer::minMaxOriginLabel( int theOrigin ) label = QCoreApplication::translate( "QgsRasterRenderer", "%1 %2 of %3.", "min/max origin label in raster properties, where %1 - estimated/exact, %2 - values (min/max, stddev, etc.), %3 - extent" ) - .arg( est_exact ) - .arg( values ) - .arg( extent ); + .arg( est_exact, + values, + extent ); return label; } diff --git a/src/core/symbology-ng/qgscategorizedsymbolrendererv2.cpp b/src/core/symbology-ng/qgscategorizedsymbolrendererv2.cpp index de16bf0dc66..ed48050c829 100644 --- a/src/core/symbology-ng/qgscategorizedsymbolrendererv2.cpp +++ b/src/core/symbology-ng/qgscategorizedsymbolrendererv2.cpp @@ -111,7 +111,7 @@ void QgsRendererCategoryV2::setRenderState( bool render ) QString QgsRendererCategoryV2::dump() const { - return QString( "%1::%2::%3:%4\n" ).arg( mValue.toString() ).arg( mLabel ).arg( mSymbol->dump() ).arg( mRender ); + return QString( "%1::%2::%3:%4\n" ).arg( mValue.toString(), mLabel, mSymbol->dump() ).arg( mRender ); } void QgsRendererCategoryV2::toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const @@ -130,15 +130,15 @@ void QgsRendererCategoryV2::toSld( QDomDocument &doc, QDomElement &element, QgsS QDomElement descrElem = doc.createElement( "se:Description" ); QDomElement titleElem = doc.createElement( "se:Title" ); - QString descrStr = QString( "%1 is '%2'" ).arg( attrName ).arg( mValue.toString() ); + QString descrStr = QString( "%1 is '%2'" ).arg( attrName, mValue.toString() ); titleElem.appendChild( doc.createTextNode( !mLabel.isEmpty() ? mLabel : descrStr ) ); descrElem.appendChild( titleElem ); ruleElem.appendChild( descrElem ); // create the ogc:Filter for the range QString filterFunc = QString( "%1 = '%2'" ) - .arg( attrName.replace( "\"", "\"\"" ) ) - .arg( mValue.toString().replace( "'", "''" ) ); + .arg( attrName.replace( "\"", "\"\"" ), + mValue.toString().replace( "'", "''" ) ); QgsSymbolLayerV2Utils::createFunctionElement( doc, ruleElem, filterFunc ); mSymbol->toSld( doc, ruleElem, props ); diff --git a/src/core/symbology-ng/qgscptcityarchive.cpp b/src/core/symbology-ng/qgscptcityarchive.cpp index 27d011a3636..cf95801c436 100644 --- a/src/core/symbology-ng/qgscptcityarchive.cpp +++ b/src/core/symbology-ng/qgscptcityarchive.cpp @@ -477,7 +477,7 @@ void QgsCptCityArchive::initArchives( bool loadAll ) QgsCptCityArchive::initArchive( it.key(), it.value() ); else { - QgsDebugMsg( QString( "not loading archive [%1] because dir %2 does not exist " ).arg( it.key() ).arg( it.value() ) ); + QgsDebugMsg( QString( "not loading archive [%1] because dir %2 does not exist " ).arg( it.key(), it.value() ) ); } } mDefaultArchiveName = defArchiveName; @@ -959,7 +959,7 @@ QVector QgsCptCityDirectoryItem::createChildren() children << childItem; } - QgsDebugMsg( QString( "name= %1 path= %2 found %3 children" ).arg( mName ).arg( mPath ).arg( children.count() ) ); + QgsDebugMsg( QString( "name= %1 path= %2 found %3 children" ).arg( mName, mPath ).arg( children.count() ) ); return children; } diff --git a/src/core/symbology-ng/qgsellipsesymbollayerv2.cpp b/src/core/symbology-ng/qgsellipsesymbollayerv2.cpp index 98359ec1287..c8e0d21cc5a 100644 --- a/src/core/symbology-ng/qgsellipsesymbollayerv2.cpp +++ b/src/core/symbology-ng/qgsellipsesymbollayerv2.cpp @@ -363,7 +363,7 @@ void QgsEllipseSymbolLayerV2::writeSldMarker( QDomDocument &doc, QDomElement &el { // the symbol has an angle and the symbol layer have a rotation // property set - angleFunc = QString( "%1 + %2" ).arg( angleFunc ).arg( ddRotation->useExpression() ? ddRotation->expressionString() : ddRotation->field() ); + angleFunc = QString( "%1 + %2" ).arg( angleFunc, ddRotation->useExpression() ? ddRotation->expressionString() : ddRotation->field() ); } else if ( !qgsDoubleNear( mAngle, 0.0 ) ) { diff --git a/src/core/symbology-ng/qgsgraduatedsymbolrendererv2.cpp b/src/core/symbology-ng/qgsgraduatedsymbolrendererv2.cpp index 3334d8a5285..b82dcc5d453 100644 --- a/src/core/symbology-ng/qgsgraduatedsymbolrendererv2.cpp +++ b/src/core/symbology-ng/qgsgraduatedsymbolrendererv2.cpp @@ -138,7 +138,7 @@ void QgsRendererRangeV2::setRenderState( bool render ) QString QgsRendererRangeV2::dump() const { - return QString( "%1 - %2::%3::%4\n" ).arg( mLowerValue ).arg( mUpperValue ).arg( mLabel ).arg( mSymbol.data() ? mSymbol->dump() : "(no symbol)" ); + return QString( "%1 - %2::%3::%4\n" ).arg( mLowerValue ).arg( mUpperValue ).arg( mLabel, mSymbol.data() ? mSymbol->dump() : "(no symbol)" ); } void QgsRendererRangeV2::toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const diff --git a/src/core/symbology-ng/qgsrulebasedrendererv2.cpp b/src/core/symbology-ng/qgsrulebasedrendererv2.cpp index ca0e7f348a6..f6a5d172c68 100644 --- a/src/core/symbology-ng/qgsrulebasedrendererv2.cpp +++ b/src/core/symbology-ng/qgsrulebasedrendererv2.cpp @@ -151,7 +151,7 @@ QString QgsRuleBasedRendererV2::Rule::dump( int indent ) const QString symbolDump = ( mSymbol ? mSymbol->dump() : QString( "[]" ) ); QString msg = off + QString( "RULE %1 - scale [%2,%3] - filter %4 - symbol %5\n" ) .arg( mLabel ).arg( mScaleMinDenom ).arg( mScaleMaxDenom ) - .arg( mFilterExp ).arg( symbolDump ); + .arg( mFilterExp, symbolDump ); QStringList lst; Q_FOREACH ( Rule* rule, mChildren ) @@ -449,7 +449,7 @@ bool QgsRuleBasedRendererV2::Rule::startRender( QgsRenderContext& context, const filter = sf; } else if ( mFilterExp.trimmed().length() && sf.trimmed().length() ) - filter = QString( "(%1) AND (%2)" ).arg( mFilterExp ).arg( sf ); + filter = QString( "(%1) AND (%2)" ).arg( mFilterExp, sf ); else if ( mFilterExp.trimmed().length() ) filter = mFilterExp; else if ( !sf.length() ) @@ -1077,7 +1077,7 @@ void QgsRuleBasedRendererV2::refineRuleCategories( QgsRuleBasedRendererV2::Rule* value = QString::number( cat.value().toDouble(), 'f', 4 ); else value = QgsExpression::quotedString( cat.value().toString() ); - QString filter = QString( "%1 = %2" ).arg( attr ).arg( value ); + QString filter = QString( "%1 = %2" ).arg( attr, value ); QString label = filter; initialRule->appendChild( new Rule( cat.symbol()->clone(), 0, 0, filter, label ) ); } @@ -1105,10 +1105,9 @@ void QgsRuleBasedRendererV2::refineRuleRanges( QgsRuleBasedRendererV2::Rule* ini { // due to the loss of precision in double->string conversion we may miss out values at the limit of the range // TODO: have a possibility to construct expressions directly as a parse tree to avoid loss of precision - QString filter = QString( "%1 %2 %3 AND %1 <= %4" ).arg( attr ) - .arg( firstRange ? ">=" : ">" ) - .arg( QString::number( rng.lowerValue(), 'f', 4 ) ) - .arg( QString::number( rng.upperValue(), 'f', 4 ) ); + QString filter = QString( "%1 %2 %3 AND %1 <= %4" ).arg( attr, firstRange ? ">=" : ">", + QString::number( rng.lowerValue(), 'f', 4 ), + QString::number( rng.upperValue(), 'f', 4 ) ); firstRange = false; QString label = filter; initialRule->appendChild( new Rule( rng.symbol()->clone(), 0, 0, filter, label ) ); diff --git a/src/core/symbology-ng/qgssvgcache.cpp b/src/core/symbology-ng/qgssvgcache.cpp index 449d28594cc..a156fdc5768 100644 --- a/src/core/symbology-ng/qgssvgcache.cpp +++ b/src/core/symbology-ng/qgssvgcache.cpp @@ -400,7 +400,7 @@ QByteArray QgsSvgCache::getImageData( const QString &path ) const if ( reply->error() != QNetworkReply::NoError ) { - QgsMessageLog::logMessage( tr( "SVG request failed [error: %1 - url: %2]" ).arg( reply->errorString() ).arg( reply->url().toString() ), tr( "SVG" ) ); + QgsMessageLog::logMessage( tr( "SVG request failed [error: %1 - url: %2]" ).arg( reply->errorString(), reply->url().toString() ), tr( "SVG" ) ); reply->deleteLater(); return QByteArray(); diff --git a/src/core/symbology-ng/qgssymbollayerv2utils.cpp b/src/core/symbology-ng/qgssymbollayerv2utils.cpp index 9428e57aa29..8715fa660d4 100644 --- a/src/core/symbology-ng/qgssymbollayerv2utils.cpp +++ b/src/core/symbology-ng/qgssymbollayerv2utils.cpp @@ -1779,7 +1779,7 @@ bool QgsSymbolLayerV2Utils::fillFromSld( QDomElement &element, Qt::BrushStyle &b QgsStringMap svgParams = getSvgParameterList( element ); for ( QgsStringMap::iterator it = svgParams.begin(); it != svgParams.end(); ++it ) { - QgsDebugMsg( QString( "found SvgParameter %1: %2" ).arg( it.key() ).arg( it.value() ) ); + QgsDebugMsg( QString( "found SvgParameter %1: %2" ).arg( it.key(), it.value() ) ); if ( it.key() == "fill" ) color = QColor( it.value() ); @@ -1918,7 +1918,7 @@ bool QgsSymbolLayerV2Utils::lineFromSld( QDomElement &element, QgsStringMap svgParams = getSvgParameterList( element ); for ( QgsStringMap::iterator it = svgParams.begin(); it != svgParams.end(); ++it ) { - QgsDebugMsg( QString( "found SvgParameter %1: %2" ).arg( it.key() ).arg( it.value() ) ); + QgsDebugMsg( QString( "found SvgParameter %1: %2" ).arg( it.key(), it.value() ) ); if ( it.key() == "stroke" ) { diff --git a/src/gui/attributetable/qgsdualview.cpp b/src/gui/attributetable/qgsdualview.cpp index 0f2cf636da2..6630a961e77 100644 --- a/src/gui/attributetable/qgsdualview.cpp +++ b/src/gui/attributetable/qgsdualview.cpp @@ -321,8 +321,7 @@ void QgsDualView::previewColumnChanged( QObject* action ) QMessageBox::warning( this, tr( "Could not set preview column" ), tr( "Could not set column '%1' as preview column.\nParser error:\n%2" ) - .arg( previewAction->text() ) - .arg( mFeatureList->parserErrorString() ) + .arg( previewAction->text(), mFeatureList->parserErrorString() ) ); } else diff --git a/src/gui/auth/qgsauthcertificateinfo.cpp b/src/gui/auth/qgsauthcertificateinfo.cpp index 3b3e2999faa..620bcca0476 100644 --- a/src/gui/auth/qgsauthcertificateinfo.cpp +++ b/src/gui/auth/qgsauthcertificateinfo.cpp @@ -495,8 +495,8 @@ void QgsAuthCertInfo::populateInfoGeneralSection() if (( isissuer || isca ) && isselfsigned ) { certype = QString( "%1 %2" ) - .arg( tr( "Root" ) ) - .arg( QgsAuthCertUtils::certificateUsageTypeString( QgsAuthCertUtils::CertAuthorityUsage ) ); + .arg( tr( "Root" ), + QgsAuthCertUtils::certificateUsageTypeString( QgsAuthCertUtils::CertAuthorityUsage ) ); } if ( isselfsigned ) { @@ -521,7 +521,7 @@ void QgsAuthCertInfo::populateInfoGeneralSection() QString alg( pubkey.algorithm() == QSsl::Rsa ? "RSA" : "DSA" ); int bitsize( pubkey.length() ); addFieldItem( mSecGeneral, tr( "Public key" ), - QString( "%1, %2 bits" ).arg( alg ).arg( bitsize == -1 ? QString( "?" ) : QString::number( bitsize ) ), + QString( "%1, %2 bits" ).arg( alg, bitsize == -1 ? QString( "?" ) : QString::number( bitsize ) ), LineEdit ); addFieldItem( mSecGeneral, tr( "Signature algorithm" ), QgsAuthCertUtils::qcaSignatureAlgorithm( mCurrentACert.signatureAlgorithm() ), diff --git a/src/gui/auth/qgsauthcerttrustpolicycombobox.cpp b/src/gui/auth/qgsauthcerttrustpolicycombobox.cpp index a8b95fc4b9e..97584b1c048 100644 --- a/src/gui/auth/qgsauthcerttrustpolicycombobox.cpp +++ b/src/gui/auth/qgsauthcerttrustpolicycombobox.cpp @@ -123,6 +123,6 @@ const QString QgsAuthCertTrustPolicyComboBox::defaultTrustText( QgsAuthCertUtils } } return QString( "%1 (%2)" ) - .arg( QgsAuthCertUtils::getCertTrustName( QgsAuthCertUtils::DefaultTrust ) ) - .arg( QgsAuthCertUtils::getCertTrustName( defaultpolicy ) ); + .arg( QgsAuthCertUtils::getCertTrustName( QgsAuthCertUtils::DefaultTrust ), + QgsAuthCertUtils::getCertTrustName( defaultpolicy ) ); } diff --git a/src/gui/auth/qgsauthconfigedit.cpp b/src/gui/auth/qgsauthconfigedit.cpp index 10a14cd17db..954daa9cb65 100644 --- a/src/gui/auth/qgsauthconfigedit.cpp +++ b/src/gui/auth/qgsauthconfigedit.cpp @@ -185,7 +185,7 @@ void QgsAuthConfigEdit::loadConfig() if ( indx == -1 ) { QgsDebugMsg( QString( "Loading FAILED for authcfg (%1): no edit widget loaded for auth method '%2'" ) - .arg( mAuthCfg ).arg( authMethodKey ) ); + .arg( mAuthCfg, authMethodKey ) ); if ( cmbAuthMethods->count() > 0 ) { cmbAuthMethods->setCurrentIndex( 0 ); @@ -201,7 +201,7 @@ void QgsAuthConfigEdit::loadConfig() if ( !editWidget ) { QgsDebugMsg( QString( "Cast to edit widget FAILED for authcfg (%1) and auth method key (%2)" ) - .arg( mAuthCfg ).arg( authMethodKey ) ); + .arg( mAuthCfg, authMethodKey ) ); return; } diff --git a/src/gui/auth/qgsauthguiutils.cpp b/src/gui/auth/qgsauthguiutils.cpp index 47ba2def3b2..f1924487d71 100644 --- a/src/gui/auth/qgsauthguiutils.cpp +++ b/src/gui/auth/qgsauthguiutils.cpp @@ -49,17 +49,17 @@ QColor QgsAuthGuiUtils::yellowColor() QString QgsAuthGuiUtils::greenTextStyleSheet( const QString &selector ) { - return QString( "%1{color: %2;}" ).arg( selector ).arg( QgsAuthGuiUtils::greenColor().name() ); + return QString( "%1{color: %2;}" ).arg( selector, QgsAuthGuiUtils::greenColor().name() ); } QString QgsAuthGuiUtils::orangeTextStyleSheet( const QString &selector ) { - return QString( "%1{color: %2;}" ).arg( selector ).arg( QgsAuthGuiUtils::orangeColor().name() ); + return QString( "%1{color: %2;}" ).arg( selector, QgsAuthGuiUtils::orangeColor().name() ); } QString QgsAuthGuiUtils::redTextStyleSheet( const QString &selector ) { - return QString( "%1{color: %2;}" ).arg( selector ).arg( QgsAuthGuiUtils::redColor().name() ); + return QString( "%1{color: %2;}" ).arg( selector, QgsAuthGuiUtils::redColor().name() ); } bool QgsAuthGuiUtils::isDisabled( QgsMessageBar *msgbar, int timeout ) diff --git a/src/gui/auth/qgsauthimportidentitydialog.cpp b/src/gui/auth/qgsauthimportidentitydialog.cpp index 82310aef4db..58b22358039 100644 --- a/src/gui/auth/qgsauthimportidentitydialog.cpp +++ b/src/gui/auth/qgsauthimportidentitydialog.cpp @@ -301,7 +301,7 @@ bool QgsAuthImportIdentityDialog::validatePkiPaths() QDateTime startdate( clientcert.effectiveDate() ); QDateTime enddate( clientcert.expiryDate() ); - writeValidation( tr( "%1 thru %2" ).arg( startdate.toString() ).arg( enddate.toString() ), + writeValidation( tr( "%1 thru %2" ).arg( startdate.toString(), enddate.toString() ), ( isvalid ? Valid : Invalid ) ); //TODO: set enabled on cert info button, relative to cert validity @@ -419,7 +419,7 @@ bool QgsAuthImportIdentityDialog::validatePkiPkcs12() QDateTime now( QDateTime::currentDateTime() ); bool bundlevalid = ( now >= startdate && now <= enddate ); - writeValidation( tr( "%1 thru %2" ).arg( startdate.toString() ).arg( enddate.toString() ), + writeValidation( tr( "%1 thru %2" ).arg( startdate.toString(), enddate.toString() ), ( bundlevalid ? Valid : Invalid ) ); if ( bundlevalid ) diff --git a/src/gui/auth/qgsauthserverseditor.cpp b/src/gui/auth/qgsauthserverseditor.cpp index 8b38acfbba9..6cba1b1bc00 100644 --- a/src/gui/auth/qgsauthserverseditor.cpp +++ b/src/gui/auth/qgsauthserverseditor.cpp @@ -314,7 +314,7 @@ void QgsAuthServersEditor::on_btnRemoveServer_clicked() if ( !QgsAuthManager::instance()->existsSslCertCustomConfig( digest, hostport ) ) { QgsDebugMsg( QString( "SSL custom config does not exist in database for host:port, id %1:" ) - .arg( hostport ).arg( digest ) ); + .arg( hostport, digest ) ); return; } @@ -332,7 +332,7 @@ void QgsAuthServersEditor::on_btnRemoveServer_clicked() if ( !QgsAuthManager::instance()->removeSslCertCustomConfig( digest, hostport ) ) { messageBar()->pushMessage( tr( "ERROR removing SSL custom config from authentication database for host:port, id %1:" ) - .arg( hostport ).arg( digest ), + .arg( hostport, digest ), QgsMessageBar::CRITICAL ); return; } diff --git a/src/gui/auth/qgsauthsslerrorsdialog.cpp b/src/gui/auth/qgsauthsslerrorsdialog.cpp index e18023a3899..add35cdc959 100644 --- a/src/gui/auth/qgsauthsslerrorsdialog.cpp +++ b/src/gui/auth/qgsauthsslerrorsdialog.cpp @@ -69,8 +69,8 @@ QgsAuthSslErrorsDialog::QgsAuthSslErrorsDialog( QNetworkReply *reply, { saveButton()->setEnabled( false ); - saveButton()->setText( QString( "%1 && %2" ).arg( saveButton()->text() ) - .arg( ignoreButton()->text() ) ); + saveButton()->setText( QString( "%1 && %2" ).arg( saveButton()->text(), + ignoreButton()->text() ) ); grpbxSslConfig->setChecked( false ); grpbxSslConfig->setCollapsed( true ); @@ -169,7 +169,7 @@ void QgsAuthSslErrorsDialog::on_buttonBox_clicked( QAbstractButton *button ) { case QDialogButtonBox::Ignore: QgsAuthManager::instance()->updateIgnoredSslErrorsCache( - QString( "%1:%2" ).arg( mDigest ).arg( mHostPort ), + QString( "%1:%2" ).arg( mDigest, mHostPort ), mSslErrors ); accept(); break; @@ -192,8 +192,8 @@ void QgsAuthSslErrorsDialog::populateErrorsList() Q_FOREACH ( const QSslError &err, mSslErrors ) { errs << QString( "* %1: %2" ) - .arg( QgsAuthCertUtils::sslErrorEnumString( err.error() ) ) - .arg( err.errorString() ); + .arg( QgsAuthCertUtils::sslErrorEnumString( err.error() ), + err.errorString() ); } teSslErrors->setPlainText( errs.join( "\n" ) ); } diff --git a/src/gui/auth/qgsauthsslimportdialog.cpp b/src/gui/auth/qgsauthsslimportdialog.cpp index d928f96a366..e005913594b 100644 --- a/src/gui/auth/qgsauthsslimportdialog.cpp +++ b/src/gui/auth/qgsauthsslimportdialog.cpp @@ -248,13 +248,13 @@ void QgsAuthSslImportDialog::socketEncrypted() appendString( tr( "Socket ENCRYPTED" ) ); - appendString( QString( "%1: %2" ).arg( tr( "Protocol" ) ) - .arg( QgsAuthCertUtils::getSslProtocolName( mSocket->protocol() ) ) ); + appendString( QString( "%1: %2" ).arg( tr( "Protocol" ), + QgsAuthCertUtils::getSslProtocolName( mSocket->protocol() ) ) ); QSslCipher ciph = mSocket->sessionCipher(); QString cipher = QString( "%1: %2, %3 (%4/%5)" ) - .arg( tr( "Session cipher" ) ).arg( ciph.authenticationMethod() ) - .arg( ciph.name() ).arg( ciph.usedBits() ).arg( ciph.supportedBits() ); + .arg( tr( "Session cipher" ), ciph.authenticationMethod(), ciph.name() ) + .arg( ciph.usedBits() ).arg( ciph.supportedBits() ); appendString( cipher ); @@ -281,7 +281,7 @@ void QgsAuthSslImportDialog::socketError( QAbstractSocket::SocketError err ) Q_UNUSED( err ); if ( mSocket ) { - appendString( QString( "%1: %2" ).arg( tr( "Socket ERROR" ) ).arg( mSocket->errorString() ) ); + appendString( QString( "%1: %2" ).arg( tr( "Socket ERROR" ), mSocket->errorString() ) ); } } diff --git a/src/gui/editorwidgets/qgsdefaultsearchwidgetwrapper.cpp b/src/gui/editorwidgets/qgsdefaultsearchwidgetwrapper.cpp index 8826b35be84..aa847766138 100644 --- a/src/gui/editorwidgets/qgsdefaultsearchwidgetwrapper.cpp +++ b/src/gui/editorwidgets/qgsdefaultsearchwidgetwrapper.cpp @@ -66,9 +66,9 @@ void QgsDefaultSearchWidgetWrapper::setExpression( QString exp ) else { str = QString( "%1 %2 '%3'" ) - .arg( QgsExpression::quotedColumnRef( fieldName ) ) - .arg( numeric ? "=" : mCaseString ) - .arg( numeric + .arg( QgsExpression::quotedColumnRef( fieldName ), + numeric ? "=" : mCaseString, + numeric ? exp.replace( "'", "''" ) : "%" + exp.replace( "'", "''" ) + "%" ); // escape quotes diff --git a/src/gui/editorwidgets/qgsrangeconfigdlg.cpp b/src/gui/editorwidgets/qgsrangeconfigdlg.cpp index 4648f83f0cc..70c6305f3f7 100644 --- a/src/gui/editorwidgets/qgsrangeconfigdlg.cpp +++ b/src/gui/editorwidgets/qgsrangeconfigdlg.cpp @@ -40,7 +40,7 @@ QgsRangeConfigDlg::QgsRangeConfigDlg( QgsVectorLayer* vl, int fieldIdx, QWidget QVariant min = vl->minimumValue( fieldIdx ); QVariant max = vl->maximumValue( fieldIdx ); - text = tr( "Current minimum for this value is %1 and current maximum is %2." ).arg( min.toString() ).arg( max.toString() ); + text = tr( "Current minimum for this value is %1 and current maximum is %2." ).arg( min.toString(), max.toString() ); break; } diff --git a/src/gui/editorwidgets/qgsrelationreferencewidget.cpp b/src/gui/editorwidgets/qgsrelationreferencewidget.cpp index c62c4cf74d6..1c28789c5fa 100644 --- a/src/gui/editorwidgets/qgsrelationreferencewidget.cpp +++ b/src/gui/editorwidgets/qgsrelationreferencewidget.cpp @@ -660,7 +660,7 @@ void QgsRelationReferenceWidget::mapIdentification() if ( mMessageBar ) { - QString title = QString( "Relation %1 for %2." ).arg( mRelationName ).arg( mReferencingLayer->name() ); + QString title = QString( "Relation %1 for %2." ).arg( mRelationName, mReferencingLayer->name() ); QString msg = tr( "Identify a feature of %1 to be associated. Press <ESC> to cancel." ).arg( mReferencedLayer->name() ); mMessageBarItem = QgsMessageBar::createMessage( title, msg, this ); mMessageBar->pushItem( mMessageBarItem ); @@ -813,11 +813,11 @@ void QgsRelationReferenceWidget::filterChanged() { if ( mReferencedLayer->fields().field( fieldName ).type() == QVariant::String ) { - filters << QString( "\"%1\" = '%2'" ).arg( fieldName ).arg( cb->currentText() ); + filters << QString( "\"%1\" = '%2'" ).arg( fieldName, cb->currentText() ); } else { - filters << QString( "\"%1\" = %2" ).arg( fieldName ).arg( cb->currentText() ); + filters << QString( "\"%1\" = %2" ).arg( fieldName, cb->currentText() ); } } attrs << mReferencedLayer->fieldNameIndex( fieldName ); diff --git a/src/gui/editorwidgets/qgsvaluemapconfigdlg.cpp b/src/gui/editorwidgets/qgsvaluemapconfigdlg.cpp index 6aa8c9b9026..d63721c4546 100644 --- a/src/gui/editorwidgets/qgsvaluemapconfigdlg.cpp +++ b/src/gui/editorwidgets/qgsvaluemapconfigdlg.cpp @@ -171,7 +171,7 @@ void QgsValueMapConfigDlg::loadFromCSVButtonPushed() { QMessageBox::information( NULL, tr( "Error" ), - tr( "Could not open file %1\nError was:%2" ).arg( fileName ).arg( f.errorString() ), + tr( "Could not open file %1\nError was:%2" ).arg( fileName, f.errorString() ), QMessageBox::Cancel ); return; } diff --git a/src/gui/qgisgui.cpp b/src/gui/qgisgui.cpp index e606f4ff202..f07b21b37c8 100644 --- a/src/gui/qgisgui.cpp +++ b/src/gui/qgisgui.cpp @@ -178,7 +178,7 @@ namespace QgisGui QString createFileFilter_( QString const &longName, QString const &glob ) { - return QString( "%1 (%2 %3)" ).arg( longName ).arg( glob.toLower() ).arg( glob.toUpper() ); + return QString( "%1 (%2 %3)" ).arg( longName, glob.toLower(), glob.toUpper() ); } QString createFileFilter_( QString const &format ) diff --git a/src/gui/qgsattributeform.cpp b/src/gui/qgsattributeform.cpp index 69d2b543878..47573d6c81b 100644 --- a/src/gui/qgsattributeform.cpp +++ b/src/gui/qgsattributeform.cpp @@ -227,9 +227,9 @@ bool QgsAttributeForm::save() QgsDebugMsg( QString( "Updating field %1" ).arg( i ) ); QgsDebugMsg( QString( "dst:'%1' (type:%2, isNull:%3, isValid:%4)" ) - .arg( dst[i].toString() ).arg( dst[i].typeName() ).arg( dst[i].isNull() ).arg( dst[i].isValid() ) ); + .arg( dst[i].toString(), dst[i].typeName() ).arg( dst[i].isNull() ).arg( dst[i].isValid() ) ); QgsDebugMsg( QString( "src:'%1' (type:%2, isNull:%3, isValid:%4)" ) - .arg( src[i].toString() ).arg( src[i].typeName() ).arg( src[i].isNull() ).arg( src[i].isValid() ) ); + .arg( src[i].toString(), src[i].typeName() ).arg( src[i].isNull() ).arg( src[i].isValid() ) ); success &= mLayer->changeAttributeValue( mFeature.id(), i, dst[i], src[i] ); n++; diff --git a/src/gui/qgsattributeformlegacyinterface.cpp b/src/gui/qgsattributeformlegacyinterface.cpp index 2279a5d0e06..f946317e730 100644 --- a/src/gui/qgsattributeformlegacyinterface.cpp +++ b/src/gui/qgsattributeformlegacyinterface.cpp @@ -66,10 +66,10 @@ void QgsAttributeFormLegacyInterface::featureChanged() QgsPythonRunner::run( initFeature ); QString expr = QString( "%1( %2, %3, %4)" ) - .arg( mPyFunctionName ) - .arg( mPyFormVarName ) - .arg( mPyLayerVarName ) - .arg( pyFeatureVarName ); + .arg( mPyFunctionName, + mPyFormVarName, + mPyLayerVarName, + pyFeatureVarName ); QgsPythonRunner::run( expr ); diff --git a/src/gui/qgscharacterselectdialog.cpp b/src/gui/qgscharacterselectdialog.cpp index 254f324fcdc..cc7adef4efb 100644 --- a/src/gui/qgscharacterselectdialog.cpp +++ b/src/gui/qgscharacterselectdialog.cpp @@ -33,7 +33,7 @@ QgsCharacterSelectorDialog::~QgsCharacterSelectorDialog() const QChar& QgsCharacterSelectorDialog::selectCharacter( bool* gotChar, const QFont& font, const QString& style ) { - mCharSelectLabelFont->setText( QString( "%1 %2" ).arg( font.family() ).arg( style ) ); + mCharSelectLabelFont->setText( QString( "%1 %2" ).arg( font.family(), style ) ); mCharWidget->updateFont( font ); mCharWidget->updateStyle( style ); mCharWidget->updateSize( 22.0 ); diff --git a/src/gui/qgscollapsiblegroupbox.cpp b/src/gui/qgscollapsiblegroupbox.cpp index b9e7ffc9f34..17d479c8998 100644 --- a/src/gui/qgscollapsiblegroupbox.cpp +++ b/src/gui/qgscollapsiblegroupbox.cpp @@ -371,7 +371,7 @@ void QgsCollapsibleGroupBoxBasic::updateStyle() } QgsDebugMsg( QString( "groupbox: %1 style: %2 offset: left=%3 top=%4 top2=%5" ).arg( - objectName() ).arg( QApplication::style()->objectName() ).arg( offsetLeft ).arg( offsetTop ).arg( offsetTopTri ) ); + objectName(), QApplication::style()->objectName() ).arg( offsetLeft ).arg( offsetTop ).arg( offsetTopTri ) ); // customize style sheet for collapse/expand button and force left-aligned title QString ss; diff --git a/src/gui/qgscolorbutton.cpp b/src/gui/qgscolorbutton.cpp index 29273212873..74928eef1df 100644 --- a/src/gui/qgscolorbutton.cpp +++ b/src/gui/qgscolorbutton.cpp @@ -566,10 +566,10 @@ void QgsColorButton::setButtonBackground( QColor color ) " border-width: 2px;" " border-color: rgb(128,128,128);" " border-radius: 4px;} " ) - .arg( bkgrd ) - .arg( margin ) - .arg( isEnabled() ? "128" : "110" ) - .arg( isEnabled() ? "outset" : "dotted" ) ); + .arg( bkgrd, + margin, + isEnabled() ? "128" : "110", + isEnabled() ? "outset" : "dotted" ) ); } } diff --git a/src/gui/qgscredentialdialog.cpp b/src/gui/qgscredentialdialog.cpp index f907c2cdbf7..89967b9f4af 100644 --- a/src/gui/qgscredentialdialog.cpp +++ b/src/gui/qgscredentialdialog.cpp @@ -56,7 +56,7 @@ bool QgsCredentialDialog::request( const QString& realm, QString &username, QStr { QgsDebugMsg( "emitting signal" ); emit credentialsRequested( realm, &username, &password, message, &ok ); - QgsDebugMsg( QString( "signal returned %1 (username=%2, password=%3)" ).arg( ok ? "true" : "false" ).arg( username ).arg( password ) ); + QgsDebugMsg( QString( "signal returned %1 (username=%2, password=%3)" ).arg( ok ? "true" : "false", username, password ) ); } else { diff --git a/src/gui/qgsdatadefinedbutton.cpp b/src/gui/qgsdatadefinedbutton.cpp index 114dbd6589a..a9c1519ea68 100644 --- a/src/gui/qgsdatadefinedbutton.cpp +++ b/src/gui/qgsdatadefinedbutton.cpp @@ -608,7 +608,7 @@ void QgsDataDefinedButton::updateGui() deftip.append( "..." ); } - mFullDescription += tr( "Current definition %1:
%2" ).arg( deftype ).arg( deftip ); + mFullDescription += tr( "Current definition %1:
%2" ).arg( deftype, deftip ); setToolTip( mFullDescription ); diff --git a/src/gui/qgsdatumtransformdialog.cpp b/src/gui/qgsdatumtransformdialog.cpp index 1ec0d66e6cd..57dd53b0e9a 100644 --- a/src/gui/qgsdatumtransformdialog.cpp +++ b/src/gui/qgsdatumtransformdialog.cpp @@ -92,7 +92,7 @@ void QgsDatumTransformDialog::load() if ( epsgNr > 0 ) toolTipString.append( QString( "

EPSG Transformations Code: %1

" ).arg( epsgNr ) ); - toolTipString.append( QString( "

Source CRS: %1

Destination CRS: %2

" ).arg( srcGeoProj ).arg( destGeoProj ) ); + toolTipString.append( QString( "

Source CRS: %1

Destination CRS: %2

" ).arg( srcGeoProj, destGeoProj ) ); if ( !remarks.isEmpty() ) toolTipString.append( QString( "

Remarks: %1

" ).arg( remarks ) ); @@ -217,7 +217,7 @@ bool QgsDatumTransformDialog::testGridShiftFileAvailability( QTreeWidgetItem* it return true; } } - item->setToolTip( col, tr( "File '%1' not found in directory '%2'" ).arg( filename ).arg( projDir.absolutePath() ) ); + item->setToolTip( col, tr( "File '%1' not found in directory '%2'" ).arg( filename, projDir.absolutePath() ) ); return false; //not found in PROJ_LIB directory } return true; @@ -242,7 +242,7 @@ void QgsDatumTransformDialog::updateTitle() mLabelLayer->setText( mLayerName ); QgsCoordinateReferenceSystem crs; crs.createFromString( mSrcCRSauthId ); - mLabelSrcCrs->setText( QString( "%1 - %2" ).arg( mSrcCRSauthId ).arg( crs.isValid() ? crs.description() : tr( "unknown" ) ) ); + mLabelSrcCrs->setText( QString( "%1 - %2" ).arg( mSrcCRSauthId, crs.isValid() ? crs.description() : tr( "unknown" ) ) ); crs.createFromString( mDestCRSauthId ); - mLabelDstCrs->setText( QString( "%1 - %2" ).arg( mDestCRSauthId ).arg( crs.isValid() ? crs.description() : tr( "unknown" ) ) ); + mLabelDstCrs->setText( QString( "%1 - %2" ).arg( mDestCRSauthId, crs.isValid() ? crs.description() : tr( "unknown" ) ) ); } diff --git a/src/gui/qgsexpressionbuilderwidget.cpp b/src/gui/qgsexpressionbuilderwidget.cpp index c9ce4998945..48f371f3277 100644 --- a/src/gui/qgsexpressionbuilderwidget.cpp +++ b/src/gui/qgsexpressionbuilderwidget.cpp @@ -565,9 +565,9 @@ void QgsExpressionBuilderWidget::on_txtExpressionString_textChanged() if ( exp.hasParserError() || exp.hasEvalError() ) { - QString tooltip = QString( "%1:
%2" ).arg( tr( "Parser Error" ) ).arg( exp.parserErrorString() ); + QString tooltip = QString( "%1:
%2" ).arg( tr( "Parser Error" ), exp.parserErrorString() ); if ( exp.hasEvalError() ) - tooltip += QString( "

%1:
%2" ).arg( tr( "Eval Error" ) ).arg( exp.evalErrorString() ); + tooltip += QString( "

%1:
%2" ).arg( tr( "Eval Error" ), exp.evalErrorString() ); lblPreview->setText( tr( "Expression is invalid (more info)" ) ); lblPreview->setStyleSheet( "color: rgba(255, 6, 10, 255);" ); diff --git a/src/gui/qgsextentgroupbox.cpp b/src/gui/qgsextentgroupbox.cpp index 436060cb09a..3fcbdbeffa2 100644 --- a/src/gui/qgsextentgroupbox.cpp +++ b/src/gui/qgsextentgroupbox.cpp @@ -98,7 +98,7 @@ void QgsExtentGroupBox::updateTitle() } if ( isCheckable() && !isChecked() ) msg = tr( "none" ); - msg = tr( "%1 (current: %2)" ).arg( mTitleBase ).arg( msg ); + msg = tr( "%1 (current: %2)" ).arg( mTitleBase, msg ); setTitle( msg ); } diff --git a/src/gui/qgsgenericprojectionselector.cpp b/src/gui/qgsgenericprojectionselector.cpp index 1aaf2be6f83..5d777b06c48 100644 --- a/src/gui/qgsgenericprojectionselector.cpp +++ b/src/gui/qgsgenericprojectionselector.cpp @@ -50,7 +50,7 @@ void QgsGenericProjectionSelector::setMessage( QString theMessage ) QString sentence1 = tr( "This layer appears to have no projection specification." ); QString sentence2 = tr( "By default, this layer will now have its projection set to that of the project, " "but you may override this by selecting a different projection below." ); - theMessage = format.arg( header ).arg( sentence1 ).arg( sentence2 ); + theMessage = format.arg( header, sentence1, sentence2 ); } QString myStyle = QgsApplication::reportStyleSheet(); diff --git a/src/gui/qgsidentifymenu.cpp b/src/gui/qgsidentifymenu.cpp index b5117885f98..9179a064fd2 100644 --- a/src/gui/qgsidentifymenu.cpp +++ b/src/gui/qgsidentifymenu.cpp @@ -274,7 +274,7 @@ void QgsIdentifyMenu::addVectorLayer( QgsVectorLayer* layer, const QListdisplayField() ).toString(); if ( featureTitle.isEmpty() ) featureTitle = QString( "%1" ).arg( results[0].mFeature.id() ); - layerAction = new QAction( QString( "%1 (%2)" ).arg( layer->name() ).arg( featureTitle ), this ); + layerAction = new QAction( QString( "%1 (%2)" ).arg( layer->name(), featureTitle ), this ); } else { @@ -296,7 +296,7 @@ void QgsIdentifyMenu::addVectorLayer( QgsVectorLayer* layer, const QListdisplayField() ).toString(); if ( featureTitle.isEmpty() ) featureTitle = QString( "%1" ).arg( results[0].mFeature.id() ); - layerMenu = new QMenu( QString( "%1 (%2)" ).arg( layer->name() ).arg( featureTitle ), this ); + layerMenu = new QMenu( QString( "%1 (%2)" ).arg( layer->name(), featureTitle ), this ); } layerAction = layerMenu->menuAction(); } diff --git a/src/gui/qgsmanageconnectionsdialog.cpp b/src/gui/qgsmanageconnectionsdialog.cpp index 371df98ca08..9ac6fc41a1b 100644 --- a/src/gui/qgsmanageconnectionsdialog.cpp +++ b/src/gui/qgsmanageconnectionsdialog.cpp @@ -134,8 +134,8 @@ void QgsManageConnectionsDialog::doExportImport() { QMessageBox::warning( this, tr( "Saving connections" ), tr( "Cannot write file %1:\n%2." ) - .arg( mFileName ) - .arg( file.errorString() ) ); + .arg( mFileName, + file.errorString() ) ); return; } @@ -149,8 +149,8 @@ void QgsManageConnectionsDialog::doExportImport() { QMessageBox::warning( this, tr( "Loading connections" ), tr( "Cannot read file %1:\n%2." ) - .arg( mFileName ) - .arg( file.errorString() ) ); + .arg( mFileName, + file.errorString() ) ); return; } @@ -244,8 +244,8 @@ bool QgsManageConnectionsDialog::populateConnections() { QMessageBox::warning( this, tr( "Loading connections" ), tr( "Cannot read file %1:\n%2." ) - .arg( mFileName ) - .arg( file.errorString() ) ); + .arg( mFileName, + file.errorString() ) ); return false; } diff --git a/src/gui/qgsnewmemorylayerdialog.cpp b/src/gui/qgsnewmemorylayerdialog.cpp index 767069a33f9..bcafb707af1 100644 --- a/src/gui/qgsnewmemorylayerdialog.cpp +++ b/src/gui/qgsnewmemorylayerdialog.cpp @@ -65,7 +65,7 @@ QgsVectorLayer *QgsNewMemoryLayerDialog::runAndCreateLayer( QWidget *parent ) geomType = "point"; } - QString layerProperties = QString( "%1?crs=%2&memoryid=%3" ).arg( geomType ).arg( crsId ).arg( QUuid::createUuid().toString() ); + QString layerProperties = QString( "%1?crs=%2&memoryid=%3" ).arg( geomType, crsId, QUuid::createUuid().toString() ); QString name = dialog.layerName().isEmpty() ? tr( "New scratch layer" ) : dialog.layerName(); QgsVectorLayer* newLayer = new QgsVectorLayer( layerProperties, name, QString( "memory" ) ); return newLayer; diff --git a/src/gui/qgsnewnamedialog.cpp b/src/gui/qgsnewnamedialog.cpp index a7f493121dc..46b36595eff 100644 --- a/src/gui/qgsnewnamedialog.cpp +++ b/src/gui/qgsnewnamedialog.cpp @@ -48,7 +48,7 @@ QgsNewNameDialog::QgsNewNameDialog( const QString& source, const QString& initia } else { - hintString = tr( "Enter new %1 for %2" ).arg( nameDesc ).arg( source ); + hintString = tr( "Enter new %1 for %2" ).arg( nameDesc, source ); } mHintLabel = new QLabel( hintString, this ); layout()->addWidget( mHintLabel ); diff --git a/src/gui/qgsnewvectorlayerdialog.cpp b/src/gui/qgsnewvectorlayerdialog.cpp index 57b006195c4..200c9f78953 100644 --- a/src/gui/qgsnewvectorlayerdialog.cpp +++ b/src/gui/qgsnewvectorlayerdialog.cpp @@ -195,9 +195,9 @@ void QgsNewVectorLayerDialog::attributes( QList< QPair >& at ) while ( *it ) { QTreeWidgetItem *item = *it; - QString type = QString( "%1;%2;%3" ).arg( item->text( 1 ) ).arg( item->text( 2 ) ).arg( item->text( 3 ) ); + QString type = QString( "%1;%2;%3" ).arg( item->text( 1 ), item->text( 2 ), item->text( 3 ) ); at.push_back( qMakePair( item->text( 0 ), type ) ); - QgsDebugMsg( QString( "appending %1//%2" ).arg( item->text( 0 ) ).arg( type ) ); + QgsDebugMsg( QString( "appending %1//%2" ).arg( item->text( 0 ), type ) ); ++it; } } diff --git a/src/gui/qgsoptionsdialogbase.cpp b/src/gui/qgsoptionsdialogbase.cpp index 257434fa1cb..ebe122f2159 100644 --- a/src/gui/qgsoptionsdialogbase.cpp +++ b/src/gui/qgsoptionsdialogbase.cpp @@ -224,7 +224,7 @@ void QgsOptionsDialogBase::updateWindowTitle() QListWidgetItem *curitem = mOptListWidget->currentItem(); if ( curitem ) { - setWindowTitle( QString( "%1 | %2" ).arg( mDialogTitle ).arg( curitem->text() ) ); + setWindowTitle( QString( "%1 | %2" ).arg( mDialogTitle, curitem->text() ) ); } else { diff --git a/src/gui/qgsprojectbadlayerguihandler.cpp b/src/gui/qgsprojectbadlayerguihandler.cpp index 724debee0d2..15aa5255822 100644 --- a/src/gui/qgsprojectbadlayerguihandler.cpp +++ b/src/gui/qgsprojectbadlayerguihandler.cpp @@ -227,8 +227,8 @@ bool QgsProjectBadLayerGuiHandler::findMissingFile( QString const & fileFilters, QStringList selectedFiles; QString enc; QString title = QObject::tr( "Where is '%1' (original location: %2)?" ) - .arg( originalDataSource.fileName() ) - .arg( originalDataSource.absoluteFilePath() ); + .arg( originalDataSource.fileName(), + originalDataSource.absoluteFilePath() ); bool retVal = QgisGui::openFilesRememberingFilter( memoryQualifier, myFileFilters, diff --git a/src/gui/qgsprojectionselectionwidget.cpp b/src/gui/qgsprojectionselectionwidget.cpp index 961367d73aa..866cb2b30db 100644 --- a/src/gui/qgsprojectionselectionwidget.cpp +++ b/src/gui/qgsprojectionselectionwidget.cpp @@ -187,7 +187,7 @@ void QgsProjectionSelectionWidget::setCrs( const QgsCoordinateReferenceSystem& c if ( crs.isValid() ) { mCrsComboBox->setItemText( mCrsComboBox->findData( QgsProjectionSelectionWidget::CurrentCrs ), - tr( "Selected CRS (%1, %2)" ).arg( crs.authid() ).arg( crs.description() ) ); + tr( "Selected CRS (%1, %2)" ).arg( crs.authid(), crs.description() ) ); mCrsComboBox->blockSignals( true ); mCrsComboBox->setCurrentIndex( mCrsComboBox->findData( QgsProjectionSelectionWidget::CurrentCrs ) ); mCrsComboBox->blockSignals( false ); @@ -207,11 +207,11 @@ void QgsProjectionSelectionWidget::setLayerCrs( const QgsCoordinateReferenceSyst { if ( layerItemIndex > -1 ) { - mCrsComboBox->setItemText( layerItemIndex, tr( "Layer CRS (%1, %2)" ).arg( crs.authid() ).arg( crs.description() ) ); + mCrsComboBox->setItemText( layerItemIndex, tr( "Layer CRS (%1, %2)" ).arg( crs.authid(), crs.description() ) ); } else { - mCrsComboBox->insertItem( firstRecentCrsIndex(), tr( "Layer CRS (%1, %2)" ).arg( crs.authid() ).arg( crs.description() ), QgsProjectionSelectionWidget::LayerCrs ); + mCrsComboBox->insertItem( firstRecentCrsIndex(), tr( "Layer CRS (%1, %2)" ).arg( crs.authid(), crs.description() ), QgsProjectionSelectionWidget::LayerCrs ); } } else @@ -228,13 +228,13 @@ void QgsProjectionSelectionWidget::addProjectCrsOption() { if ( mProjectCrs.isValid() ) { - mCrsComboBox->addItem( tr( "Project CRS (%1 - %2)" ).arg( mProjectCrs.authid() ).arg( mProjectCrs.description() ), QgsProjectionSelectionWidget::ProjectCrs ); + mCrsComboBox->addItem( tr( "Project CRS (%1 - %2)" ).arg( mProjectCrs.authid(), mProjectCrs.description() ), QgsProjectionSelectionWidget::ProjectCrs ); } } void QgsProjectionSelectionWidget::addDefaultCrsOption() { - mCrsComboBox->addItem( tr( "Default CRS (%1 - %2)" ).arg( mDefaultCrs.authid() ).arg( mDefaultCrs.description() ), QgsProjectionSelectionWidget::DefaultCrs ); + mCrsComboBox->addItem( tr( "Default CRS (%1 - %2)" ).arg( mDefaultCrs.authid(), mDefaultCrs.description() ), QgsProjectionSelectionWidget::DefaultCrs ); } void QgsProjectionSelectionWidget::addRecentCrs() @@ -256,7 +256,7 @@ void QgsProjectionSelectionWidget::addRecentCrs() crs.createFromSrsId( srsid ); if ( crs.isValid() ) { - mCrsComboBox->addItem( tr( "%1 - %2" ).arg( crs.authid() ).arg( crs.description() ), QgsProjectionSelectionWidget::RecentCrs ); + mCrsComboBox->addItem( tr( "%1 - %2" ).arg( crs.authid(), crs.description() ), QgsProjectionSelectionWidget::RecentCrs ); mCrsComboBox->setItemData( mCrsComboBox->count() - 1, QVariant(( long long )srsid ), Qt::UserRole + 1 ); } if ( i >= 4 ) diff --git a/src/gui/qgsprojectionselector.cpp b/src/gui/qgsprojectionselector.cpp index d369fd75fc4..98fe519d98a 100644 --- a/src/gui/qgsprojectionselector.cpp +++ b/src/gui/qgsprojectionselector.cpp @@ -190,9 +190,9 @@ QString QgsProjectionSelector::ogcWmsCrsFilterAsSqlExpression( QSet * c Q_FOREACH ( const QString& auth_name, authParts.keys() ) { sqlExpression += QString( "%1(upper(auth_name)='%2' AND upper(auth_id) IN ('%3'))" ) - .arg( prefix ) - .arg( auth_name ) - .arg( authParts[auth_name].join( "','" ) ); + .arg( prefix, + auth_name, + authParts[auth_name].join( "','" ) ); prefix = " OR "; } sqlExpression += ")"; @@ -398,8 +398,8 @@ QString QgsProjectionSelector::getSelectedExpression( const QString& expression const char *tail; sqlite3_stmt *stmt; QString sql = QString( "select %1 from tbl_srs where srs_id=%2" ) - .arg( expression ) - .arg( lvi->text( QGIS_CRS_ID_COLUMN ) ); + .arg( expression, + lvi->text( QGIS_CRS_ID_COLUMN ) ); QgsDebugMsg( QString( "Finding selected attribute using : %1" ).arg( sql ) ); rc = sqlite3_prepare( database, sql.toUtf8(), sql.toUtf8().length(), &stmt, &tail ); diff --git a/src/gui/qgsrasterformatsaveoptionswidget.cpp b/src/gui/qgsrasterformatsaveoptionswidget.cpp index 804d1dcf690..5eb17255b24 100644 --- a/src/gui/qgsrasterformatsaveoptionswidget.cpp +++ b/src/gui/qgsrasterformatsaveoptionswidget.cpp @@ -293,7 +293,7 @@ QString QgsRasterFormatSaveOptionsWidget::validateOptions( bool gui, bool report QStringList createOptions = options(); QString message; - QgsDebugMsg( QString( "layer: [%1] file: [%2] format: [%3]" ).arg( mRasterLayer ? mRasterLayer->id() : "none" ).arg( mRasterFileName ).arg( mFormat ) ); + QgsDebugMsg( QString( "layer: [%1] file: [%2] format: [%3]" ).arg( mRasterLayer ? mRasterLayer->id() : "none", mRasterFileName, mFormat ) ); // if no rasterLayer is defined, but we have a raster fileName, then create a temp. rasterLayer to validate options // ideally we should keep it for future access, but this is trickier QgsRasterLayer* rasterLayer = mRasterLayer; @@ -375,7 +375,7 @@ QString QgsRasterFormatSaveOptionsWidget::validateOptions( bool gui, bool report } else { - QMessageBox::warning( this, "", tr( "Invalid %1:\n\n%2\n\nClick on help button to get valid creation options for this format." ).arg( mPyramids ? tr( "pyramid creation option" ) : tr( "creation option" ) ).arg( message ), QMessageBox::Close ); + QMessageBox::warning( this, "", tr( "Invalid %1:\n\n%2\n\nClick on help button to get valid creation options for this format." ).arg( mPyramids ? tr( "pyramid creation option" ) : tr( "creation option" ), message ), QMessageBox::Close ); } } diff --git a/src/gui/qgsrasterlayersaveasdialog.cpp b/src/gui/qgsrasterlayersaveasdialog.cpp index 4166b0af81b..ac9f92ddef7 100644 --- a/src/gui/qgsrasterlayersaveasdialog.cpp +++ b/src/gui/qgsrasterlayersaveasdialog.cpp @@ -178,7 +178,7 @@ void QgsRasterLayerSaveAsDialog::on_mBrowseButton_clicked() if ( !files.isEmpty() ) { QMessageBox::StandardButton button = QMessageBox::warning( this, tr( "Warning" ), - tr( "The directory %1 contains files which will be overwritten: %2" ).arg( dir.absolutePath() ).arg( files.join( ", " ) ), + tr( "The directory %1 contains files which will be overwritten: %2" ).arg( dir.absolutePath(), files.join( ", " ) ), QMessageBox::Ok | QMessageBox::Cancel ); if ( button == QMessageBox::Ok ) diff --git a/src/gui/qgsrelationmanagerdialog.cpp b/src/gui/qgsrelationmanagerdialog.cpp index 7fb414857f4..c46791c91fd 100644 --- a/src/gui/qgsrelationmanagerdialog.cpp +++ b/src/gui/qgsrelationmanagerdialog.cpp @@ -88,10 +88,10 @@ void QgsRelationManagerDialog::on_mBtnAddRelation_clicked() QString relationId = addDlg.relationId(); if ( addDlg.relationId() == "" ) relationId = QString( "%1_%2_%3_%4" ) - .arg( addDlg.referencingLayerId() ) - .arg( addDlg.references().first().first ) - .arg( addDlg.referencedLayerId() ) - .arg( addDlg.references().first().second ); + .arg( addDlg.referencingLayerId(), + addDlg.references().first().first, + addDlg.referencedLayerId(), + addDlg.references().first().second ); QStringList existingNames; diff --git a/src/gui/raster/qgsrasterhistogramwidget.cpp b/src/gui/raster/qgsrasterhistogramwidget.cpp index 08db70bbe1f..68139c57b76 100644 --- a/src/gui/raster/qgsrasterhistogramwidget.cpp +++ b/src/gui/raster/qgsrasterhistogramwidget.cpp @@ -704,7 +704,7 @@ bool QgsRasterHistogramWidget::histoSaveAsImage( const QString& theFilename, QDir myDir( myInfo.dir() ); if ( ! myDir.exists() ) { - QgsDebugMsg( QString( "Error, directory %1 non-existent (theFilename = %2)" ).arg( myDir.absolutePath() ).arg( theFilename ) ); + QgsDebugMsg( QString( "Error, directory %1 non-existent (theFilename = %2)" ).arg( myDir.absolutePath(), theFilename ) ); return false; } @@ -1248,7 +1248,7 @@ QPair< QString, QString > QgsRasterHistogramWidget::rendererMinMax( int theBandN if ( myMinMax.second.isEmpty() ) myMinMax.second = QString::number( mHistoMax ); - QgsDebugMsg( QString( "bandNo %1 got min/max [%2] [%3]" ).arg( theBandNo ).arg( myMinMax.first ).arg( myMinMax.second ) ); + QgsDebugMsg( QString( "bandNo %1 got min/max [%2] [%3]" ).arg( theBandNo ).arg( myMinMax.first, myMinMax.second ) ); return myMinMax; } diff --git a/src/gui/symbology-ng/qgscategorizedsymbolrendererv2widget.cpp b/src/gui/symbology-ng/qgscategorizedsymbolrendererv2widget.cpp index f3f861dbb93..40845117cb2 100644 --- a/src/gui/symbology-ng/qgscategorizedsymbolrendererv2widget.cpp +++ b/src/gui/symbology-ng/qgscategorizedsymbolrendererv2widget.cpp @@ -733,7 +733,7 @@ void QgsCategorizedSymbolRendererV2Widget::addCategories() tr( "Confirm Delete" ), tr( "The classification field was changed from '%1' to '%2'.\n" "Should the existing classes be deleted before classification?" ) - .arg( mOldClassificationAttribute ).arg( attrName ), + .arg( mOldClassificationAttribute, attrName ), QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel ); if ( res == QMessageBox::Cancel ) { diff --git a/src/gui/symbology-ng/qgscptcitycolorrampv2dialog.cpp b/src/gui/symbology-ng/qgscptcitycolorrampv2dialog.cpp index 20aa427640d..ab2a3e1126b 100644 --- a/src/gui/symbology-ng/qgscptcitycolorrampv2dialog.cpp +++ b/src/gui/symbology-ng/qgscptcitycolorrampv2dialog.cpp @@ -94,9 +94,9 @@ QgsCptCityColorRampV2Dialog::QgsCptCityColorRampV2Dialog( QgsCptCityColorRampV2* "2) Download the complete archive (in svg format) " "and unzip it to your QGIS settings directory [%1] .\n\n" "This file can be found at [%2]\nand current file is [%3]" - ).arg( QgsApplication::qgisSettingsDirPath() - ).arg( "http://soliton.vm.bytemark.co.uk/pub/cpt-city/pkg/" - ).arg( "http://soliton.vm.bytemark.co.uk/pub/cpt-city/pkg/cpt-city-svg-2.07.zip" ); + ).arg( QgsApplication::qgisSettingsDirPath(), + "http://soliton.vm.bytemark.co.uk/pub/cpt-city/pkg/", + "http://soliton.vm.bytemark.co.uk/pub/cpt-city/pkg/cpt-city-svg-2.07.zip" ); edit->setText( helpText ); mStackedWidget->addWidget( edit ); mStackedWidget->setCurrentIndex( 1 ); @@ -120,7 +120,7 @@ QgsCptCityColorRampV2Dialog::QgsCptCityColorRampV2Dialog( QgsCptCityColorRampV2* mRamp = new QgsCptCityColorRampV2( "", "", false ); ramp = mRamp; } - QgsDebugMsg( QString( "ramp name= %1 variant= %2 - %3 variants" ).arg( ramp->schemeName() ).arg( ramp->variantName() ).arg( ramp->variantList().count() ) ); + QgsDebugMsg( QString( "ramp name= %1 variant= %2 - %3 variants" ).arg( ramp->schemeName(), ramp->variantName() ).arg( ramp->variantList().count() ) ); // model / view QgsDebugMsg( "loading model/view objects" ); @@ -182,7 +182,7 @@ void QgsCptCityColorRampV2Dialog::populateVariants() { QStringList variantList = mRamp->variantList(); - QgsDebugMsg( QString( "ramp %1%2 has %3 variants" ).arg( mRamp->schemeName() ).arg( mRamp->variantName() ).arg( variantList.count() ) ); + QgsDebugMsg( QString( "ramp %1%2 has %3 variants" ).arg( mRamp->schemeName(), mRamp->variantName() ).arg( variantList.count() ) ); cboVariantName->blockSignals( true ); cboVariantName->clear(); @@ -636,7 +636,7 @@ bool QgsCptCityColorRampV2Dialog::updateRamp() { if ( mListRamps[i] == childItem ) { - QgsDebugMsg( QString( "found matching item %1 target=%2" ).arg( mListRamps[i]->path() ).arg( childItem->path() ) ); + QgsDebugMsg( QString( "found matching item %1 target=%2" ).arg( mListRamps[i]->path(), childItem->path() ) ); QListWidgetItem* listItem = mListWidget->item( i ); mListWidget->setCurrentItem( listItem ); // on_mListWidget_itemClicked( listItem ); diff --git a/src/helpviewer/main.cpp b/src/helpviewer/main.cpp index 941ba5bd15b..8f687f8e45f 100644 --- a/src/helpviewer/main.cpp +++ b/src/helpviewer/main.cpp @@ -66,7 +66,7 @@ int main( int argc, char ** argv ) myTranslationCode = settings.value( "locale/userLocale", "en_US" ).toString(); } } - QgsDebugMsg( QString( "Setting translation to %1/qgis_%2" ).arg( i18nPath ).arg( myTranslationCode ) ); + QgsDebugMsg( QString( "Setting translation to %1/qgis_%2" ).arg( i18nPath, myTranslationCode ) ); /* Translation file for QGIS. */ diff --git a/src/plugins/evis/databaseconnection/evisdatabaseconnectiongui.cpp b/src/plugins/evis/databaseconnection/evisdatabaseconnectiongui.cpp index e94b8d5fcc1..32047183dd7 100644 --- a/src/plugins/evis/databaseconnection/evisdatabaseconnectiongui.cpp +++ b/src/plugins/evis/databaseconnection/evisdatabaseconnectiongui.cpp @@ -285,7 +285,7 @@ void eVisDatabaseConnectionGui::on_pbtnConnect_clicked() //Try to connect the database connection object if ( mDatabaseConnection->connect() ) { - teditConsole->append( tr( "Connection to [%1.%2] established" ).arg( leDatabaseHost->text() ).arg( leDatabaseName->text() ) ); + teditConsole->append( tr( "Connection to [%1.%2] established" ).arg( leDatabaseHost->text(), leDatabaseName->text() ) ); lblConnectionStatus->setText( tr( "connected" ) ); //List the tables in the database @@ -299,7 +299,7 @@ void eVisDatabaseConnectionGui::on_pbtnConnect_clicked() else { teditConsole->append( tr( "Connection to [%1.%2] failed: %3" ) - .arg( leDatabaseHost->text() ).arg( leDatabaseName->text() ).arg( mDatabaseConnection->lastError() ) ); + .arg( leDatabaseHost->text(), leDatabaseName->text(), mDatabaseConnection->lastError() ) ); } } } diff --git a/src/plugins/georeferencer/qgsgcpcanvasitem.cpp b/src/plugins/georeferencer/qgsgcpcanvasitem.cpp index e564e323253..7a299765504 100644 --- a/src/plugins/georeferencer/qgsgcpcanvasitem.cpp +++ b/src/plugins/georeferencer/qgsgcpcanvasitem.cpp @@ -67,7 +67,7 @@ void QgsGCPCanvasItem::paint( QPainter* p ) QString msg; if ( showIDs && showCoords ) { - msg = QString( "%1\nX %2\nY %3" ).arg( QString::number( id ) ).arg( QString::number( worldCoords.x(), 'f' ) ).arg( QString::number( worldCoords.y(), 'f' ) ); + msg = QString( "%1\nX %2\nY %3" ).arg( QString::number( id ), QString::number( worldCoords.x(), 'f' ), QString::number( worldCoords.y(), 'f' ) ); } else if ( showIDs ) { @@ -75,7 +75,7 @@ void QgsGCPCanvasItem::paint( QPainter* p ) } else if ( showCoords ) { - msg = QString( "X %1\nY %2" ).arg( QString::number( worldCoords.x(), 'f' ) ).arg( QString::number( worldCoords.y(), 'f' ) ); + msg = QString( "X %1\nY %2" ).arg( QString::number( worldCoords.x(), 'f' ), QString::number( worldCoords.y(), 'f' ) ); } if ( !msg.isEmpty() ) diff --git a/src/plugins/georeferencer/qgsgeorefplugingui.cpp b/src/plugins/georeferencer/qgsgeorefplugingui.cpp index 50e216ef6ba..798208d65d3 100644 --- a/src/plugins/georeferencer/qgsgeorefplugingui.cpp +++ b/src/plugins/georeferencer/qgsgeorefplugingui.cpp @@ -1286,10 +1286,10 @@ void QgsGeorefPluginGui::saveGCPs() Q_FOREACH ( QgsGeorefDataPoint *pt, mPoints ) { points << QString( "%1,%2,%3,%4,%5" ) - .arg( qgsDoubleToString( pt->mapCoords().x() ) ) - .arg( qgsDoubleToString( pt->mapCoords().y() ) ) - .arg( qgsDoubleToString( pt->pixelCoords().x() ) ) - .arg( qgsDoubleToString( pt->pixelCoords().y() ) ) + .arg( qgsDoubleToString( pt->mapCoords().x() ), + qgsDoubleToString( pt->mapCoords().y() ), + qgsDoubleToString( pt->pixelCoords().x() ), + qgsDoubleToString( pt->pixelCoords().y() ) ) .arg( pt->isEnabled() ) << endl; } diff --git a/src/plugins/grass/qgsgrassmoduleoptions.cpp b/src/plugins/grass/qgsgrassmoduleoptions.cpp index ca3d58f7621..cae510cda92 100644 --- a/src/plugins/grass/qgsgrassmoduleoptions.cpp +++ b/src/plugins/grass/qgsgrassmoduleoptions.cpp @@ -931,9 +931,9 @@ QDomDocument QgsGrassModuleStandardOptions::readInterfaceDescription( const QStr + "

PATH=" + environment.value( "PATH" ) + "

PYTHONPATH=" + environment.value( "PYTHONPATH" ) + "

" + tr( "command" ) + QString( ": %1 %2
%3
%4" ) - .arg( cmd ).arg( arguments.join( " " ) ) - .arg( process.readAllStandardOutput().constData() ) - .arg( process.readAllStandardError().constData() ); + .arg( cmd, arguments.join( " " ), + process.readAllStandardOutput().constData(), + process.readAllStandardError().constData() ); QgsDebugMsg( msg ); errors << msg; return gDoc; diff --git a/src/plugins/grass/qgsgrasstools.cpp b/src/plugins/grass/qgsgrasstools.cpp index 4a41a3d6754..f5e5d29603e 100644 --- a/src/plugins/grass/qgsgrasstools.cpp +++ b/src/plugins/grass/qgsgrasstools.cpp @@ -172,7 +172,7 @@ QgsGrassTools::QgsGrassTools( QgisInterface *iface, QWidget * parent, const char //statusBar()->hide(); // set the dialog title - QString title = tr( "GRASS Tools: %1/%2" ).arg( QgsGrass::getDefaultLocation() ).arg( QgsGrass::getDefaultMapset() ); + QString title = tr( "GRASS Tools: %1/%2" ).arg( QgsGrass::getDefaultLocation(), QgsGrass::getDefaultMapset() ); setWindowTitle( title ); // Tree view code. @@ -225,7 +225,7 @@ void QgsGrassTools::showTabs() QString title; if ( QgsGrass::activeMode() ) { - title = tr( "GRASS Tools: %1/%2" ).arg( QgsGrass::getDefaultLocation() ).arg( QgsGrass::getDefaultMapset() ); + title = tr( "GRASS Tools: %1/%2" ).arg( QgsGrass::getDefaultLocation(), QgsGrass::getDefaultMapset() ); } else { diff --git a/src/plugins/oracle_raster/qgsselectgeoraster_ui.cpp b/src/plugins/oracle_raster/qgsselectgeoraster_ui.cpp index 5386a3d9e5f..e62c80ee043 100644 --- a/src/plugins/oracle_raster/qgsselectgeoraster_ui.cpp +++ b/src/plugins/oracle_raster/qgsselectgeoraster_ui.cpp @@ -164,7 +164,7 @@ void QgsOracleSelectGeoraster::connectToServer() { makeConnection = false; QString password = QInputDialog::getText( this, - tr( "Password for %1/@%2" ).arg( username ).arg( database ), + tr( "Password for %1/@%2" ).arg( username, database ), tr( "Please enter your password:" ), QLineEdit::Password, QString::null, @@ -256,25 +256,25 @@ void QgsOracleSelectGeoraster::showSelection( const QString & line ) if ( fields.size() < 4 ) { labelStatus->setText( QString( "%1 GeoRaster table%2" ) - .arg( count ).arg( plural ) ); + .arg( count, plural ) ); checkBox->setEnabled( false ); } else if ( fields.size() == 4 ) { labelStatus->setText( QString( "%1 GeoRaster column%2 on table %3" ) - .arg( count ).arg( plural ).arg( fields[3] ) ); + .arg( count, plural, fields[3] ) ); checkBox->setEnabled( false ); } else if ( fields.size() == 5 ) { labelStatus->setText( QString( "%1 GeoRaster object%2 on table %3 column %4" ) - .arg( count ).arg( plural ).arg( fields[3] ).arg( fields[4] ) ); + .arg( count, plural, fields[3], fields[4] ) ); checkBox->setEnabled( true ); } else { labelStatus->setText( QString( "%1 GeoRaster object%2 on table %3 column %4 where %5" ) - .arg( count ).arg( plural ).arg( fields[3] ).arg( fields[4] ).arg( fields[5] ) ); + .arg( count, plural, fields[3], fields[4], fields[5] ) ); checkBox->setEnabled( true ); } diff --git a/src/plugins/spatialquery/qgsspatialquerydialog.cpp b/src/plugins/spatialquery/qgsspatialquerydialog.cpp index 1156d047008..cb069a2238a 100644 --- a/src/plugins/spatialquery/qgsspatialquerydialog.cpp +++ b/src/plugins/spatialquery/qgsspatialquerydialog.cpp @@ -265,7 +265,7 @@ QString QgsSpatialQueryDialog::getSubsetFIDs( const QgsFeatureIds *fids, const Q lstFID.append( FID_TO_STRING( item.next() ) ); } QString qFormat( "%1 in (%2)" ); - QString qReturn = qFormat.arg( fieldFID ).arg( lstFID.join( "," ) ); + QString qReturn = qFormat.arg( fieldFID, lstFID.join( "," ) ); lstFID.clear(); return qReturn; } // QString QgsSpatialQueryDialog::getSubsetFIDs( const QgsFeatureIds *fids, QString fieldFID ) @@ -322,7 +322,7 @@ QString QgsSpatialQueryDialog::getDescriptionLayerShow( bool isTarget ) ? tr( "%1 of %2" ).arg( lyr->selectedFeatureCount() ).arg( lyr->featureCount() ) : tr( "all = %1" ).arg( lyr->featureCount() ); - return QString( "%1 (%2)" ).arg( lyr->name() ).arg( sDescFeatures ); + return QString( "%1 (%2)" ).arg( lyr->name(), sDescFeatures ); } // QString QgsSpatialQueryDialog::getDescriptionLayerShow(bool isTarget) QString QgsSpatialQueryDialog::getDescriptionInvalidFeaturesShow( bool isTarget ) @@ -347,7 +347,7 @@ QString QgsSpatialQueryDialog::getDescriptionInvalidFeaturesShow( bool isTarget ? tr( "%1 of %2(selected features)" ).arg( totalInvalid ).arg( lyr->selectedFeatureCount() ) : tr( "%1 of %2" ).arg( totalInvalid ).arg( lyr->featureCount() ); - return QString( "%1: %2" ).arg( lyr->name() ).arg( sDescFeatures ); + return QString( "%1: %2" ).arg( lyr->name(), sDescFeatures ); } // QString QgsSpatialQueryDialog::getDescriptionInvalidFeatures(bool isTarget) void QgsSpatialQueryDialog::connectAll() @@ -692,7 +692,7 @@ void QgsSpatialQueryDialog::zoomFeature( QgsVectorLayer* lyr, QgsFeatureId fid ) bool isFly = mIface->mapCanvas()->mapSettings().hasCrsTransformEnabled(); QString msgFly = tr( "Map \"%1\" \"on the fly\" transformation." ).arg( isFly ? tr( "enable" ) : tr( "disable" ) ); QString msg = tr( "Coordinate reference system(CRS) of\n\"%1\" is invalid(see CRS of provider)." ).arg( lyr->name() ); - msg.append( tr( "\n\nCRS of map is %1.\n%2." ).arg( crsMapcanvas ).arg( msgFly ) ); + msg.append( tr( "\n\nCRS of map is %1.\n%2." ).arg( crsMapcanvas, msgFly ) ); msg.append( "\n\nUsing CRS of map for all features!" ); QMessageBox::warning( this, tr( "Zoom to feature" ), msg, QMessageBox::Ok ); @@ -825,10 +825,10 @@ void QgsSpatialQueryDialog::on_pbCreateLayerItems_clicked() } QString subset = getSubsetFIDs( fids, fieldFID ); - QString name = QString( "%1 < %2 > %3" ).arg( mLayerTarget->name() ).arg( cbOperation->currentText() ).arg( mLayerReference->name() ); + QString name = QString( "%1 < %2 > %3" ).arg( mLayerTarget->name(), cbOperation->currentText(), mLayerReference->name() ); if ( ! addLayerSubset( name, subset ) ) { - msg = tr( "The query from \"%1\" using \"%2\" in field not possible." ).arg( mLayerTarget->name() ).arg( fieldFID ); + msg = tr( "The query from \"%1\" using \"%2\" in field not possible." ).arg( mLayerTarget->name(), fieldFID ); QMessageBox::critical( this, title, msg, QMessageBox::Ok ); } } // void QgsSpatialQueryDialog::on_pbCreateLayerItems_clicked() @@ -854,7 +854,7 @@ void QgsSpatialQueryDialog::on_pbCreateLayerSelected_clicked() QString name = QString( "%1 selected" ).arg( mLayerTarget->name() ); if ( ! addLayerSubset( name, subset ) ) { - msg = tr( "The query from \"%1\" using \"%2\" in field not possible." ).arg( mLayerTarget->name() ).arg( fieldFID ); + msg = tr( "The query from \"%1\" using \"%2\" in field not possible." ).arg( mLayerTarget->name(), fieldFID ); QMessageBox::critical( this, title, msg, QMessageBox::Ok ); } } // void QgsSpatialQueryDialog::on_pbCreateLayerSelected_clicked() diff --git a/src/plugins/spit/qgsshapefile.cpp b/src/plugins/spit/qgsshapefile.cpp index 626fe06485b..da4e33ff5c3 100644 --- a/src/plugins/spit/qgsshapefile.cpp +++ b/src/plugins/spit/qgsshapefile.cpp @@ -272,15 +272,15 @@ bool QgsShapeFile::insertLayer( const QString& dbname, const QString& schema, co bool result = true; QString query = QString( "CREATE TABLE %1.%2(%3 SERIAL PRIMARY KEY" ) - .arg( QgsPgUtil::quotedIdentifier( schema ) ) - .arg( QgsPgUtil::quotedIdentifier( table_name ) ) - .arg( QgsPgUtil::quotedIdentifier( primary_key ) ); + .arg( QgsPgUtil::quotedIdentifier( schema ), + QgsPgUtil::quotedIdentifier( table_name ), + QgsPgUtil::quotedIdentifier( primary_key ) ); for ( int n = 0; n < column_names.size() && result; n++ ) { query += QString( ",%1 %2" ) - .arg( QgsPgUtil::quotedIdentifier( column_names[n] ) ) - .arg( column_types[n] ); + .arg( QgsPgUtil::quotedIdentifier( column_names[n] ), + column_types[n] ); } query += " )"; @@ -292,7 +292,7 @@ bool QgsShapeFile::insertLayer( const QString& dbname, const QString& schema, co { // flag error and send query and error message to stdout on debug errorText += tr( "The database gave an error while executing this SQL:\n%1\nThe error was:\n%2\n" ) - .arg( query ).arg( PQresultErrorMessage( res ) ); + .arg( query, PQresultErrorMessage( res ) ); PQclear( res ); return false; } @@ -302,18 +302,18 @@ bool QgsShapeFile::insertLayer( const QString& dbname, const QString& schema, co } query = QString( "SELECT AddGeometryColumn(%1,%2,%3,%4,%5,2)" ) - .arg( QgsPgUtil::quotedValue( schema ) ) - .arg( QgsPgUtil::quotedValue( table_name ) ) - .arg( QgsPgUtil::quotedValue( geom_col ) ) - .arg( srid ) - .arg( QgsPgUtil::quotedValue( geom_type ) ); + .arg( QgsPgUtil::quotedValue( schema ), + QgsPgUtil::quotedValue( table_name ), + QgsPgUtil::quotedValue( geom_col ), + srid, + QgsPgUtil::quotedValue( geom_type ) ); res = PQexec( conn, query.toUtf8() ); if ( PQresultStatus( res ) != PGRES_TUPLES_OK ) { errorText += tr( "The database gave an error while executing this SQL:\n%1\nThe error was:\n%2\n" ) - .arg( query ).arg( PQresultErrorMessage( res ) ); + .arg( query, PQresultErrorMessage( res ) ); PQclear( res ); return false; } @@ -325,8 +325,8 @@ bool QgsShapeFile::insertLayer( const QString& dbname, const QString& schema, co if ( isMulti ) { query = QString( "select constraint_name from information_schema.table_constraints where table_schema=%1 and table_name=%2 and constraint_name in ('$2','enforce_geotype_the_geom')" ) - .arg( QgsPgUtil::quotedValue( schema ) ) - .arg( QgsPgUtil::quotedValue( table_name ) ); + .arg( QgsPgUtil::quotedValue( schema ), + QgsPgUtil::quotedValue( table_name ) ); QStringList constraints; res = PQexec( conn, query.toUtf8() ); @@ -345,14 +345,14 @@ bool QgsShapeFile::insertLayer( const QString& dbname, const QString& schema, co // multiple types in the check constraint. For now, we // just drop the constraint... query = QString( "alter table %1 drop constraint %2" ) - .arg( QgsPgUtil::quotedIdentifier( table_name ) ) - .arg( QgsPgUtil::quotedIdentifier( constraints[0] ) ); + .arg( QgsPgUtil::quotedIdentifier( table_name ), + QgsPgUtil::quotedIdentifier( constraints[0] ) ); res = PQexec( conn, query.toUtf8() ); if ( PQresultStatus( res ) != PGRES_COMMAND_OK ) { errorText += tr( "The database gave an error while executing this SQL:\n%1\nThe error was:\n%2\n" ) - .arg( query ).arg( PQresultErrorMessage( res ) ); + .arg( query, PQresultErrorMessage( res ) ); PQclear( res ); return false; } @@ -378,8 +378,8 @@ bool QgsShapeFile::insertLayer( const QString& dbname, const QString& schema, co if ( geom ) { query = QString( "INSERT INTO %1.%2(" ) - .arg( QgsPgUtil::quotedIdentifier( schema ) ) - .arg( QgsPgUtil::quotedIdentifier( table_name ) ); + .arg( QgsPgUtil::quotedIdentifier( schema ), + QgsPgUtil::quotedIdentifier( table_name ) ); QString values = " VALUES ("; char *geo_temp; @@ -416,8 +416,8 @@ bool QgsShapeFile::insertLayer( const QString& dbname, const QString& schema, co } query += "," + QgsPgUtil::quotedIdentifier( geom_col ); values += QString( ",st_geometryfromtext(%1,%2)" ) - .arg( QgsPgUtil::quotedValue( geometry ) ) - .arg( srid ); + .arg( QgsPgUtil::quotedValue( geometry ), + srid ); query += ")" + values + ")"; diff --git a/src/plugins/spit/qgsspit.cpp b/src/plugins/spit/qgsspit.cpp index 0c2806d06d7..2efcd16b500 100644 --- a/src/plugins/spit/qgsspit.cpp +++ b/src/plugins/spit/qgsspit.cpp @@ -568,7 +568,7 @@ void QgsSpit::import() for ( int k = 1; k < names_copy.size(); k++ ) { - QgsDebugMsg( QString( "Checking to see if %1 == %2" ).arg( names_copy[ k ] ).arg( names_copy[ k - 1 ] ) ); + QgsDebugMsg( QString( "Checking to see if %1 == %2" ).arg( names_copy[ k ], names_copy[ k - 1 ] ) ); if ( names_copy[ k ] == names_copy[ k - 1 ] ) dupl += names_copy[ k ] + "\n"; } @@ -578,7 +578,7 @@ void QgsSpit::import() { QMessageBox::warning( &pro, tr( "Import Shapefiles" ), tr( "%1\nThe following fields are duplicates:\n%2" ) - .arg( error ).arg( dupl ) ); + .arg( error, dupl ) ); pro.setValue( pro.value() + tblShapefiles->item( i, ColFEATURECOUNT )->text().toInt() ); continue; } @@ -587,8 +587,8 @@ void QgsSpit::import() fileList[ i ] ->setTable( tblShapefiles->item( i, ColDBRELATIONNAME )->text() ); pro.setLabelText( tr( "Importing files\n%1" ).arg( tblShapefiles->item( i, ColFILENAME )->text() ) ); query = QString( "SELECT f_table_name FROM geometry_columns WHERE f_table_name=%1 AND f_table_schema=%2" ) - .arg( QgsPgUtil::quotedValue( tblShapefiles->item( i, ColDBRELATIONNAME )->text() ) ) - .arg( QgsPgUtil::quotedValue( tblShapefiles->item( i, ColDBSCHEMA )->text() ) ); + .arg( QgsPgUtil::quotedValue( tblShapefiles->item( i, ColDBRELATIONNAME )->text() ), + QgsPgUtil::quotedValue( tblShapefiles->item( i, ColDBSCHEMA )->text() ) ); res = PQexec( conn, query.toUtf8() ); bool rel_exists1 = ( PQntuples( res ) > 0 ); @@ -597,7 +597,7 @@ void QgsSpit::import() QString err = PQresultErrorMessage( res ); QMessageBox::warning( &pro, tr( "Import Shapefiles" ), tr( "%1\n

Error while executing the SQL:

%2

The database said:%3

" ) - .arg( error ).arg( query ).arg( err ) ); + .arg( error, query, err ) ); pro.setValue( pro.value() + tblShapefiles->item( i, ColFEATURECOUNT )->text().toInt() ); PQclear( res ); continue; @@ -606,8 +606,8 @@ void QgsSpit::import() PQclear( res ); query = QString( "SELECT tablename FROM pg_tables WHERE tablename=%1 AND schemaname=%2" ) - .arg( QgsPgUtil::quotedValue( tblShapefiles->item( i, ColDBRELATIONNAME )->text() ) ) - .arg( QgsPgUtil::quotedValue( tblShapefiles->item( i, ColDBSCHEMA )->text() ) ); + .arg( QgsPgUtil::quotedValue( tblShapefiles->item( i, ColDBRELATIONNAME )->text() ), + QgsPgUtil::quotedValue( tblShapefiles->item( i, ColDBSCHEMA )->text() ) ); res = PQexec( conn, query.toUtf8() ); bool rel_exists2 = ( PQntuples( res ) > 0 ); @@ -617,7 +617,7 @@ void QgsSpit::import() QString err = PQresultErrorMessage( res ); QMessageBox::warning( &pro, tr( "Import Shapefiles" ), tr( "%1\n

Error while executing the SQL:

%2

The database said:%3

" ) - .arg( error ).arg( query ).arg( err ) ); + .arg( error, query, err ) ); pro.setValue( pro.value() + tblShapefiles->item( i, ColFEATURECOUNT )->text().toInt() ); PQclear( res ); @@ -636,7 +636,7 @@ void QgsSpit::import() QString err = PQresultErrorMessage( res ); QMessageBox::warning( &pro, tr( "Import Shapefiles" ), tr( "%1\n

Error while executing the SQL:

%2

The database said:%3

" ) - .arg( error ).arg( query ).arg( err ) ); + .arg( error, query, err ) ); pro.setValue( pro.value() + tblShapefiles->item( i, ColFEATURECOUNT )->text().toInt() ); PQclear( res ); @@ -660,7 +660,7 @@ void QgsSpit::import() QMessageBox::warning( &pro, tr( "Import Shapefiles" ), error + "\n" + tr( "%1\n

Error while executing the SQL:

%2

The database said:%3

" ) - .arg( error ).arg( query ).arg( err ) ); + .arg( error, query, err ) ); pro.setValue( pro.value() + tblShapefiles->item( i, ColFEATURECOUNT )->text().toInt() ); PQclear( res ); @@ -680,8 +680,8 @@ void QgsSpit::import() "To avoid data loss change the \"DB Relation Name\"\n" "for this Shapefile in the main dialog file list.\n\n" "Do you want to overwrite the [%2] relation?" ) - .arg( tblShapefiles->item( i, 0 )->text() ) - .arg( tblShapefiles->item( i, ColDBRELATIONNAME )->text() ), + .arg( tblShapefiles->item( i, 0 )->text(), + tblShapefiles->item( i, ColDBRELATIONNAME )->text() ), QMessageBox::Ok | QMessageBox::Cancel ); if ( del_confirm == QMessageBox::Ok ) @@ -697,7 +697,7 @@ void QgsSpit::import() QString err = PQresultErrorMessage( res ); QMessageBox::warning( &pro, tr( "Import Shapefiles" ), tr( "%1\n

Error while executing the SQL:

%2

The database said:%3

" ) - .arg( error ).arg( query ).arg( err ) ); + .arg( error, query, err ) ); pro.setValue( pro.value() + tblShapefiles->item( i, ColFEATURECOUNT )->text().toInt() ); PQclear( res ); continue; @@ -711,8 +711,8 @@ void QgsSpit::import() if ( rel_exists1 ) { query = QString( "SELECT f_geometry_column FROM geometry_columns WHERE f_table_schema=%1 AND f_table_name=%2" ) - .arg( QgsPgUtil::quotedValue( tblShapefiles->item( i, ColDBSCHEMA )->text() ) ) - .arg( QgsPgUtil::quotedValue( tblShapefiles->item( i, ColDBRELATIONNAME )->text() ) ); + .arg( QgsPgUtil::quotedValue( tblShapefiles->item( i, ColDBSCHEMA )->text() ), + QgsPgUtil::quotedValue( tblShapefiles->item( i, ColDBRELATIONNAME )->text() ) ); QStringList columns; res = PQexec( conn, query.toUtf8() ); @@ -726,9 +726,9 @@ void QgsSpit::import() for ( int i = 0; i < columns.size(); i++ ) { query = QString( "SELECT DropGeometryColumn(%1,%2,%3)" ) - .arg( QgsPgUtil::quotedValue( tblShapefiles->item( i, ColDBSCHEMA )->text() ) ) - .arg( QgsPgUtil::quotedValue( tblShapefiles->item( i, ColDBRELATIONNAME )->text() ) ) - .arg( QgsPgUtil::quotedValue( columns[i] ) ); + .arg( QgsPgUtil::quotedValue( tblShapefiles->item( i, ColDBSCHEMA )->text() ), + QgsPgUtil::quotedValue( tblShapefiles->item( i, ColDBRELATIONNAME )->text() ), + QgsPgUtil::quotedValue( columns[i] ) ); res = PQexec( conn, query.toUtf8() ); if ( PQresultStatus( res ) != PGRES_COMMAND_OK ) @@ -736,7 +736,7 @@ void QgsSpit::import() QString err = PQresultErrorMessage( res ); QMessageBox::warning( &pro, tr( "Import Shapefiles" ), tr( "%1\n

Error while executing the SQL:

%2

The database said:%3

" ) - .arg( error ).arg( query ).arg( err ) ); + .arg( error, query, err ) ); pro.setValue( pro.value() + tblShapefiles->item( i, ColFEATURECOUNT )->text().toInt() ); } @@ -753,7 +753,7 @@ void QgsSpit::import() QString err = PQresultErrorMessage( res ); QMessageBox::warning( &pro, tr( "Import Shapefiles" ), tr( "%1\n

Error while executing the SQL:

%2

The database said:%3

" ) - .arg( error ).arg( query ).arg( err ) ); + .arg( error, query, err ) ); } PQclear( res ); @@ -782,7 +782,7 @@ void QgsSpit::import() QString err = PQresultErrorMessage( res ); QMessageBox::warning( &pro, tr( "Import Shapefiles" ), tr( "%1\n

Error while executing the SQL:

%2

The database said:%3

" ) - .arg( error ).arg( query ).arg( err ) ); + .arg( error, query, err ) ); PQclear( res ); continue; } @@ -815,7 +815,7 @@ void QgsSpit::import() QString err = PQresultErrorMessage( res ); QMessageBox::warning( &pro, tr( "Import Shapefiles" ), tr( "%1\n

Error while executing the SQL:

%2

The database said:%3

" ) - .arg( error ).arg( query ).arg( err ) ); + .arg( error, query, err ) ); } PQclear( res ); diff --git a/src/providers/delimitedtext/qgsdelimitedtextprovider.cpp b/src/providers/delimitedtext/qgsdelimitedtextprovider.cpp index 9b72ddb12d4..94b6f501bbf 100644 --- a/src/providers/delimitedtext/qgsdelimitedtextprovider.cpp +++ b/src/providers/delimitedtext/qgsdelimitedtextprovider.cpp @@ -364,7 +364,7 @@ void QgsDelimitedTextProvider::scanFile( bool buildIndexes ) mWktFieldIndex = mFile->fieldIndex( mWktFieldName ); if ( mWktFieldIndex < 0 ) { - messages.append( tr( "%0 field %1 is not defined in delimited text file" ).arg( "Wkt" ).arg( mWktFieldName ) ); + messages.append( tr( "%0 field %1 is not defined in delimited text file" ).arg( "Wkt", mWktFieldName ) ); } } else if ( mGeomRep == GeomAsXy ) @@ -373,11 +373,11 @@ void QgsDelimitedTextProvider::scanFile( bool buildIndexes ) mYFieldIndex = mFile->fieldIndex( mYFieldName ); if ( mXFieldIndex < 0 ) { - messages.append( tr( "%0 field %1 is not defined in delimited text file" ).arg( "X" ).arg( mWktFieldName ) ); + messages.append( tr( "%0 field %1 is not defined in delimited text file" ).arg( "X", mWktFieldName ) ); } if ( mYFieldIndex < 0 ) { - messages.append( tr( "%0 field %1 is not defined in delimited text file" ).arg( "Y" ).arg( mWktFieldName ) ); + messages.append( tr( "%0 field %1 is not defined in delimited text file" ).arg( "Y", mWktFieldName ) ); } } if ( messages.size() > 0 ) @@ -739,7 +739,7 @@ void QgsDelimitedTextProvider::rescanFile() mWktFieldIndex = mFile->fieldIndex( mWktFieldName ); if ( mWktFieldIndex < 0 ) { - messages.append( tr( "%0 field %1 is not defined in delimited text file" ).arg( "Wkt" ).arg( mWktFieldName ) ); + messages.append( tr( "%0 field %1 is not defined in delimited text file" ).arg( "Wkt", mWktFieldName ) ); } } else if ( mGeomRep == GeomAsXy ) @@ -748,11 +748,11 @@ void QgsDelimitedTextProvider::rescanFile() mYFieldIndex = mFile->fieldIndex( mYFieldName ); if ( mXFieldIndex < 0 ) { - messages.append( tr( "%0 field %1 is not defined in delimited text file" ).arg( "X" ).arg( mWktFieldName ) ); + messages.append( tr( "%0 field %1 is not defined in delimited text file" ).arg( "X", mWktFieldName ) ); } if ( mYFieldIndex < 0 ) { - messages.append( tr( "%0 field %1 is not defined in delimited text file" ).arg( "Y" ).arg( mWktFieldName ) ); + messages.append( tr( "%0 field %1 is not defined in delimited text file" ).arg( "Y", mWktFieldName ) ); } } if ( messages.size() > 0 ) @@ -1019,7 +1019,7 @@ bool QgsDelimitedTextProvider::setSubsetString( QString subset, bool updateFeatu delete expression; expression = 0; QString tag( "DelimitedText" ); - QgsMessageLog::logMessage( tr( "Invalid subset string %1 for %2" ).arg( subset ).arg( mFile->fileName() ), tag ); + QgsMessageLog::logMessage( tr( "Invalid subset string %1 for %2" ).arg( subset, mFile->fileName() ), tag ); } } diff --git a/src/providers/gdal/qgsgdaldataitems.cpp b/src/providers/gdal/qgsgdaldataitems.cpp index b9274210642..da2eddb7336 100644 --- a/src/providers/gdal/qgsgdaldataitems.cpp +++ b/src/providers/gdal/qgsgdaldataitems.cpp @@ -267,7 +267,7 @@ QGISEXTERN QgsDataItem * dataItem( QString thePath, QgsDataItem* parentItem ) } // add the item QStringList sublayers; - QgsDebugMsgLevel( QString( "adding item name=%1 thePath=%2" ).arg( name ).arg( thePath ), 2 ); + QgsDebugMsgLevel( QString( "adding item name=%1 thePath=%2" ).arg( name, thePath ), 2 ); QgsLayerItem * item = new QgsGdalLayerItem( parentItem, name, thePath, thePath, &sublayers ); if ( item ) return item; diff --git a/src/providers/gdal/qgsgdalprovider.cpp b/src/providers/gdal/qgsgdalprovider.cpp index d720414d559..dd77bed312d 100644 --- a/src/providers/gdal/qgsgdalprovider.cpp +++ b/src/providers/gdal/qgsgdalprovider.cpp @@ -145,7 +145,7 @@ QgsGdalProvider::QgsGdalProvider( const QString &uri, bool update ) { if ( !uri.startsWith( vsiPrefix ) ) setDataSourceUri( vsiPrefix + uri ); - QgsDebugMsg( QString( "Trying %1 syntax, uri= %2" ).arg( vsiPrefix ).arg( dataSourceUri() ) ); + QgsDebugMsg( QString( "Trying %1 syntax, uri= %2" ).arg( vsiPrefix, dataSourceUri() ) ); } QString gdalUri = dataSourceUri(); @@ -155,7 +155,7 @@ QgsGdalProvider::QgsGdalProvider( const QString &uri, bool update ) if ( !mGdalBaseDataset ) { - QString msg = QString( "Cannot open GDAL dataset %1:\n%2" ).arg( dataSourceUri() ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ); + QString msg = QString( "Cannot open GDAL dataset %1:\n%2" ).arg( dataSourceUri(), QString::fromUtf8( CPLGetLastErrorMsg() ) ); appendError( ERRMSG( msg ) ); return; } @@ -182,8 +182,8 @@ bool QgsGdalProvider::crsFromWkt( const char *wkt ) if ( OSRAutoIdentifyEPSG( hCRS ) == OGRERR_NONE ) { QString authid = QString( "%1:%2" ) - .arg( OSRGetAuthorityName( hCRS, NULL ) ) - .arg( OSRGetAuthorityCode( hCRS, NULL ) ); + .arg( OSRGetAuthorityName( hCRS, NULL ), + OSRGetAuthorityCode( hCRS, NULL ) ); QgsDebugMsg( "authid recognized as " + authid ); mCrs.createFromOgcWmsCrs( authid ); } @@ -1575,7 +1575,7 @@ QString QgsGdalProvider::buildPyramids( const QList & theRaste myConfigOptionsOld[ opt[0] ] = QString( CPLGetConfigOption( key.data(), NULL ) ); // set temp. value CPLSetConfigOption( key.data(), value.data() ); - QgsDebugMsg( QString( "set option %1=%2" ).arg( key.data() ).arg( value.data() ) ); + QgsDebugMsg( QString( "set option %1=%2" ).arg( key.data(), value.data() ) ); } } @@ -2179,7 +2179,7 @@ QGISEXTERN bool isValidRasterFileName( QString const & theFileNameQString, QStri { if ( !fileName.startsWith( vsiPrefix ) ) fileName = vsiPrefix + fileName; - QgsDebugMsg( QString( "Trying %1 syntax, fileName= %2" ).arg( vsiPrefix ).arg( fileName ) ); + QgsDebugMsg( QString( "Trying %1 syntax, fileName= %2" ).arg( vsiPrefix, fileName ) ); } //open the file using gdal making sure we have handled locale properly @@ -2726,7 +2726,7 @@ QGISEXTERN QgsGdalProvider * create( CSLDestroy( papszOptions ); if ( dataset == NULL ) { - QgsError error( QString( "Cannot create new dataset %1:\n%2" ).arg( uri ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ), "GDAL provider" ); + QgsError error( QString( "Cannot create new dataset %1:\n%2" ).arg( uri, QString::fromUtf8( CPLGetLastErrorMsg() ) ), "GDAL provider" ); QgsDebugMsg( error.summary() ); return new QgsGdalProvider( uri, error ); } diff --git a/src/providers/grass/qgis.v.in.cpp b/src/providers/grass/qgis.v.in.cpp index 654441cd00a..5dbb54a02f3 100644 --- a/src/providers/grass/qgis.v.in.cpp +++ b/src/providers/grass/qgis.v.in.cpp @@ -149,7 +149,7 @@ int main( int argc, char **argv ) // global finalName, tmpName are used by checkStream() finalName = QString( mapOption->answer ); QDateTime now = QDateTime::currentDateTime(); - tmpName = QString( "qgis_import_tmp_%1_%2" ).arg( mapOption->answer ).arg( now.toString( "yyyyMMddhhmmss" ) ); + tmpName = QString( "qgis_import_tmp_%1_%2" ).arg( mapOption->answer, now.toString( "yyyyMMddhhmmss" ) ); qint32 typeQint32; stdinStream >> typeQint32; diff --git a/src/providers/grass/qgsgrass.cpp b/src/providers/grass/qgsgrass.cpp index e19225e398f..b0ec173731c 100644 --- a/src/providers/grass/qgsgrass.cpp +++ b/src/providers/grass/qgsgrass.cpp @@ -575,13 +575,13 @@ QString QgsGrass::getDefaultMapsetPath() void QgsGrass::setLocation( QString gisdbase, QString location ) { - QgsDebugMsg( QString( "gisdbase = %1 location = %2" ).arg( gisdbase ).arg( location ) ); + QgsDebugMsg( QString( "gisdbase = %1 location = %2" ).arg( gisdbase, location ) ); setMapset( gisdbase, location, "PERMANENT" ); } void QgsGrass::setMapset( QString gisdbase, QString location, QString mapset ) { - QgsDebugMsg( QString( "gisdbase = %1 location = %2 mapset = %3" ).arg( gisdbase ).arg( location ).arg( mapset ) ); + QgsDebugMsg( QString( "gisdbase = %1 location = %2 mapset = %3" ).arg( gisdbase, location, mapset ) ); init(); // Set principal GRASS variables (in memory) @@ -874,8 +874,8 @@ QString QgsGrass::openMapset( const QString& gisdbase, QString processResult = QString( "exitStatus=%1, exitCode=%2, errorCode=%3, error=%4 stdout=%5, stderr=%6" ) .arg( process.exitStatus() ).arg( process.exitCode() ) - .arg( process.error() ).arg( process.errorString() ) - .arg( process.readAllStandardOutput().data() ).arg( process.readAllStandardError().data() ); + .arg( process.error() ).arg( process.errorString(), + process.readAllStandardOutput().data(), process.readAllStandardError().data() ); QgsDebugMsg( "processResult: " + processResult ); // lock exit code: @@ -1121,7 +1121,7 @@ void QgsGrass::createMapset( const QString& gisdbase, const QString& location, QString dest = locationPath + "/" + mapset + "/WIND"; if ( !QFile::copy( src, dest ) ) { - error = tr( "Cannot copy %1 to %2" ).arg( src ).arg( dest ); + error = tr( "Cannot copy %1 to %2" ).arg( src, dest ); } } @@ -1150,7 +1150,7 @@ QStringList QgsGrass::locations( const QString& gisdbase ) QStringList QgsGrass::mapsets( const QString& gisdbase, const QString& locationName ) { - QgsDebugMsg( QString( "gisbase = %1 locationName = %2" ).arg( gisdbase ).arg( locationName ) ); + QgsDebugMsg( QString( "gisbase = %1 locationName = %2" ).arg( gisdbase, locationName ) ); if ( gisdbase.isEmpty() || locationName.isEmpty() ) return QStringList(); @@ -1269,7 +1269,7 @@ bool QgsGrass::topoVersion( const QString& gisdbase, const QString& location, QStringList QgsGrass::vectorLayers( const QString& gisdbase, const QString& location, const QString& mapset, const QString& mapName ) { - QgsDebugMsg( QString( "gisdbase = %1 location = %2 mapset = %3 mapName = %4" ).arg( gisdbase ).arg( location ).arg( mapset ).arg( mapName ) ); + QgsDebugMsg( QString( "gisdbase = %1 location = %2 mapset = %3 mapName = %4" ).arg( gisdbase, location, mapset, mapName ) ); QStringList list; QgsGrassVector vector( gisdbase, location, mapset, mapName ); @@ -1436,7 +1436,7 @@ QStringList QgsGrass::elements( const QString& gisdbase, const QString& location QStringList QgsGrass::elements( const QString& mapsetPath, const QString& element ) { - QgsDebugMsg( QString( "mapsetPath = %1 element = %2" ).arg( mapsetPath ).arg( element ) ); + QgsDebugMsg( QString( "mapsetPath = %1 element = %2" ).arg( mapsetPath, element ) ); QStringList list; @@ -1843,7 +1843,7 @@ QProcess *QgsGrass::startModule( const QString& gisdbase, const QString& locati const QString& mapset, const QString& moduleName, const QStringList& arguments, QTemporaryFile &gisrcFile, bool qgisModule ) { - QgsDebugMsg( QString( "gisdbase = %1 location = %2" ).arg( gisdbase ).arg( location ) ); + QgsDebugMsg( QString( "gisdbase = %1 location = %2" ).arg( gisdbase, location ) ); QProcess *process = new QProcess(); QString module = moduleName; @@ -1861,7 +1861,7 @@ QProcess *QgsGrass::startModule( const QString& gisdbase, const QString& locati throw QgsGrass::Exception( QObject::tr( "Cannot open GISRC file" ) ); } - QString error = tr( "Cannot start module" ) + "\n" + tr( "command: %1 %2" ).arg( module ).arg( arguments.join( " " ) ); + QString error = tr( "Cannot start module" ) + "\n" + tr( "command: %1 %2" ).arg( module, arguments.join( " " ) ); // Modules must be run in a mapset owned by user, because each module calls G_gisinit() // which checks if G_mapset() is owned by user. @@ -1909,7 +1909,7 @@ QByteArray QgsGrass::runModule( const QString& gisdbase, const QString& locatio const QString& mapset, const QString& moduleName, const QStringList& arguments, int timeOut, bool qgisModule ) { - QgsDebugMsg( QString( "gisdbase = %1 location = %2 timeOut = %3" ).arg( gisdbase ).arg( location ).arg( timeOut ) ); + QgsDebugMsg( QString( "gisdbase = %1 location = %2 timeOut = %3" ).arg( gisdbase, location ).arg( timeOut ) ); QTemporaryFile gisrcFile; QProcess *process = startModule( gisdbase, location, mapset, moduleName, arguments, gisrcFile, qgisModule ); @@ -1921,9 +1921,9 @@ QByteArray QgsGrass::runModule( const QString& gisdbase, const QString& locatio throw QgsGrass::Exception( QObject::tr( "Cannot run module" ) + "\n" + QObject::tr( "command: %1 %2\nstdout: %3\nstderr: %4" ) - .arg( moduleName ).arg( arguments.join( " " ) ) - .arg( process->readAllStandardOutput().constData() ) - .arg( process->readAllStandardError().constData() ) ); + .arg( moduleName, arguments.join( " " ), + process->readAllStandardOutput().constData(), + process->readAllStandardError().constData() ) ); } QByteArray data = process->readAllStandardOutput(); delete process; @@ -1937,7 +1937,7 @@ QString QgsGrass::getInfo( const QString& info, const QString& gisdbase, const QgsRectangle& extent, int sampleRows, int sampleCols, int timeOut ) { - QgsDebugMsg( QString( "gisdbase = %1 location = %2" ).arg( gisdbase ).arg( location ) ); + QgsDebugMsg( QString( "gisdbase = %1 location = %2" ).arg( gisdbase, location ) ); QStringList arguments; @@ -1985,7 +1985,7 @@ QString QgsGrass::getInfo( const QString& info, const QString& gisdbase, QgsCoordinateReferenceSystem QgsGrass::crs( const QString& gisdbase, const QString& location, QString &error ) { - QgsDebugMsg( QString( "gisdbase = %1 location = %2" ).arg( gisdbase ).arg( location ) ); + QgsDebugMsg( QString( "gisdbase = %1 location = %2" ).arg( gisdbase, location ) ); QgsCoordinateReferenceSystem crs = QgsCoordinateReferenceSystem(); try { @@ -2046,7 +2046,7 @@ QgsRectangle QgsGrass::extent( const QString& gisdbase, const QString& location, const QString& mapset, const QString& map, QgsGrassObject::Type type, QString &error ) { - QgsDebugMsg( QString( "gisdbase = %1 location = %2" ).arg( gisdbase ).arg( location ) ); + QgsDebugMsg( QString( "gisdbase = %1 location = %2" ).arg( gisdbase, location ) ); try { @@ -2068,7 +2068,7 @@ QgsRectangle QgsGrass::extent( const QString& gisdbase, const QString& location, void QgsGrass::size( const QString& gisdbase, const QString& location, const QString& mapset, const QString& map, int *cols, int *rows, QString &error ) { - QgsDebugMsg( QString( "gisdbase = %1 location = %2" ).arg( gisdbase ).arg( location ) ); + QgsDebugMsg( QString( "gisdbase = %1 location = %2" ).arg( gisdbase, location ) ); *cols = 0; *rows = 0; @@ -2100,7 +2100,7 @@ QHash QgsGrass::info( const QString& gisdbase, const QString& int sampleRows, int sampleCols, int timeOut, QString &error ) { - QgsDebugMsg( QString( "gisdbase = %1 location = %2" ).arg( gisdbase ).arg( location ) ); + QgsDebugMsg( QString( "gisdbase = %1 location = %2" ).arg( gisdbase, location ) ); QHash inf; try @@ -2131,7 +2131,7 @@ QHash QgsGrass::info( const QString& gisdbase, const QString& QList QgsGrass::colors( QString gisdbase, QString location, QString mapset, QString map, QString& error ) { - QgsDebugMsg( QString( "gisdbase = %1 location = %2" ).arg( gisdbase ).arg( location ) ); + QgsDebugMsg( QString( "gisdbase = %1 location = %2" ).arg( gisdbase, location ) ); QList ct; try @@ -2161,7 +2161,7 @@ QList QgsGrass::colors( QString gisdbase, QString location, QSt QMap QgsGrass::query( QString gisdbase, QString location, QString mapset, QString map, QgsGrassObject::Type type, double x, double y ) { - QgsDebugMsg( QString( "gisdbase = %1 location = %2" ).arg( gisdbase ).arg( location ) ); + QgsDebugMsg( QString( "gisdbase = %1 location = %2" ).arg( gisdbase, location ) ); QMap result; // TODO: multiple values (more rows) @@ -2256,7 +2256,7 @@ bool QgsGrass::deleteObjectDialog( const QgsGrassObject & object ) QgsDebugMsg( "entered" ); return QMessageBox::question( 0, QObject::tr( "Delete confirmation" ), - QObject::tr( "Are you sure you want to delete %1 %2?" ).arg( object.elementName() ).arg( object.name() ), + QObject::tr( "Are you sure you want to delete %1 %2?" ).arg( object.elementName(), object.name() ), QMessageBox::Yes | QMessageBox::No ) == QMessageBox::Yes; } @@ -2334,7 +2334,7 @@ void QgsGrass::createTable( dbDriver *driver, const QString tableName, const Qgs } fieldsStringList << name + " " + typeName; } - QString sql = QString( "create table %1 (%2);" ).arg( tableName ).arg( fieldsStringList.join( ", " ) ); + QString sql = QString( "create table %1 (%2);" ).arg( tableName, fieldsStringList.join( ", " ) ); dbString dbstr; db_init_string( &dbstr ); @@ -2396,7 +2396,7 @@ void QgsGrass::insertRow( dbDriver *driver, const QString tableName, valuesStringList << valueString; } - QString sql = QString( "insert into %1 values (%2);" ).arg( tableName ).arg( valuesStringList.join( ", " ) ); + QString sql = QString( "insert into %1 values (%2);" ).arg( tableName, valuesStringList.join( ", " ) ); dbString dbstr; db_init_string( &dbstr ); diff --git a/src/providers/grass/qgsgrassimport.cpp b/src/providers/grass/qgsgrassimport.cpp index 81fc3a237aa..bdf2137e049 100644 --- a/src/providers/grass/qgsgrassimport.cpp +++ b/src/providers/grass/qgsgrassimport.cpp @@ -436,8 +436,8 @@ bool QgsGrassRasterImport::import() QString processResult = QString( "exitStatus=%1, exitCode=%2, error=%3, errorString=%4 stdout=%5, stderr=%6" ) .arg( mProcess->exitStatus() ).arg( mProcess->exitCode() ) - .arg( mProcess->error() ).arg( mProcess->errorString() ) - .arg( stdoutString.replace( "\n", ", " ) ).arg( stderrString.replace( "\n", ", " ) ); + .arg( mProcess->error() ).arg( mProcess->errorString(), + stdoutString.replace( "\n", ", " ), stderrString.replace( "\n", ", " ) ); QgsDebugMsg( "processResult: " + processResult ); if ( mProcess->exitStatus() != QProcess::NormalExit ) @@ -713,8 +713,8 @@ bool QgsGrassVectorImport::import() QString processResult = QString( "exitStatus=%1, exitCode=%2, error=%3, errorString=%4 stdout=%5, stderr=%6" ) .arg( mProcess->exitStatus() ).arg( mProcess->exitCode() ) - .arg( mProcess->error() ).arg( mProcess->errorString() ) - .arg( stdoutString.replace( "\n", ", " ) ).arg( stderrString.replace( "\n", ", " ) ); + .arg( mProcess->error() ).arg( mProcess->errorString(), + stdoutString.replace( "\n", ", " ), stderrString.replace( "\n", ", " ) ); QgsDebugMsg( "processResult: " + processResult ); if ( mProcess->exitStatus() != QProcess::NormalExit ) diff --git a/src/providers/grass/qgsgrassprovider.cpp b/src/providers/grass/qgsgrassprovider.cpp index b09f54d7e26..3c1b5bc4c80 100644 --- a/src/providers/grass/qgsgrassprovider.cpp +++ b/src/providers/grass/qgsgrassprovider.cpp @@ -945,7 +945,7 @@ QgsAttributeMap *QgsGrassProvider::attributes( int field, int cat ) if ( !driver ) { - QgsDebugMsg( QString( "Cannot open database %1 by driver %2" ).arg( fi->database ).arg( fi->driver ) ); + QgsDebugMsg( QString( "Cannot open database %1 by driver %2" ).arg( fi->database, fi->driver ) ); return att; } diff --git a/src/providers/grass/qgsgrassprovidermodule.cpp b/src/providers/grass/qgsgrassprovidermodule.cpp index 3dfe89444fd..40aae24402b 100644 --- a/src/providers/grass/qgsgrassprovidermodule.cpp +++ b/src/providers/grass/qgsgrassprovidermodule.cpp @@ -177,7 +177,7 @@ void QgsGrassItemActions::renameGrassObject() catch ( QgsGrass::Exception &e ) { QgsMessageOutput::showMessage( errorTitle, - QObject::tr( "Cannot rename %1 to %2" ).arg( mGrassObject.name() ).arg( obj.name() ) + "\n" + e.what(), + QObject::tr( "Cannot rename %1 to %2" ).arg( mGrassObject.name(), obj.name() ) + "\n" + e.what(), QgsMessageOutput::MessageText ); } } @@ -690,12 +690,12 @@ bool QgsGrassMapsetItem::handleDrop( const QMimeData * data, Qt::DropAction ) { if ( !provider ) { - errors.append( tr( "Cannot create provider %1 : %2" ).arg( u.providerKey ).arg( u.uri ) ); + errors.append( tr( "Cannot create provider %1 : %2" ).arg( u.providerKey, u.uri ) ); continue; } if ( !provider->isValid() ) { - errors.append( tr( "Provider is not valid %1 : %2" ).arg( u.providerKey ).arg( u.uri ) ); + errors.append( tr( "Provider is not valid %1 : %2" ).arg( u.providerKey, u.uri ) ); delete provider; continue; } @@ -860,8 +860,9 @@ void QgsGrassMapsetItem::onImportFinished( QgsGrassImport* import ) { QgsMessageOutput *output = QgsMessageOutput::createMessageOutput(); output->setTitle( tr( "Import to GRASS mapset failed" ) ); - output->setMessage( tr( "Failed to import %1 to %2: %3" ).arg( import->srcDescription() ).arg( import->grassObject() - .mapsetPath() ).arg( import->error() ), QgsMessageOutput::MessageText ); + output->setMessage( tr( "Failed to import %1 to %2: %3" ).arg( import->srcDescription(), + import->grassObject().mapsetPath(), + import->error() ), QgsMessageOutput::MessageText ); output->showMessage(); } diff --git a/src/providers/grass/qgsgrassrasterprovider.cpp b/src/providers/grass/qgsgrassrasterprovider.cpp index 04731a96ac4..99efdbaacce 100644 --- a/src/providers/grass/qgsgrassrasterprovider.cpp +++ b/src/providers/grass/qgsgrassrasterprovider.cpp @@ -192,10 +192,10 @@ QImage* QgsGrassRasterProvider::draw( QgsRectangle const & viewExtent, int pixe arguments.append( "map=" + mMapName + "@" + mMapset ); arguments.append(( QString( "window=%1,%2,%3,%4,%5,%6" ) - .arg( QgsRasterBlock::printValue( viewExtent.xMinimum() ) ) - .arg( QgsRasterBlock::printValue( viewExtent.yMinimum() ) ) - .arg( QgsRasterBlock::printValue( viewExtent.xMaximum() ) ) - .arg( QgsRasterBlock::printValue( viewExtent.yMaximum() ) ) + .arg( QgsRasterBlock::printValue( viewExtent.xMinimum() ), + QgsRasterBlock::printValue( viewExtent.yMinimum() ), + QgsRasterBlock::printValue( viewExtent.xMaximum() ), + QgsRasterBlock::printValue( viewExtent.yMaximum() ) ) .arg( pixelWidth ).arg( pixelHeight ) ) ); QString cmd = QgsApplication::libexecPath() + "grass/modules/qgis.d.rast"; QByteArray data; @@ -244,10 +244,10 @@ void QgsGrassRasterProvider::readBlock( int bandNo, int xBlock, int yBlock, void QgsDebugMsg( "mYBlockSize = " + QString::number( mYBlockSize ) ); arguments.append(( QString( "window=%1,%2,%3,%4,%5,%6" ) - .arg( QgsRasterBlock::printValue( ext.xMinimum() ) ) - .arg( QgsRasterBlock::printValue( yMinimum ) ) - .arg( QgsRasterBlock::printValue( ext.xMaximum() ) ) - .arg( QgsRasterBlock::printValue( yMaximum ) ) + .arg( QgsRasterBlock::printValue( ext.xMinimum() ), + QgsRasterBlock::printValue( yMinimum ), + QgsRasterBlock::printValue( ext.xMaximum() ), + QgsRasterBlock::printValue( yMaximum ) ) .arg( mCols ).arg( mYBlockSize ) ) ); arguments.append( "format=value" ); @@ -294,10 +294,10 @@ void QgsGrassRasterProvider::readBlock( int bandNo, QgsRectangle const & viewEx arguments.append( "map=" + mMapName + "@" + mMapset ); arguments.append(( QString( "window=%1,%2,%3,%4,%5,%6" ) - .arg( QgsRasterBlock::printValue( viewExtent.xMinimum() ) ) - .arg( QgsRasterBlock::printValue( viewExtent.yMinimum() ) ) - .arg( QgsRasterBlock::printValue( viewExtent.xMaximum() ) ) - .arg( QgsRasterBlock::printValue( viewExtent.yMaximum() ) ) + .arg( QgsRasterBlock::printValue( viewExtent.xMinimum() ), + QgsRasterBlock::printValue( viewExtent.yMinimum() ), + QgsRasterBlock::printValue( viewExtent.xMaximum() ), + QgsRasterBlock::printValue( viewExtent.yMaximum() ) ) .arg( pixelWidth ).arg( pixelHeight ) ) ); arguments.append( "format=value" ); QString cmd = QgsApplication::libexecPath() + "grass/modules/qgis.d.rast"; @@ -717,8 +717,8 @@ double QgsGrassRasterValue::value( double x, double y, bool *ok ) if ( !mProcess ) return value; - QString coor = QString( "%1 %2\n" ).arg( QgsRasterBlock::printValue( x ) ) - .arg( QgsRasterBlock::printValue( y ) ); + QString coor = QString( "%1 %2\n" ).arg( QgsRasterBlock::printValue( x ), + QgsRasterBlock::printValue( y ) ); QgsDebugMsg( "coor : " + coor ); mProcess->write( coor.toAscii() ); // how to flush, necessary? mProcess->waitForReadyRead(); diff --git a/src/providers/grass/qgsgrassvector.cpp b/src/providers/grass/qgsgrassvector.cpp index 6542bc8be66..e26c65f4a43 100644 --- a/src/providers/grass/qgsgrassvector.cpp +++ b/src/providers/grass/qgsgrassvector.cpp @@ -129,7 +129,7 @@ QgsFields QgsGrassVectorLayer::fields() if ( !driver ) { - mError = QObject::tr( "Cannot open database %1 by driver %2" ).arg( mDatabase ).arg( mDatabase ); + mError = QObject::tr( "Cannot open database %1 by driver %2" ).arg( mDatabase, mDatabase ); QgsDebugMsg( mError ); } else diff --git a/src/providers/grass/qgsgrassvectormaplayer.cpp b/src/providers/grass/qgsgrassvectormaplayer.cpp index 6c6e0e1d140..07b4510469a 100644 --- a/src/providers/grass/qgsgrassvectormaplayer.cpp +++ b/src/providers/grass/qgsgrassvectormaplayer.cpp @@ -113,7 +113,7 @@ void QgsGrassVectorMapLayer::load() QgsGrass::lock(); dbDriver *databaseDriver = 0; - QString error = QString( "Cannot open database %1 by driver %2" ).arg( mFieldInfo->database ).arg( mFieldInfo->driver ); + QString error = QString( "Cannot open database %1 by driver %2" ).arg( mFieldInfo->database, mFieldInfo->driver ); G_TRY { setMapset(); @@ -196,7 +196,7 @@ void QgsGrassVectorMapLayer::load() if ( mKeyColumn < 0 ) { mTableFields.clear(); - QgsGrass::warning( QObject::tr( "Key column '%1' not found in the table '%2'" ).arg( mFieldInfo->key ).arg( mFieldInfo->table ) ); + QgsGrass::warning( QObject::tr( "Key column '%1' not found in the table '%2'" ).arg( mFieldInfo->key, mFieldInfo->table ) ); } else { @@ -239,7 +239,7 @@ void QgsGrassVectorMapLayer::load() value = db_get_column_value( column ); db_convert_value_to_string( value, sqltype, &dbstr ); - QgsDebugMsgLevel( QString( "column = %1 value = %2" ).arg( db_get_column_name( column ) ).arg( db_get_string( &dbstr ) ), 3 ); + QgsDebugMsgLevel( QString( "column = %1 value = %2" ).arg( db_get_column_name( column ), db_get_string( &dbstr ) ), 3 ); QVariant variant; if ( !db_test_value_isnull( value ) ) @@ -271,7 +271,7 @@ void QgsGrassVectorMapLayer::load() variant = QVariant( QByteArray( db_get_string( &dbstr ) ) ); } } - QgsDebugMsgLevel( QString( "column = %1 variant = %2" ).arg( db_get_column_name( column ) ).arg( variant.toString() ), 3 ); + QgsDebugMsgLevel( QString( "column = %1 variant = %2" ).arg( db_get_column_name( column ), variant.toString() ), 3 ); values << variant; } mAttributes.insert( cat, values ); @@ -439,7 +439,7 @@ dbDriver * QgsGrassVectorMapLayer::openDriver( QString &error ) if ( !driver ) { - error = tr( "Cannot open database %1 by driver %2" ).arg( mFieldInfo->database ).arg( mFieldInfo->driver ); + error = tr( "Cannot open database %1 by driver %2" ).arg( mFieldInfo->database, mFieldInfo->driver ); QgsDebugMsg( error ); } else @@ -681,7 +681,7 @@ void QgsGrassVectorMapLayer::addColumn( const QgsField &field, QString &error ) type = QString( "%1(%2)" ).arg( type ).arg( field.length() ); } } - QString query = QString( "ALTER TABLE %1 ADD COLUMN %2 %3" ).arg( mFieldInfo->table ).arg( field.name() ).arg( type ); + QString query = QString( "ALTER TABLE %1 ADD COLUMN %2 %3" ).arg( mFieldInfo->table, field.name(), type ); executeSql( query, error ); if ( error.isEmpty() ) @@ -698,7 +698,7 @@ void QgsGrassVectorMapLayer::addColumn( const QgsField &field, QString &error ) { QVariant value = mAttributes.value( cat ).value( index ); QString valueString = quotedValue( value ); - QString query = QString( "UPDATE %1 SET %2 = %3" ).arg( mFieldInfo->table ).arg( field.name() ).arg( valueString ); + QString query = QString( "UPDATE %1 SET %2 = %3" ).arg( mFieldInfo->table, field.name(), valueString ); QString err; executeSql( query, err ); if ( !err.isEmpty() ) @@ -749,11 +749,11 @@ void QgsGrassVectorMapLayer::deleteColumn( const QgsField &field, QString &error } QStringList queries; queries << "BEGIN TRANSACTION"; - queries << QString( "CREATE TEMPORARY TABLE %1_tmp_drop_column AS SELECT %2 FROM %1" ).arg( mFieldInfo->table ).arg( columns.join( "," ) ); + queries << QString( "CREATE TEMPORARY TABLE %1_tmp_drop_column AS SELECT %2 FROM %1" ).arg( mFieldInfo->table, columns.join( "," ) ); queries << QString( "DROP TABLE %1" ).arg( mFieldInfo->table ); queries << QString( "CREATE TABLE %1 AS SELECT * FROM %1_tmp_drop_column" ).arg( mFieldInfo->table ); queries << QString( "DROP TABLE %1_tmp_drop_column" ).arg( mFieldInfo->table ); - queries << QString( "CREATE UNIQUE INDEX %1_%2 ON %1 (%2)" ).arg( mFieldInfo->table ).arg( mFieldInfo->key ); + queries << QString( "CREATE UNIQUE INDEX %1_%2 ON %1 (%2)" ).arg( mFieldInfo->table, mFieldInfo->key ); queries << "COMMIT"; // Execute one after another to get possible error Q_FOREACH ( const QString& query, queries ) @@ -768,7 +768,7 @@ void QgsGrassVectorMapLayer::deleteColumn( const QgsField &field, QString &error } else { - QString query = QString( "ALTER TABLE %1 DROP COLUMN %2" ).arg( mFieldInfo->table ).arg( field.name() ); + QString query = QString( "ALTER TABLE %1 DROP COLUMN %2" ).arg( mFieldInfo->table, field.name() ); QgsDebugMsg( "query = " + query ); executeSql( query, error ); } @@ -840,8 +840,8 @@ void QgsGrassVectorMapLayer::insertAttributes( int cat, const QgsFeature &featur } } - QString query = QString( "INSERT INTO %1 ( %2 ) VALUES ( %3 )" ).arg( mFieldInfo->table ) - .arg( names.join( ", " ) ).arg( values.join( "," ) ); + QString query = QString( "INSERT INTO %1 ( %2 ) VALUES ( %3 )" ).arg( mFieldInfo->table, + names.join( ", " ), values.join( "," ) ); executeSql( query, error ); if ( error.isEmpty() ) { @@ -892,7 +892,7 @@ void QgsGrassVectorMapLayer::reinsertAttributes( int cat, QString &error ) } } - QString query = QString( "INSERT INTO %1 ( %2 ) VALUES ( %3 )" ).arg( mFieldInfo->table ).arg( names.join( ", " ) ).arg( values.join( "," ) ); + QString query = QString( "INSERT INTO %1 ( %2 ) VALUES ( %3 )" ).arg( mFieldInfo->table, names.join( ", " ), values.join( "," ) ); executeSql( query, error ); } else @@ -959,8 +959,8 @@ void QgsGrassVectorMapLayer::updateAttributes( int cat, const QgsFeature &featur return; } - QString query = QString( "UPDATE %1 SET %2 WHERE %3 = %4" ).arg( mFieldInfo->table ) - .arg( updates.join( ", " ) ).arg( mFieldInfo->key ).arg( cat ); + QString query = QString( "UPDATE %1 SET %2 WHERE %3 = %4" ).arg( mFieldInfo->table, + updates.join( ", " ), mFieldInfo->key ).arg( cat ); executeSql( query, error ); if ( error.isEmpty() ) @@ -976,7 +976,7 @@ void QgsGrassVectorMapLayer::deleteAttribute( int cat, QString &error ) { QgsDebugMsg( QString( "mField = %1 cat = %2" ).arg( mField ).arg( cat ) ); - QString query = QString( "DELETE FROM %1 WHERE %2 = %3" ).arg( mFieldInfo->table ).arg( mFieldInfo->key ).arg( cat ); + QString query = QString( "DELETE FROM %1 WHERE %2 = %3" ).arg( mFieldInfo->table, mFieldInfo->key ).arg( cat ); executeSql( query, error ); } @@ -1029,7 +1029,7 @@ bool QgsGrassVectorMapLayer::isOrphan( int cat, QString &error ) void QgsGrassVectorMapLayer::changeAttributeValue( int cat, QgsField field, QVariant value, QString &error ) { - QgsDebugMsg( QString( "cat = %1 field.name() = %2 value = %3" ).arg( cat ).arg( field.name() ).arg( value.toString() ) ); + QgsDebugMsg( QString( "cat = %1 field.name() = %2 value = %3" ).arg( cat ).arg( field.name(), value.toString() ) ); if ( !mDriver ) { @@ -1052,8 +1052,8 @@ void QgsGrassVectorMapLayer::changeAttributeValue( int cat, QgsField field, QVar if ( exists ) { - query = QString( "UPDATE %1 SET %2 = %3 WHERE %4 = %5" ).arg( mFieldInfo->table ) - .arg( field.name() ).arg( valueString ).arg( mFieldInfo->key ).arg( cat ); + query = QString( "UPDATE %1 SET %2 = %3 WHERE %4 = %5" ).arg( mFieldInfo->table, + field.name(), valueString, mFieldInfo->key ).arg( cat ); } else { @@ -1063,8 +1063,8 @@ void QgsGrassVectorMapLayer::changeAttributeValue( int cat, QgsField field, QVar values << QString::number( cat ); names << field.name(); values << quotedValue( value ); - query = QString( "INSERT INTO %1 ( %2 ) VALUES ( %3 )" ).arg( mFieldInfo->table ) - .arg( names.join( ", " ) ).arg( values.join( "," ) ); + query = QString( "INSERT INTO %1 ( %2 ) VALUES ( %3 )" ).arg( mFieldInfo->table, + names.join( ", " ), values.join( "," ) ); } QgsDebugMsg( QString( "query: %1" ).arg( query ) ); diff --git a/src/providers/mssql/qgsmssqldataitems.cpp b/src/providers/mssql/qgsmssqldataitems.cpp index dd0c6de3989..0b2622b818b 100644 --- a/src/providers/mssql/qgsmssqldataitems.cpp +++ b/src/providers/mssql/qgsmssqldataitems.cpp @@ -372,7 +372,7 @@ bool QgsMssqlConnectionItem::handleDrop( const QMimeData * data, Qt::DropAction importResults.append( tr( "%1: OK!" ).arg( u.name ) ); else { - importResults.append( QString( "%1: %2" ).arg( u.name ).arg( importError ) ); + importResults.append( QString( "%1: %2" ).arg( u.name, importError ) ); hasError = true; } } @@ -477,7 +477,7 @@ void QgsMssqlSchemaItem::addLayers( QgsDataItem* newLayers ) QgsMssqlLayerItem* QgsMssqlSchemaItem::addLayer( QgsMssqlLayerProperty layerProperty, bool refresh ) { QGis::WkbType wkbType = QgsMssqlTableModel::wkbTypeFromMssql( layerProperty.type ); - QString tip = tr( "%1 as %2 in %3" ).arg( layerProperty.geometryColName ).arg( QgsMssqlTableModel::displayStringForWkbType( wkbType ) ).arg( layerProperty.srid ); + QString tip = tr( "%1 as %2 in %3" ).arg( layerProperty.geometryColName, QgsMssqlTableModel::displayStringForWkbType( wkbType ), layerProperty.srid ); QgsLayerItem::LayerType layerType; switch ( wkbType ) diff --git a/src/providers/mssql/qgsmssqlprovider.cpp b/src/providers/mssql/qgsmssqlprovider.cpp index 34cde26f150..b8243ea6073 100644 --- a/src/providers/mssql/qgsmssqlprovider.cpp +++ b/src/providers/mssql/qgsmssqlprovider.cpp @@ -343,7 +343,7 @@ void QgsMssqlProvider::loadMetadata() QSqlQuery query = QSqlQuery( mDatabase ); query.setForwardOnly( true ); - if ( !query.exec( QString( "select f_geometry_column, coord_dimension, srid, geometry_type from geometry_columns where f_table_schema = '%1' and f_table_name = '%2'" ).arg( mSchemaName ).arg( mTableName ) ) ) + if ( !query.exec( QString( "select f_geometry_column, coord_dimension, srid, geometry_type from geometry_columns where f_table_schema = '%1' and f_table_name = '%2'" ).arg( mSchemaName, mTableName ) ) ) { QString msg = query.lastError().text(); QgsDebugMsg( msg ); @@ -443,9 +443,7 @@ void QgsMssqlProvider::loadFields() query.clear(); query.setForwardOnly( true ); if ( !query.exec( QString( "select count(distinct [%1]), count([%1]) from [%2].[%3]" ) - .arg( pk ) - .arg( mSchemaName ) - .arg( mTableName ) ) ) + .arg( pk, mSchemaName, mTableName ) ) ) { QString msg = query.lastError().text(); QgsDebugMsg( msg ); @@ -599,7 +597,7 @@ void QgsMssqlProvider::UpdateStatistics( bool estimate ) QString sql = "SELECT min(bounding_box_xmin), min(bounding_box_ymin), max(bounding_box_xmax), max(bounding_box_ymax)" " FROM sys.spatial_index_tessellations WHERE object_id = OBJECT_ID('[%1].[%2]')"; - statement = QString( sql ).arg( mSchemaName ).arg( mTableName ); + statement = QString( sql ).arg( mSchemaName, mTableName ); if ( query.exec( statement ) ) { @@ -727,7 +725,7 @@ long QgsMssqlProvider::featureCount() const " JOIN sys.partitions p ON t.object_id = p.object_id AND p.index_id IN (0,1)" " WHERE SCHEMA_NAME(t.schema_id) = '%1' AND OBJECT_NAME(t.OBJECT_ID) = '%2'"; - QString statement = QString( sql ).arg( mSchemaName ).arg( mTableName ); + QString statement = QString( sql ).arg( mSchemaName, mTableName ); if ( query.exec( statement ) && query.next() ) { @@ -1702,10 +1700,10 @@ QgsVectorLayerImport::ImportError QgsMssqlProvider::createEmptyLayer( } sql = QString( "IF NOT EXISTS (SELECT * FROM spatial_ref_sys WHERE srid=%1) INSERT INTO spatial_ref_sys (srid, auth_name, auth_srid, srtext, proj4text) VALUES (%1, %2, %3, '%4', '%5')" ) .arg( srs->srsid() ) - .arg( auth_name ) - .arg( auth_srid ) - .arg( srs->toWkt() ) - .arg( srs->toProj4() ); + .arg( auth_name, + auth_srid, + srs->toWkt(), + srs->toProj4() ); if ( !q.exec( sql ) ) { if ( errorMessage ) @@ -1723,7 +1721,7 @@ QgsVectorLayerImport::ImportError QgsMssqlProvider::createEmptyLayer( { // remove the old table with the same name sql = QString( "IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[%1].[%2]') AND type in (N'U')) BEGIN DROP TABLE [%1].[%2] DELETE FROM geometry_columns where f_table_schema = '%1' and f_table_name = '%2' END;" ) - .arg( schemaName ).arg( tableName ); + .arg( schemaName, tableName ); if ( !q.exec( sql ) ) { if ( errorMessage ) @@ -1737,14 +1735,14 @@ QgsVectorLayerImport::ImportError QgsMssqlProvider::createEmptyLayer( "DELETE FROM geometry_columns WHERE f_table_schema = '%1' AND f_table_name = '%2'\n" "INSERT INTO [geometry_columns] ([f_table_catalog], [f_table_schema],[f_table_name], " "[f_geometry_column],[coord_dimension],[srid],[geometry_type]) VALUES ('%5', '%1', '%2', '%4', %6, %7, '%8')" ) - .arg( schemaName ) - .arg( tableName ) - .arg( primaryKey ) - .arg( geometryColumn ) - .arg( dbName ) - .arg( QString::number( dim ) ) - .arg( QString::number( srid ) ) - .arg( geometryType ); + .arg( schemaName, + tableName, + primaryKey, + geometryColumn, + dbName, + QString::number( dim ), + QString::number( srid ), + geometryType ); if ( !q.exec( sql ) ) { diff --git a/src/providers/mssql/qgsmssqlsourceselect.cpp b/src/providers/mssql/qgsmssqlsourceselect.cpp index 6bade00196c..ace0a653927 100644 --- a/src/providers/mssql/qgsmssqlsourceselect.cpp +++ b/src/providers/mssql/qgsmssqlsourceselect.cpp @@ -771,8 +771,8 @@ void QgsMssqlGeomColumnTypeThread::run() { QString table; table = QString( "%1[%2]" ) - .arg( layerProperty.schemaName.isEmpty() ? "" : QString( "[%1]." ).arg( layerProperty.schemaName ) ) - .arg( layerProperty.tableName ); + .arg( layerProperty.schemaName.isEmpty() ? "" : QString( "[%1]." ).arg( layerProperty.schemaName ), + layerProperty.tableName ); QString query = QString( "SELECT %3" " UPPER([%1].STGeometryType())," @@ -780,10 +780,10 @@ void QgsMssqlGeomColumnTypeThread::run() " FROM %2" " WHERE [%1] IS NOT NULL %4" " GROUP BY [%1].STGeometryType(), [%1].STSrid" ) - .arg( layerProperty.geometryColName ) - .arg( table ) - .arg( mUseEstimatedMetadata ? "TOP 1" : "" ) - .arg( layerProperty.sql.isEmpty() ? "" : QString( " AND %1" ).arg( layerProperty.sql ) ); + .arg( layerProperty.geometryColName, + table, + mUseEstimatedMetadata ? "TOP 1" : "", + layerProperty.sql.isEmpty() ? "" : QString( " AND %1" ).arg( layerProperty.sql ) ); // issue the sql query QSqlDatabase db = QSqlDatabase::database( mConnectionName ); diff --git a/src/providers/mssql/qgsmssqltablemodel.cpp b/src/providers/mssql/qgsmssqltablemodel.cpp index 8e93e51349b..a5a1cb65506 100644 --- a/src/providers/mssql/qgsmssqltablemodel.cpp +++ b/src/providers/mssql/qgsmssqltablemodel.cpp @@ -43,13 +43,13 @@ QgsMssqlTableModel::~QgsMssqlTableModel() void QgsMssqlTableModel::addTableEntry( const QgsMssqlLayerProperty &layerProperty ) { QgsDebugMsg( QString( "%1.%2.%3 type=%4 srid=%5 pk=%6 sql=%7" ) - .arg( layerProperty.schemaName ) - .arg( layerProperty.tableName ) - .arg( layerProperty.geometryColName ) - .arg( layerProperty.type ) - .arg( layerProperty.srid ) - .arg( layerProperty.pkCols.join( "," ) ) - .arg( layerProperty.sql ) ); + .arg( layerProperty.schemaName, + layerProperty.tableName, + layerProperty.geometryColName, + layerProperty.type, + layerProperty.srid, + layerProperty.pkCols.join( "," ), + layerProperty.sql ) ); // is there already a root item with the given scheme Name? QStandardItem *schemaItem; diff --git a/src/providers/ogr/qgsogrprovider.cpp b/src/providers/ogr/qgsogrprovider.cpp index 7310beccbd5..04a87ce4461 100644 --- a/src/providers/ogr/qgsogrprovider.cpp +++ b/src/providers/ogr/qgsogrprovider.cpp @@ -360,7 +360,7 @@ QgsOgrProvider::QgsOgrProvider( QString const & uri ) mFilePath = vsiPrefix + mFilePath; setDataSourceUri( mFilePath ); } - QgsDebugMsg( QString( "Trying %1 syntax, mFilePath= %2" ).arg( vsiPrefix ).arg( mFilePath ) ); + QgsDebugMsg( QString( "Trying %1 syntax, mFilePath= %2" ).arg( vsiPrefix, mFilePath ) ); } QgsDebugMsg( "mFilePath: " + mFilePath ); @@ -646,7 +646,7 @@ QStringList QgsOgrProvider::subLayers() const QString geom = ogrWkbGeometryTypeName( layerGeomType ); - mSubLayerList << QString( "%1:%2:%3:%4" ).arg( i ).arg( theLayerName ).arg( theLayerFeatureCount == -1 ? tr( "Unknown" ) : QString::number( theLayerFeatureCount ) ).arg( geom ); + mSubLayerList << QString( "%1:%2:%3:%4" ).arg( i ).arg( theLayerName, theLayerFeatureCount == -1 ? tr( "Unknown" ) : QString::number( theLayerFeatureCount ), geom ); } else { @@ -1061,8 +1061,8 @@ bool QgsOgrProvider::addFeature( QgsFeature& f ) case OFTString: QgsDebugMsg( QString( "Writing string attribute %1 with %2, encoding %3" ) .arg( targetAttributeId ) - .arg( attrVal.toString() ) - .arg( mEncoding->name().data() ) ); + .arg( attrVal.toString(), + mEncoding->name().data() ) ); OGR_F_SetFieldString( feature, targetAttributeId, mEncoding->fromUnicode( attrVal.toString() ).constData() ); break; @@ -1142,7 +1142,7 @@ bool QgsOgrProvider::addAttributes( const QList &attributes ) type = OFTString; break; default: - pushError( tr( "type %1 for field %2 not found" ).arg( iter->typeName() ).arg( iter->name() ) ); + pushError( tr( "type %1 for field %2 not found" ).arg( iter->typeName(), iter->name() ) ); returnvalue = false; continue; } @@ -1156,7 +1156,7 @@ bool QgsOgrProvider::addAttributes( const QList &attributes ) if ( OGR_L_CreateField( ogrLayer, fielddefn, true ) != OGRERR_NONE ) { - pushError( tr( "OGR error creating field %1: %2" ).arg( iter->name() ).arg( CPLGetLastErrorMsg() ) ); + pushError( tr( "OGR error creating field %1: %2" ).arg( iter->name(), CPLGetLastErrorMsg() ) ); returnvalue = false; } OGR_Fld_Destroy( fielddefn ); @@ -2078,7 +2078,7 @@ QGISEXTERN bool createEmptyDataSource( const QString &uri, dataSource = OGR_Dr_CreateDataSource( driver, TO8F( uri ), NULL ); if ( !dataSource ) { - QgsMessageLog::logMessage( QObject::tr( "Creating the data source %1 failed: %2" ).arg( uri ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ), QObject::tr( "OGR" ) ); + QgsMessageLog::logMessage( QObject::tr( "Creating the data source %1 failed: %2" ).arg( uri, QString::fromUtf8( CPLGetLastErrorMsg() ) ), QObject::tr( "OGR" ) ); return false; } @@ -2152,7 +2152,7 @@ QGISEXTERN bool createEmptyDataSource( const QString &uri, if ( !layer ) { - QgsMessageLog::logMessage( QObject::tr( "Creation of OGR data source %1 failed: %2" ).arg( uri ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ), QObject::tr( "OGR" ) ); + QgsMessageLog::logMessage( QObject::tr( "Creation of OGR data source %1 failed: %2" ).arg( uri, QString::fromUtf8( CPLGetLastErrorMsg() ) ), QObject::tr( "OGR" ) ); return false; } @@ -2217,7 +2217,7 @@ QGISEXTERN bool createEmptyDataSource( const QString &uri, } else { - QgsMessageLog::logMessage( QObject::tr( "field %1 with unsupported type %2 skipped" ).arg( it->first ).arg( fields[0] ), QObject::tr( "OGR" ) ); + QgsMessageLog::logMessage( QObject::tr( "field %1 with unsupported type %2 skipped" ).arg( it->first, fields[0] ), QObject::tr( "OGR" ) ); continue; } diff --git a/src/providers/postgres/qgscolumntypethread.cpp b/src/providers/postgres/qgscolumntypethread.cpp index 6495d37f340..f3d040ccd76 100644 --- a/src/providers/postgres/qgscolumntypethread.cpp +++ b/src/providers/postgres/qgscolumntypethread.cpp @@ -78,9 +78,9 @@ void QgsGeomColumnTypeThread::run() { emit progress( i++, n ); emit progressMessage( tr( "Scanning column %1.%2.%3..." ) - .arg( layerProperty.schemaName ) - .arg( layerProperty.tableName ) - .arg( layerProperty.geometryColName ) ); + .arg( layerProperty.schemaName, + layerProperty.tableName, + layerProperty.geometryColName ) ); if ( !layerProperty.geometryColName.isNull() && ( layerProperty.types.value( 0, QGis::WKBUnknown ) == QGis::WKBUnknown || @@ -88,7 +88,7 @@ void QgsGeomColumnTypeThread::run() { if ( dontResolveType ) { - QgsDebugMsg( QString( "skipping column %1.%2 without type constraint" ).arg( layerProperty.schemaName ).arg( layerProperty.tableName ) ); + QgsDebugMsg( QString( "skipping column %1.%2 without type constraint" ).arg( layerProperty.schemaName, layerProperty.tableName ) ); continue; } diff --git a/src/providers/postgres/qgspostgresconn.cpp b/src/providers/postgres/qgspostgresconn.cpp index 7544f09ad69..abf251651a3 100644 --- a/src/providers/postgres/qgspostgresconn.cpp +++ b/src/providers/postgres/qgspostgresconn.cpp @@ -325,8 +325,8 @@ void QgsPostgresConn::addColumnInfo( QgsPostgresLayerProperty& layerProperty, co // could use array_agg() and count() // array output would look like this: "{One,tWo}" QString sql = QString( "SELECT attname, CASE WHEN typname = ANY(ARRAY['geometry','geography','topogeometry']) THEN 1 ELSE null END AS isSpatial FROM pg_attribute JOIN pg_type ON atttypid=pg_type.oid WHERE attrelid=regclass('%1.%2') AND attnum>0" ) - .arg( quotedIdentifier( schemaName ) ) - .arg( quotedIdentifier( viewName ) ); + .arg( quotedIdentifier( schemaName ), + quotedIdentifier( viewName ) ); //QgsDebugMsg( sql ); QgsPostgresResult colRes( PQexec( sql ) ); @@ -444,13 +444,13 @@ bool QgsPostgresConn::getTableInfo( bool searchGeometryColumnsOnly, bool searchP " AND has_schema_privilege(n.nspname,'usage')" " AND has_table_privilege('\"'||n.nspname||'\".\"'||c.relname||'\"','select')" // user has select privilege ) - .arg( tableName ).arg( schemaName ).arg( columnName ).arg( typeName ).arg( sridName ).arg( dimName ).arg( gtableName ); + .arg( tableName, schemaName, columnName, typeName, sridName, dimName, gtableName ); if ( searchPublicOnly ) sql += " AND n.nspname='public'"; if ( !schema.isEmpty() ) - sql += QString( " AND %1='%2'" ).arg( schemaName ).arg( schema ); + sql += QString( " AND %1='%2'" ).arg( schemaName, schema ); sql += QString( " ORDER BY n.nspname,c.relname,%1" ).arg( columnName ); @@ -840,8 +840,8 @@ QString QgsPostgresConn::postgisVersion() mGeosAvailable = result.PQntuples() == 1 && !result.PQgetisnull( 0, 0 ); mProjAvailable = result.PQntuples() == 1 && !result.PQgetisnull( 0, 1 ); QgsDebugMsg( QString( "geos:%1 proj:%2" ) - .arg( mGeosAvailable ? result.PQgetvalue( 0, 0 ) : "none" ) - .arg( mProjAvailable ? result.PQgetvalue( 0, 1 ) : "none" ) ); + .arg( mGeosAvailable ? result.PQgetvalue( 0, 0 ) : "none", + mProjAvailable ? result.PQgetvalue( 0, 1 ) : "none" ) ); mGistAvailable = true; } else @@ -992,9 +992,9 @@ bool QgsPostgresConn::openCursor( QString cursorName, QString sql ) else PQexecNR( "BEGIN" ); } - QgsDebugMsgLevel( QString( "Binary cursor %1 for %2" ).arg( cursorName ).arg( sql ), 3 ); + QgsDebugMsgLevel( QString( "Binary cursor %1 for %2" ).arg( cursorName, sql ), 3 ); return PQexecNR( QString( "DECLARE %1 BINARY CURSOR%2 FOR %3" ). - arg( cursorName ).arg( !mTransaction ? "" : QString( " WITH HOLD" ) ).arg( sql ) ); + arg( cursorName, !mTransaction ? "" : QString( " WITH HOLD" ), sql ) ); } bool QgsPostgresConn::closeCursor( QString cursorName ) @@ -1263,8 +1263,8 @@ QString QgsPostgresConn::fieldExpression( const QgsField &fld, QString expr ) else if ( type == "geometry" ) { return QString( "%1(%2)" ) - .arg( majorVersion() < 2 ? "asewkt" : "st_asewkt" ) - .arg( expr ); + .arg( majorVersion() < 2 ? "asewkt" : "st_asewkt", + expr ); } else if ( type == "geography" ) { @@ -1319,8 +1319,8 @@ void QgsPostgresConn::retrieveLayerTypes( QgsPostgresLayerProperty &layerPropert if ( !layerProperty.schemaName.isEmpty() ) { table = QString( "%1.%2" ) - .arg( quotedIdentifier( layerProperty.schemaName ) ) - .arg( quotedIdentifier( layerProperty.tableName ) ); + .arg( quotedIdentifier( layerProperty.schemaName ), + quotedIdentifier( layerProperty.tableName ) ); } else { @@ -1334,9 +1334,9 @@ void QgsPostgresConn::retrieveLayerTypes( QgsPostgresLayerProperty &layerPropert if ( useEstimatedMetadata ) { table = QString( "(SELECT %1 FROM %2%3 LIMIT %4) AS t" ) - .arg( quotedIdentifier( layerProperty.geometryColName ) ) - .arg( table ) - .arg( layerProperty.sql.isEmpty() ? "" : QString( " WHERE %1" ).arg( layerProperty.sql ) ) + .arg( quotedIdentifier( layerProperty.geometryColName ), + table, + layerProperty.sql.isEmpty() ? "" : QString( " WHERE %1" ).arg( layerProperty.sql ) ) .arg( sGeomTypeSelectLimit ); } else if ( !layerProperty.sql.isEmpty() ) @@ -1353,8 +1353,8 @@ void QgsPostgresConn::retrieveLayerTypes( QgsPostgresLayerProperty &layerPropert if ( type == QGis::WKBUnknown ) { query += QString( "upper(geometrytype(%1%2))" ) - .arg( quotedIdentifier( layerProperty.geometryColName ) ) - .arg( castToGeometry ? "::geometry" : "" ); + .arg( quotedIdentifier( layerProperty.geometryColName ), + castToGeometry ? "::geometry" : "" ); } else { @@ -1367,9 +1367,9 @@ void QgsPostgresConn::retrieveLayerTypes( QgsPostgresLayerProperty &layerPropert if ( srid == INT_MIN ) { query += QString( "%1(%2%3)" ) - .arg( majorVersion() < 2 ? "srid" : "st_srid" ) - .arg( quotedIdentifier( layerProperty.geometryColName ) ) - .arg( castToGeometry ? "::geometry" : "" ); + .arg( majorVersion() < 2 ? "srid" : "st_srid", + quotedIdentifier( layerProperty.geometryColName ), + castToGeometry ? "::geometry" : "" ); } else { @@ -1379,9 +1379,9 @@ void QgsPostgresConn::retrieveLayerTypes( QgsPostgresLayerProperty &layerPropert if ( !layerProperty.force2d ) { query += QString( ",%1(%2%3)" ) - .arg( majorVersion() < 2 ? "ndims" : "st_ndims" ) - .arg( quotedIdentifier( layerProperty.geometryColName ) ) - .arg( castToGeometry ? "::geometry" : "" ); + .arg( majorVersion() < 2 ? "ndims" : "st_ndims", + quotedIdentifier( layerProperty.geometryColName ), + castToGeometry ? "::geometry" : "" ); } query += " FROM " + table; diff --git a/src/providers/postgres/qgspostgresconn.h b/src/providers/postgres/qgspostgresconn.h index e4a79b1481a..6e10b64bdc9 100644 --- a/src/providers/postgres/qgspostgresconn.h +++ b/src/providers/postgres/qgspostgresconn.h @@ -134,13 +134,13 @@ struct QgsPostgresLayerProperty } return QString( "%1.%2.%3 type=%4 srid=%5 pkCols=%6 sql=%7 nSpCols=%8 force2d=%9" ) - .arg( schemaName ) - .arg( tableName ) - .arg( geometryColName ) - .arg( typeString ) - .arg( sridString ) - .arg( pkCols.join( "|" ) ) - .arg( sql ) + .arg( schemaName, + tableName, + geometryColName, + typeString, + sridString, + pkCols.join( "|" ), + sql ) .arg( nSpCols ) .arg( force2d ? "yes" : "no" ); } diff --git a/src/providers/postgres/qgspostgresdataitems.cpp b/src/providers/postgres/qgspostgresdataitems.cpp index 2116c3417b5..fd56008065c 100644 --- a/src/providers/postgres/qgspostgresdataitems.cpp +++ b/src/providers/postgres/qgspostgresdataitems.cpp @@ -176,8 +176,8 @@ void QgsPGConnectionItem::createSchema() QgsPostgresResult result( conn->PQexec( sql ) ); if ( result.PQresultStatus() != PGRES_COMMAND_OK ) { - QMessageBox::warning( 0, tr( "Create Schema" ), tr( "Unable to create schema %1\n%2" ).arg( schemaName ) - .arg( result.PQresultErrorMessage() ) ); + QMessageBox::warning( 0, tr( "Create Schema" ), tr( "Unable to create schema %1\n%2" ).arg( schemaName, + result.PQresultErrorMessage() ) ); conn->unref(); return; } @@ -238,7 +238,7 @@ bool QgsPGConnectionItem::handleDrop( const QMimeData * data, QString toSchema ) importResults.append( tr( "%1: OK!" ).arg( u.name ) ); else { - importResults.append( QString( "%1: %2" ).arg( u.name ).arg( importError ) ); + importResults.append( QString( "%1: %2" ).arg( u.name, importError ) ); hasError = true; } } @@ -317,7 +317,7 @@ QList QgsPGLayerItem::actions() void QgsPGLayerItem::deleteLayer() { if ( QMessageBox::question( 0, QObject::tr( "Delete Table" ), - QObject::tr( "Are you sure you want to delete %1.%2?" ).arg( mLayerProperty.schemaName ).arg( mLayerProperty.tableName ), + QObject::tr( "Are you sure you want to delete %1.%2?" ).arg( mLayerProperty.schemaName, mLayerProperty.tableName ), QMessageBox::Yes | QMessageBox::No, QMessageBox::No ) != QMessageBox::Yes ) return; @@ -340,7 +340,7 @@ void QgsPGLayerItem::renameLayer() QString typeName = mLayerProperty.isView ? tr( "View" ) : tr( "Table" ); QString lowerTypeName = mLayerProperty.isView ? tr( "view" ) : tr( "table" ); - QgsNewNameDialog dlg( tr( "%1 %2.%3" ).arg( lowerTypeName ).arg( mLayerProperty.schemaName ).arg( mLayerProperty.tableName ), mLayerProperty.tableName ); + QgsNewNameDialog dlg( tr( "%1 %2.%3" ).arg( lowerTypeName, mLayerProperty.schemaName, mLayerProperty.tableName ), mLayerProperty.tableName ); dlg.setWindowTitle( tr( "Rename %1" ).arg( typeName ) ); if ( dlg.exec() != QDialog::Accepted || dlg.name() == mLayerProperty.tableName ) return; @@ -367,19 +367,19 @@ void QgsPGLayerItem::renameLayer() QString sql; if ( mLayerProperty.isView ) { - sql = QString( "ALTER %1 VIEW %2 RENAME TO %3" ).arg( mLayerProperty.relKind == "m" ? QString( "MATERIALIZED" ) : QString() ) - .arg( oldName ).arg( newName ); + sql = QString( "ALTER %1 VIEW %2 RENAME TO %3" ).arg( mLayerProperty.relKind == "m" ? QString( "MATERIALIZED" ) : QString(), + oldName, newName ); } else { - sql = QString( "ALTER TABLE %1 RENAME TO %2" ).arg( oldName ).arg( newName ); + sql = QString( "ALTER TABLE %1 RENAME TO %2" ).arg( oldName, newName ); } QgsPostgresResult result( conn->PQexec( sql ) ); if ( result.PQresultStatus() != PGRES_COMMAND_OK ) { - QMessageBox::warning( 0, tr( "Rename %1" ).arg( typeName ), tr( "Unable to rename %1 %2\n%3" ).arg( lowerTypeName ).arg( mName ) - .arg( result.PQresultErrorMessage() ) ); + QMessageBox::warning( 0, tr( "Rename %1" ).arg( typeName ), tr( "Unable to rename %1 %2\n%3" ).arg( lowerTypeName, mName, + result.PQresultErrorMessage() ) ); conn->unref(); return; } @@ -392,7 +392,7 @@ void QgsPGLayerItem::renameLayer() void QgsPGLayerItem::truncateTable() { if ( QMessageBox::question( 0, QObject::tr( "Truncate Table" ), - QObject::tr( "Are you sure you want to truncate %1.%2?\n\nThis will delete all data within the table." ).arg( mLayerProperty.schemaName ).arg( mLayerProperty.tableName ), + QObject::tr( "Are you sure you want to truncate %1.%2?\n\nThis will delete all data within the table." ).arg( mLayerProperty.schemaName, mLayerProperty.tableName ), QMessageBox::Yes | QMessageBox::No, QMessageBox::No ) != QMessageBox::Yes ) return; @@ -418,8 +418,8 @@ void QgsPGLayerItem::truncateTable() QgsPostgresResult result( conn->PQexec( sql ) ); if ( result.PQresultStatus() != PGRES_COMMAND_OK ) { - QMessageBox::warning( 0, tr( "Truncate Table" ), tr( "Unable to truncate %1\n%2" ).arg( mName ) - .arg( result.PQresultErrorMessage() ) ); + QMessageBox::warning( 0, tr( "Truncate Table" ), tr( "Unable to truncate %1\n%2" ).arg( mName, + result.PQresultErrorMessage() ) ); conn->unref(); return; } @@ -581,7 +581,7 @@ void QgsPGSchemaItem::deleteSchema() objects += QString( "\n[%1 additional objects not listed]" ).arg( count - maxListed ); } if ( QMessageBox::question( 0, QObject::tr( "Delete Schema" ), - QObject::tr( "Schema '%1' contains objects:\n\n%2\n\nAre you sure you want to delete the schema and all these objects?" ).arg( mName ).arg( objects ), + QObject::tr( "Schema '%1' contains objects:\n\n%2\n\nAre you sure you want to delete the schema and all these objects?" ).arg( mName, objects ), QMessageBox::Yes | QMessageBox::No, QMessageBox::No ) != QMessageBox::Yes ) { conn->unref(); @@ -628,13 +628,13 @@ void QgsPGSchemaItem::renameSchema() //rename the schema QString sql = QString( "ALTER SCHEMA %1 RENAME TO %2" ) - .arg( schemaName ).arg( QgsPostgresConn::quotedIdentifier( dlg.name() ) ); + .arg( schemaName, QgsPostgresConn::quotedIdentifier( dlg.name() ) ); QgsPostgresResult result( conn->PQexec( sql ) ); if ( result.PQresultStatus() != PGRES_COMMAND_OK ) { - QMessageBox::warning( 0, tr( "Rename Schema" ), tr( "Unable to rename schema %1\n%2" ).arg( schemaName ) - .arg( result.PQresultErrorMessage() ) ); + QMessageBox::warning( 0, tr( "Rename Schema" ), tr( "Unable to rename schema %1\n%2" ).arg( schemaName, + result.PQresultErrorMessage() ) ); conn->unref(); return; } @@ -649,7 +649,7 @@ QgsPGLayerItem *QgsPGSchemaItem::createLayer( QgsPostgresLayerProperty layerProp { //QgsDebugMsg( "schemaName = " + layerProperty.schemaName + " tableName = " + layerProperty.tableName + " geometryColName = " + layerProperty.geometryColName ); QGis::WkbType wkbType = layerProperty.types[0]; - QString tip = tr( "%1 as %2 in %3" ).arg( layerProperty.geometryColName ).arg( QgsPostgresConn::displayStringForWkbType( wkbType ) ).arg( layerProperty.srids[0] ); + QString tip = tr( "%1 as %2 in %3" ).arg( layerProperty.geometryColName, QgsPostgresConn::displayStringForWkbType( wkbType ) ).arg( layerProperty.srids[0] ); if ( !layerProperty.tableComment.isEmpty() ) { tip = layerProperty.tableComment + "\n" + tip; diff --git a/src/providers/postgres/qgspostgresexpressioncompiler.cpp b/src/providers/postgres/qgspostgresexpressioncompiler.cpp index f09e5b8c35a..c5d234cf26b 100644 --- a/src/providers/postgres/qgspostgresexpressioncompiler.cpp +++ b/src/providers/postgres/qgspostgresexpressioncompiler.cpp @@ -204,7 +204,7 @@ QgsPostgresExpressionCompiler::Result QgsPostgresExpressionCompiler::compile( co if ( rn != Complete ) return rn; - result = QString( "%1 %2IN(%3)" ).arg( nd ).arg( n->isNotIn() ? "NOT " : "" ).arg( list.join( "," ) ); + result = QString( "%1 %2IN(%3)" ).arg( nd, n->isNotIn() ? "NOT " : "", list.join( "," ) ); return Complete; } diff --git a/src/providers/postgres/qgspostgresfeatureiterator.cpp b/src/providers/postgres/qgspostgresfeatureiterator.cpp index 2280969185e..97a085b0e40 100644 --- a/src/providers/postgres/qgspostgresfeatureiterator.cpp +++ b/src/providers/postgres/qgspostgresfeatureiterator.cpp @@ -125,7 +125,7 @@ bool QgsPostgresFeatureIterator::fetchFeature( QgsFeature& feature ) QgsDebugMsgLevel( QString( "fetching %1 features." ).arg( mFeatureQueueSize ), 4 ); if ( mConn->PQsendQuery( fetch ) == 0 ) // fetch features asynchronously { - QgsMessageLog::logMessage( QObject::tr( "Fetching from cursor %1 failed\nDatabase error: %2" ).arg( mCursorName ).arg( mConn->PQerrorMessage() ), QObject::tr( "PostGIS" ) ); + QgsMessageLog::logMessage( QObject::tr( "Fetching from cursor %1 failed\nDatabase error: %2" ).arg( mCursorName, mConn->PQerrorMessage() ), QObject::tr( "PostGIS" ) ); } QgsPostgresResult queryResult; @@ -137,7 +137,7 @@ bool QgsPostgresFeatureIterator::fetchFeature( QgsFeature& feature ) if ( queryResult.PQresultStatus() != PGRES_TUPLES_OK ) { - QgsMessageLog::logMessage( QObject::tr( "Fetching from cursor %1 failed\nDatabase error: %2" ).arg( mCursorName ).arg( mConn->PQerrorMessage() ), QObject::tr( "PostGIS" ) ); + QgsMessageLog::logMessage( QObject::tr( "Fetching from cursor %1 failed\nDatabase error: %2" ).arg( mCursorName, mConn->PQerrorMessage() ), QObject::tr( "PostGIS" ) ); break; } @@ -267,26 +267,26 @@ QString QgsPostgresFeatureIterator::whereClauseRect() if ( mConn->majorVersion() < 2 ) { qBox = QString( "setsrid('BOX3D(%1)'::box3d,%2)" ) - .arg( rect.asWktCoordinates() ) - .arg( mSource->mRequestedSrid.isEmpty() ? mSource->mDetectedSrid : mSource->mRequestedSrid ); + .arg( rect.asWktCoordinates(), + mSource->mRequestedSrid.isEmpty() ? mSource->mDetectedSrid : mSource->mRequestedSrid ); } else { qBox = QString( "st_makeenvelope(%1,%2,%3,%4,%5)" ) - .arg( qgsDoubleToString( rect.xMinimum() ) ) - .arg( qgsDoubleToString( rect.yMinimum() ) ) - .arg( qgsDoubleToString( rect.xMaximum() ) ) - .arg( qgsDoubleToString( rect.yMaximum() ) ) - .arg( mSource->mRequestedSrid.isEmpty() ? mSource->mDetectedSrid : mSource->mRequestedSrid ); + .arg( qgsDoubleToString( rect.xMinimum() ), + qgsDoubleToString( rect.yMinimum() ), + qgsDoubleToString( rect.xMaximum() ), + qgsDoubleToString( rect.yMaximum() ), + mSource->mRequestedSrid.isEmpty() ? mSource->mDetectedSrid : mSource->mRequestedSrid ); } bool castToGeometry = mSource->mSpatialColType == sctGeography || mSource->mSpatialColType == sctPcPatch; QString whereClause = QString( "%1%2 && %3" ) - .arg( QgsPostgresConn::quotedIdentifier( mSource->mGeometryColumn ) ) - .arg( castToGeometry ? "::geometry" : "" ) - .arg( qBox ); + .arg( QgsPostgresConn::quotedIdentifier( mSource->mGeometryColumn ), + castToGeometry ? "::geometry" : "", + qBox ); if ( mRequest.flags() & QgsFeatureRequest::ExactIntersect ) { @@ -294,20 +294,20 @@ QString QgsPostgresFeatureIterator::whereClauseRect() if ( mConn->majorVersion() >= 2 || ( mConn->majorVersion() == 1 && mConn->minorVersion() >= 5 ) ) curveToLineFn = "st_curvetoline"; // st_ prefix is always used whereClause += QString( " AND %1(%2(%3%4),%5)" ) - .arg( mConn->majorVersion() < 2 ? "intersects" : "st_intersects" ) - .arg( curveToLineFn ) - .arg( QgsPostgresConn::quotedIdentifier( mSource->mGeometryColumn ) ) - .arg( castToGeometry ? "::geometry" : "" ) - .arg( qBox ); + .arg( mConn->majorVersion() < 2 ? "intersects" : "st_intersects", + curveToLineFn, + QgsPostgresConn::quotedIdentifier( mSource->mGeometryColumn ), + castToGeometry ? "::geometry" : "", + qBox ); } if ( !mSource->mRequestedSrid.isEmpty() && ( mSource->mRequestedSrid != mSource->mDetectedSrid || mSource->mRequestedSrid.toInt() == 0 ) ) { whereClause += QString( " AND %1(%2%3)=%4" ) - .arg( mConn->majorVersion() < 2 ? "srid" : "st_srid" ) - .arg( QgsPostgresConn::quotedIdentifier( mSource->mGeometryColumn ) ) - .arg( castToGeometry ? "::geometry" : "" ) - .arg( mSource->mRequestedSrid ); + .arg( mConn->majorVersion() < 2 ? "srid" : "st_srid", + QgsPostgresConn::quotedIdentifier( mSource->mGeometryColumn ), + castToGeometry ? "::geometry" : "", + mSource->mRequestedSrid ); } if ( mSource->mRequestedGeomType != QGis::WKBUnknown && mSource->mRequestedGeomType != mSource->mDetectedGeomType ) @@ -351,8 +351,8 @@ bool QgsPostgresFeatureIterator::declareCursor( const QString& whereClause ) // ST_Force2D since 2.1.0 : mConn->majorVersion() > 2 || mConn->minorVersion() > 0 ? "st_force2d" // ST_Force_2D in 2.0.x - : "st_force_2d" ) - .arg( geom ); + : "st_force_2d", + geom ); } if ( !mRequest.simplifyMethod().forceLocalOptimization() && @@ -364,15 +364,15 @@ bool QgsPostgresFeatureIterator::declareCursor( const QString& whereClause ) geom = QString( "%1(%2,%3)" ) .arg( mRequest.simplifyMethod().methodType() == QgsSimplifyMethod::OptimizeForRendering ? ( mConn->majorVersion() < 2 ? "snaptogrid" : "st_snaptogrid" ) - : ( mConn->majorVersion() < 2 ? "simplifypreservetopology" : "st_simplifypreservetopology" ) ) - .arg( geom ) + : ( mConn->majorVersion() < 2 ? "simplifypreservetopology" : "st_simplifypreservetopology" ), + geom ) .arg( mRequest.simplifyMethod().tolerance() * 0.8 ); //-> Default factor for the maximum displacement distance for simplification, similar as GeoServer does } geom = QString( "%1(%2,'%3')" ) - .arg( mConn->majorVersion() < 2 ? "asbinary" : "st_asbinary" ) - .arg( geom ) - .arg( QgsPostgresProvider::endianString() ); + .arg( mConn->majorVersion() < 2 ? "asbinary" : "st_asbinary", + geom, + QgsPostgresProvider::endianString() ); query += delim + geom; delim = ","; diff --git a/src/providers/postgres/qgspostgresprovider.cpp b/src/providers/postgres/qgspostgresprovider.cpp index 2b113fbbf3d..2fe7c67e4ee 100644 --- a/src/providers/postgres/qgspostgresprovider.cpp +++ b/src/providers/postgres/qgspostgresprovider.cpp @@ -516,7 +516,7 @@ QString QgsPostgresUtils::whereClause( QgsFeatureId featureId, const QgsFields& int idx = pkAttrs[i]; const QgsField &fld = fields[ idx ]; - whereClause += delim + QString( "%1=%2" ).arg( conn->fieldExpression( fld ) ).arg( QgsPostgresConn::quotedValue( pkVals[i].toString() ) ); + whereClause += delim + QString( "%1=%2" ).arg( conn->fieldExpression( fld ), QgsPostgresConn::quotedValue( pkVals[i].toString() ) ); delim = " AND "; } } @@ -555,7 +555,7 @@ QString QgsPostgresUtils::andWhereClauses( const QString& c1, const QString& c2 if ( c2.isEmpty() ) return c1; - return QString( "(%1) AND (%2)" ).arg( c1 ).arg( c2 ); + return QString( "(%1) AND (%2)" ).arg( c1, c2 ); } QString QgsPostgresProvider::filterWhereClause() const @@ -572,10 +572,10 @@ QString QgsPostgresProvider::filterWhereClause() const if ( !mRequestedSrid.isEmpty() && ( mRequestedSrid != mDetectedSrid || mRequestedSrid.toInt() == 0 ) ) { where += delim + QString( "%1(%2%3)=%4" ) - .arg( connectionRO()->majorVersion() < 2 ? "srid" : "st_srid" ) - .arg( quotedIdentifier( mGeometryColumn ) ) - .arg( mSpatialColType == sctGeography ? "::geography" : "" ) - .arg( mRequestedSrid ); + .arg( connectionRO()->majorVersion() < 2 ? "srid" : "st_srid", + quotedIdentifier( mGeometryColumn ), + mSpatialColType == sctGeography ? "::geography" : "", + mRequestedSrid ); delim = " AND "; } @@ -807,8 +807,8 @@ bool QgsPostgresProvider::loadFields() else if ( formattedFieldType != "numeric" ) { QgsMessageLog::logMessage( tr( "unexpected formatted field type '%1' for field %2" ) - .arg( formattedFieldType ) - .arg( fieldName ), + .arg( formattedFieldType, + fieldName ), tr( "PostGIS" ) ); fieldSize = -1; fieldPrec = -1; @@ -861,8 +861,8 @@ bool QgsPostgresProvider::loadFields() else { QgsDebugMsg( QString( "unexpected formatted field type '%1' for field %2" ) - .arg( formattedFieldType ) - .arg( fieldName ) ); + .arg( formattedFieldType, + fieldName ) ); fieldSize = -1; fieldPrec = -1; } @@ -879,15 +879,15 @@ bool QgsPostgresProvider::loadFields() else { QgsMessageLog::logMessage( tr( "unexpected formatted field type '%1' for field %2" ) - .arg( formattedFieldType ) - .arg( fieldName ) ); + .arg( formattedFieldType, + fieldName ) ); fieldSize = -1; fieldPrec = -1; } } else { - QgsMessageLog::logMessage( tr( "Field %1 ignored, because of unsupported type %2" ).arg( fieldName ).arg( fieldTypeName ), tr( "PostGIS" ) ); + QgsMessageLog::logMessage( tr( "Field %1 ignored, because of unsupported type %2" ).arg( fieldName, fieldTypeName ), tr( "PostGIS" ) ); continue; } @@ -906,7 +906,7 @@ bool QgsPostgresProvider::loadFields() } else { - QgsMessageLog::logMessage( tr( "Field %1 ignored, because of unsupported type type %2" ).arg( fieldName ).arg( fieldTType ), tr( "PostGIS" ) ); + QgsMessageLog::logMessage( tr( "Field %1 ignored, because of unsupported type type %2" ).arg( fieldName, fieldTType ), tr( "PostGIS" ) ); continue; } @@ -939,9 +939,9 @@ bool QgsPostgresProvider::hasSufficientPermsAndCapabilities() if ( testAccess.PQresultStatus() != PGRES_TUPLES_OK ) { QgsMessageLog::logMessage( tr( "Unable to access the %1 relation.\nThe error message from the database was:\n%2.\nSQL: %3" ) - .arg( mQuery ) - .arg( testAccess.PQresultErrorMessage() ) - .arg( sql ), tr( "PostGIS" ) ); + .arg( mQuery, + testAccess.PQresultErrorMessage(), + sql ), tr( "PostGIS" ) ); return false; } @@ -974,12 +974,12 @@ bool QgsPostgresProvider::hasSufficientPermsAndCapabilities() "%2" "has_table_privilege(%1,'INSERT')," "current_schema()" ) - .arg( quotedValue( mQuery ) ) - .arg( mGeometryColumn.isNull() + .arg( quotedValue( mQuery ), + mGeometryColumn.isNull() ? QString( "'f'," ) : QString( "has_column_privilege(%1,%2,'UPDATE')," ) - .arg( quotedValue( mQuery ) ) - .arg( quotedValue( mGeometryColumn ) ) + .arg( quotedValue( mQuery ), + quotedValue( mGeometryColumn ) ) ); } else @@ -997,9 +997,9 @@ bool QgsPostgresProvider::hasSufficientPermsAndCapabilities() if ( testAccess.PQresultStatus() != PGRES_TUPLES_OK ) { QgsMessageLog::logMessage( tr( "Unable to determine table access privileges for the %1 relation.\nThe error message from the database was:\n%2.\nSQL: %3" ) - .arg( mQuery ) - .arg( testAccess.PQresultErrorMessage() ) - .arg( sql ), + .arg( mQuery, + testAccess.PQresultErrorMessage(), + sql ), tr( "PostGIS" ) ); return false; } @@ -1036,9 +1036,9 @@ bool QgsPostgresProvider::hasSufficientPermsAndCapabilities() "pg_class.relnamespace=pg_namespace.oid AND " "%3 AND " "relname=%1 AND nspname=%2" ) - .arg( quotedValue( mTableName ) ) - .arg( quotedValue( mSchemaName ) ) - .arg( connectionRO()->pgVersion() < 80100 ? "pg_get_userbyid(relowner)=current_user" : "pg_has_role(relowner,'MEMBER')" ); + .arg( quotedValue( mTableName ), + quotedValue( mSchemaName ), + connectionRO()->pgVersion() < 80100 ? "pg_get_userbyid(relowner)=current_user" : "pg_has_role(relowner,'MEMBER')" ); testAccess = connectionRO()->PQexec( sql ); if ( testAccess.PQresultStatus() == PGRES_TUPLES_OK && testAccess.PQntuples() == 1 ) { @@ -1070,8 +1070,8 @@ bool QgsPostgresProvider::hasSufficientPermsAndCapabilities() // convert the custom query into a subquery mQuery = QString( "%1 AS %2" ) - .arg( mQuery ) - .arg( quotedIdentifier( alias ) ); + .arg( mQuery, + quotedIdentifier( alias ) ); QString sql = QString( "SELECT * FROM %1 LIMIT 1" ).arg( mQuery ); @@ -1079,8 +1079,8 @@ bool QgsPostgresProvider::hasSufficientPermsAndCapabilities() if ( testAccess.PQresultStatus() != PGRES_TUPLES_OK ) { QgsMessageLog::logMessage( tr( "Unable to execute the query.\nThe error message from the database was:\n%1.\nSQL: %2" ) - .arg( testAccess.PQresultErrorMessage() ) - .arg( sql ), tr( "PostGIS" ) ); + .arg( testAccess.PQresultErrorMessage(), + sql ), tr( "PostGIS" ) ); return false; } @@ -1163,7 +1163,7 @@ bool QgsPostgresProvider::determinePrimaryKey() { mPrimaryKeyType = pktTid; - QgsMessageLog::logMessage( tr( "Primary key is ctid - changing of existing features disabled (%1; %2)" ).arg( mGeometryColumn ).arg( mQuery ) ); + QgsMessageLog::logMessage( tr( "Primary key is ctid - changing of existing features disabled (%1; %2)" ).arg( mGeometryColumn, mQuery ) ); mEnabledCapabilities &= ~( QgsVectorDataProvider::DeleteFeatures | QgsVectorDataProvider::ChangeAttributeValues | QgsVectorDataProvider::ChangeGeometries ); } else @@ -1329,9 +1329,9 @@ bool QgsPostgresProvider::uniqueData( QString query, QString quotedColName ) Q_UNUSED( query ); // Check to see if the given column contains unique data QString sql = QString( "SELECT count(distinct %1)=count(%1) FROM %2%3" ) - .arg( quotedColName ) - .arg( mQuery ) - .arg( filterWhereClause() ); + .arg( quotedColName, + mQuery, + filterWhereClause() ); QgsPostgresResult unique( connectionRO()->PQexec( sql ) ); @@ -1352,15 +1352,15 @@ QVariant QgsPostgresProvider::minimumValue( int index ) // get the field name const QgsField &fld = field( index ); QString sql = QString( "SELECT min(%1) AS %1 FROM %2" ) - .arg( quotedIdentifier( fld.name() ) ) - .arg( mQuery ); + .arg( quotedIdentifier( fld.name() ), + mQuery ); if ( !mSqlWhereClause.isEmpty() ) { sql += QString( " WHERE %1" ).arg( mSqlWhereClause ); } - sql = QString( "SELECT %1 FROM (%2) foo" ).arg( connectionRO()->fieldExpression( fld ) ).arg( sql ); + sql = QString( "SELECT %1 FROM (%2) foo" ).arg( connectionRO()->fieldExpression( fld ), sql ); QgsPostgresResult rmin( connectionRO()->PQexec( sql ) ); return convertValue( fld.type(), rmin.PQgetvalue( 0, 0 ) ); @@ -1381,8 +1381,8 @@ void QgsPostgresProvider::uniqueValues( int index, QList &uniqueValues // get the field name const QgsField &fld = field( index ); QString sql = QString( "SELECT DISTINCT %1 FROM %2" ) - .arg( quotedIdentifier( fld.name() ) ) - .arg( mQuery ); + .arg( quotedIdentifier( fld.name() ), + mQuery ); if ( !mSqlWhereClause.isEmpty() ) { @@ -1396,7 +1396,7 @@ void QgsPostgresProvider::uniqueValues( int index, QList &uniqueValues sql += QString( " LIMIT %1" ).arg( limit ); } - sql = QString( "SELECT %1 FROM (%2) foo" ).arg( connectionRO()->fieldExpression( fld ) ).arg( sql ); + sql = QString( "SELECT %1 FROM (%2) foo" ).arg( connectionRO()->fieldExpression( fld ), sql ); QgsPostgresResult res( connectionRO()->PQexec( sql ) ); if ( res.PQresultStatus() == PGRES_TUPLES_OK ) @@ -1454,8 +1454,8 @@ bool QgsPostgresProvider::parseEnumRange( QStringList& enumValues, const QString enumValues.clear(); QString enumRangeSql = QString( "SELECT enumlabel FROM pg_catalog.pg_enum WHERE enumtypid=(SELECT atttypid::regclass FROM pg_attribute WHERE attrelid=%1::regclass AND attname=%2)" ) - .arg( quotedValue( mQuery ) ) - .arg( quotedValue( attributeName ) ); + .arg( quotedValue( mQuery ), + quotedValue( attributeName ) ); QgsPostgresResult enumRangeRes( connectionRO()->PQexec( enumRangeSql ) ); if ( enumRangeRes.PQresultStatus() != PGRES_TUPLES_OK ) return false; @@ -1473,7 +1473,7 @@ bool QgsPostgresProvider::parseDomainCheckConstraint( QStringList& enumValues, c enumValues.clear(); //is it a domain type with a check constraint? - QString domainSql = QString( "SELECT domain_name FROM information_schema.columns WHERE table_name=%1 AND column_name=%2" ).arg( quotedValue( mTableName ) ).arg( quotedValue( attributeName ) ); + QString domainSql = QString( "SELECT domain_name FROM information_schema.columns WHERE table_name=%1 AND column_name=%2" ).arg( quotedValue( mTableName ), quotedValue( attributeName ) ); QgsPostgresResult domainResult( connectionRO()->PQexec( domainSql ) ); if ( domainResult.PQresultStatus() == PGRES_TUPLES_OK && domainResult.PQntuples() > 0 ) { @@ -1527,15 +1527,15 @@ QVariant QgsPostgresProvider::maximumValue( int index ) // get the field name const QgsField &fld = field( index ); QString sql = QString( "SELECT max(%1) AS %1 FROM %2" ) - .arg( quotedIdentifier( fld.name() ) ) - .arg( mQuery ); + .arg( quotedIdentifier( fld.name() ), + mQuery ); if ( !mSqlWhereClause.isEmpty() ) { sql += QString( " WHERE %1" ).arg( mSqlWhereClause ); } - sql = QString( "SELECT %1 FROM (%2) foo" ).arg( connectionRO()->fieldExpression( fld ) ).arg( sql ); + sql = QString( "SELECT %1 FROM (%2) foo" ).arg( connectionRO()->fieldExpression( fld ), sql ); QgsPostgresResult rmax( connectionRO()->PQexec( sql ) ); return convertValue( fld.type(), rmax.PQgetvalue( 0, 0 ) ); @@ -1582,9 +1582,9 @@ bool QgsPostgresProvider::getTopoLayerInfo() "FROM topology.layer l, topology.topology t " "WHERE l.topology_id = t.id AND l.schema_name=%1 " "AND l.table_name=%2 AND l.feature_column=%3" ) - .arg( quotedValue( mSchemaName ) ) - .arg( quotedValue( mTableName ) ) - .arg( quotedValue( mGeometryColumn ) ); + .arg( quotedValue( mSchemaName ), + quotedValue( mTableName ), + quotedValue( mGeometryColumn ) ); QgsPostgresResult result( connectionRO()->PQexec( sql ) ); if ( result.PQresultStatus() != PGRES_TUPLES_OK ) { @@ -1593,9 +1593,9 @@ bool QgsPostgresProvider::getTopoLayerInfo() if ( result.PQntuples() < 1 ) { QgsMessageLog::logMessage( tr( "Could not find topology of layer %1.%2.%3" ) - .arg( quotedValue( mSchemaName ) ) - .arg( quotedValue( mTableName ) ) - .arg( quotedValue( mGeometryColumn ) ), + .arg( quotedValue( mSchemaName ), + quotedValue( mTableName ), + quotedValue( mGeometryColumn ) ), tr( "PostGIS" ) ); return false; } @@ -1611,9 +1611,9 @@ void QgsPostgresProvider::dropOrphanedTopoGeoms() "topogeo_id NOT IN ( SELECT id(%3) FROM %4.%5 )" ) .arg( quotedIdentifier( mTopoLayerInfo.topologyName ) ) .arg( mTopoLayerInfo.layerId ) - .arg( quotedIdentifier( mGeometryColumn ) ) - .arg( quotedIdentifier( mSchemaName ) ) - .arg( quotedIdentifier( mTableName ) ) + .arg( quotedIdentifier( mGeometryColumn ), + quotedIdentifier( mSchemaName ), + quotedIdentifier( mTableName ) ) ; QgsDebugMsg( "TopoGeom orphans cleanup query: " + sql ); @@ -1666,8 +1666,8 @@ QString QgsPostgresProvider::geomParam( int offset ) const geometry += QString( "%1($%2%3,%4)" ) .arg( connectionRO()->majorVersion() < 2 ? "geomfromwkb" : "st_geomfromwkb" ) .arg( offset ) - .arg( connectionRO()->useWkbHex() ? "" : "::bytea" ) - .arg( mRequestedSrid.isEmpty() ? mDetectedSrid : mRequestedSrid ); + .arg( connectionRO()->useWkbHex() ? "" : "::bytea", + mRequestedSrid.isEmpty() ? mDetectedSrid : mRequestedSrid ); if ( forceMulti ) { @@ -1786,15 +1786,15 @@ bool QgsPostgresProvider::addFeatures( QgsFeatureList &flist ) else if ( fieldTypeName == "geometry" ) { values += QString( "%1%2(%3)" ) - .arg( delim ) - .arg( connectionRO()->majorVersion() < 2 ? "geomfromewkt" : "st_geomfromewkt" ) - .arg( quotedValue( v.toString() ) ); + .arg( delim, + connectionRO()->majorVersion() < 2 ? "geomfromewkt" : "st_geomfromewkt", + quotedValue( v.toString() ) ); } else if ( fieldTypeName == "geography" ) { values += QString( "%1st_geographyfromewkt(%2)" ) - .arg( delim ) - .arg( quotedValue( v.toString() ) ); + .arg( delim, + quotedValue( v.toString() ) ); } else { @@ -1807,8 +1807,8 @@ bool QgsPostgresProvider::addFeatures( QgsFeatureList &flist ) if ( fieldTypeName == "geometry" ) { values += QString( "%1%2($%3)" ) - .arg( delim ) - .arg( connectionRO()->majorVersion() < 2 ? "geomfromewkt" : "st_geomfromewkt" ) + .arg( delim, + connectionRO()->majorVersion() < 2 ? "geomfromewkt" : "st_geomfromewkt" ) .arg( defaultValues.size() + offset ); } else if ( fieldTypeName == "geography" ) @@ -1949,7 +1949,7 @@ bool QgsPostgresProvider::deleteFeatures( const QgsFeatureIds & id ) for ( QgsFeatureIds::const_iterator it = id.begin(); it != id.end(); ++it ) { QString sql = QString( "DELETE FROM %1 WHERE %2" ) - .arg( mQuery ).arg( whereClause( *it ) ); + .arg( mQuery, whereClause( *it ) ); QgsDebugMsg( "delete sql: " + sql ); //send DELETE statement and do error handling @@ -2022,7 +2022,7 @@ bool QgsPostgresProvider::addAttributes( const QList &attributes ) if ( iter->length() > 0 && iter->precision() >= 0 ) type = QString( "%1(%2,%3)" ).arg( type ).arg( iter->length() ).arg( iter->precision() ); } - sql.append( QString( "%1ADD COLUMN %2 %3" ).arg( delim ).arg( quotedIdentifier( iter->name() ) ).arg( type ) ); + sql.append( QString( "%1ADD COLUMN %2 %3" ).arg( delim, quotedIdentifier( iter->name() ), type ) ); delim = ","; } @@ -2036,9 +2036,9 @@ bool QgsPostgresProvider::addAttributes( const QList &attributes ) if ( !iter->comment().isEmpty() ) { sql = QString( "COMMENT ON COLUMN %1.%2 IS %3" ) - .arg( mQuery ) - .arg( quotedIdentifier( iter->name() ) ) - .arg( quotedValue( iter->comment() ) ); + .arg( mQuery, + quotedIdentifier( iter->name() ), + quotedValue( iter->comment() ) ); result = conn->PQexec( sql ); if ( result.PQresultStatus() != PGRES_COMMAND_OK ) throw PGException( result ); @@ -2088,8 +2088,8 @@ bool QgsPostgresProvider::deleteAttributes( const QgsAttributeIds& ids ) QString column = mAttributeFields[index].name(); QString sql = QString( "ALTER TABLE %1 DROP COLUMN %2" ) - .arg( mQuery ) - .arg( quotedIdentifier( column ) ); + .arg( mQuery, + quotedIdentifier( column ) ); //send sql statement and do error handling QgsPostgresResult result( conn->PQexec( sql ) ); @@ -2167,8 +2167,8 @@ bool QgsPostgresProvider::changeAttributeValues( const QgsChangedAttributesMap & if ( fld.typeName() == "geometry" ) { sql += QString( "%1(%2)" ) - .arg( connectionRO()->majorVersion() < 2 ? "geomfromewkt" : "st_geomfromewkt" ) - .arg( quotedValue( siter->toString() ) ); + .arg( connectionRO()->majorVersion() < 2 ? "geomfromewkt" : "st_geomfromewkt", + quotedValue( siter->toString() ) ); } else if ( fld.typeName() == "geography" ) { @@ -2276,14 +2276,14 @@ bool QgsPostgresProvider::changeGeometryValues( QgsGeometryMap & geometry_map ) // to avoid orphans and retain higher level in an eventual // hierarchical definition update = QString( "SELECT id(%1) FROM %2 o WHERE %3" ) - .arg( geomParam( 1 ) ) - .arg( mQuery ) - .arg( pkParamWhereClause( 2 ) ); + .arg( geomParam( 1 ), + mQuery, + pkParamWhereClause( 2 ) ); QString getid = QString( "SELECT id(%1) FROM %2 WHERE %3" ) - .arg( quotedIdentifier( mGeometryColumn ) ) - .arg( mQuery ) - .arg( pkParamWhereClause( 1 ) ); + .arg( quotedIdentifier( mGeometryColumn ), + mQuery, + pkParamWhereClause( 1 ) ); QgsDebugMsg( "getting old topogeometry id: " + getid ); @@ -2298,9 +2298,9 @@ bool QgsPostgresProvider::changeGeometryValues( QgsGeometryMap & geometry_map ) QString replace = QString( "UPDATE %1 SET %2=" "( topology_id(%2),layer_id(%2),$1,type(%2) )" "WHERE %3" ) - .arg( mQuery ) - .arg( quotedIdentifier( mGeometryColumn ) ) - .arg( pkParamWhereClause( 2 ) ); + .arg( mQuery, + quotedIdentifier( mGeometryColumn ), + pkParamWhereClause( 2 ) ); QgsDebugMsg( "TopoGeom swap: " + replace ); result = conn->PQprepare( "replacetopogeom", replace, 2, NULL ); if ( result.PQresultStatus() != PGRES_COMMAND_OK ) @@ -2314,10 +2314,10 @@ bool QgsPostgresProvider::changeGeometryValues( QgsGeometryMap & geometry_map ) else { update = QString( "UPDATE %1 SET %2=%3 WHERE %4" ) - .arg( mQuery ) - .arg( quotedIdentifier( mGeometryColumn ) ) - .arg( geomParam( 1 ) ) - .arg( pkParamWhereClause( 2 ) ); + .arg( mQuery, + quotedIdentifier( mGeometryColumn ), + geomParam( 1 ), + pkParamWhereClause( 2 ) ); } QgsDebugMsg( "updating: " + update ); @@ -2512,7 +2512,7 @@ long QgsPostgresProvider::featureCount() const } else { - sql = QString( "SELECT count(*) FROM %1%2" ).arg( mQuery ).arg( filterWhereClause() ); + sql = QString( "SELECT count(*) FROM %1%2" ).arg( mQuery, filterWhereClause() ); } QgsPostgresResult result( connectionRO()->PQexec( sql ) ); @@ -2546,9 +2546,9 @@ QgsRectangle QgsPostgresProvider::extent() { // do stats exists? sql = QString( "SELECT count(*) FROM pg_stats WHERE schemaname=%1 AND tablename=%2 AND attname=%3" ) - .arg( quotedValue( mSchemaName ) ) - .arg( quotedValue( mTableName ) ) - .arg( quotedValue( mGeometryColumn ) ); + .arg( quotedValue( mSchemaName ), + quotedValue( mTableName ), + quotedValue( mGeometryColumn ) ); result = connectionRO()->PQexec( sql ); if ( result.PQresultStatus() == PGRES_TUPLES_OK && result.PQntuples() == 1 ) { @@ -2562,10 +2562,10 @@ QgsRectangle QgsPostgresProvider::extent() { sql = QString( "SELECT %1(%2,%3,%4)" ) .arg( connectionRO()->majorVersion() < 2 ? "estimated_extent" : - ( connectionRO()->majorVersion() == 2 && connectionRO()->minorVersion() < 1 ? "st_estimated_extent" : "st_estimatedextent" ) ) - .arg( quotedValue( mSchemaName ) ) - .arg( quotedValue( mTableName ) ) - .arg( quotedValue( mGeometryColumn ) ); + ( connectionRO()->majorVersion() == 2 && connectionRO()->minorVersion() < 1 ? "st_estimated_extent" : "st_estimatedextent" ), + quotedValue( mSchemaName ), + quotedValue( mTableName ), + quotedValue( mGeometryColumn ) ); result = mConnectionRO->PQexec( sql ); if ( result.PQresultStatus() == PGRES_TUPLES_OK && result.PQntuples() == 1 && !result.PQgetisnull( 0, 0 ) ) { @@ -2590,18 +2590,18 @@ QgsRectangle QgsPostgresProvider::extent() } else { - QgsDebugMsg( QString( "no column statistics for %1.%2.%3" ).arg( mSchemaName ).arg( mTableName ).arg( mGeometryColumn ) ); + QgsDebugMsg( QString( "no column statistics for %1.%2.%3" ).arg( mSchemaName, mTableName, mGeometryColumn ) ); } } if ( ext.isEmpty() ) { sql = QString( "SELECT %1(%2%3) FROM %4%5" ) - .arg( connectionRO()->majorVersion() < 2 ? "extent" : "st_extent" ) - .arg( quotedIdentifier( mGeometryColumn ) ) - .arg( mSpatialColType == sctPcPatch ? "::geometry" : "" ) - .arg( mQuery ) - .arg( filterWhereClause() ); + .arg( connectionRO()->majorVersion() < 2 ? "extent" : "st_extent", + quotedIdentifier( mGeometryColumn ), + mSpatialColType == sctPcPatch ? "::geometry" : "", + mQuery, + filterWhereClause() ); result = connectionRO()->PQexec( sql ); if ( result.PQresultStatus() != PGRES_TUPLES_OK ) @@ -2660,7 +2660,7 @@ bool QgsPostgresProvider::getGeometryDetails() if ( mIsQuery ) { - sql = QString( "SELECT %1 FROM %2 LIMIT 0" ).arg( quotedIdentifier( mGeometryColumn ) ).arg( mQuery ); + sql = QString( "SELECT %1 FROM %2 LIMIT 0" ).arg( quotedIdentifier( mGeometryColumn ), mQuery ); QgsDebugMsg( QString( "Getting geometry column: %1" ).arg( sql ) ); @@ -2724,9 +2724,9 @@ bool QgsPostgresProvider::getGeometryDetails() { // check geometry columns sql = QString( "SELECT upper(type),srid,coord_dimension FROM geometry_columns WHERE f_table_name=%1 AND f_geometry_column=%2 AND f_table_schema=%3" ) - .arg( quotedValue( tableName ) ) - .arg( quotedValue( geomCol ) ) - .arg( quotedValue( schemaName ) ); + .arg( quotedValue( tableName ), + quotedValue( geomCol ), + quotedValue( schemaName ) ); QgsDebugMsg( QString( "Getting geometry column: %1" ).arg( sql ) ); result = connectionRO()->PQexec( sql ); @@ -2747,9 +2747,9 @@ bool QgsPostgresProvider::getGeometryDetails() { // check geography columns sql = QString( "SELECT upper(type),srid FROM geography_columns WHERE f_table_name=%1 AND f_geography_column=%2 AND f_table_schema=%3" ) - .arg( quotedValue( tableName ) ) - .arg( quotedValue( geomCol ) ) - .arg( quotedValue( schemaName ) ); + .arg( quotedValue( tableName ), + quotedValue( geomCol ), + quotedValue( schemaName ) ); QgsDebugMsg( QString( "Getting geography column: %1" ).arg( sql ) ); result = connectionRO()->PQexec( sql, false ); @@ -2778,9 +2778,9 @@ bool QgsPostgresProvider::getGeometryDetails() "END AS type, t.srid FROM topology.layer l, topology.topology t " "WHERE l.topology_id = t.id AND l.schema_name=%3 " "AND l.table_name=%1 AND l.feature_column=%2" ) - .arg( quotedValue( tableName ) ) - .arg( quotedValue( geomCol ) ) - .arg( quotedValue( schemaName ) ); + .arg( quotedValue( tableName ), + quotedValue( geomCol ), + quotedValue( schemaName ) ); QgsDebugMsg( QString( "Getting TopoGeometry column: %1" ).arg( sql ) ); result = connectionRO()->PQexec( sql, false ); @@ -2802,9 +2802,9 @@ bool QgsPostgresProvider::getGeometryDetails() { // check pointcloud columns sql = QString( "SELECT 'POLYGON',srid FROM pointcloud_columns WHERE \"table\"=%1 AND \"column\"=%2 AND \"schema\"=%3" ) - .arg( quotedValue( tableName ) ) - .arg( quotedValue( geomCol ) ) - .arg( quotedValue( schemaName ) ); + .arg( quotedValue( tableName ), + quotedValue( geomCol ), + quotedValue( schemaName ) ); QgsDebugMsg( QString( "Getting pointcloud column: %1" ).arg( sql ) ); result = connectionRO()->PQexec( sql, false ); @@ -2829,9 +2829,9 @@ bool QgsPostgresProvider::getGeometryDetails() "WHERE a.attrelid=c.oid AND c.relnamespace=n.oid " "AND a.atttypid=t.oid " "AND n.nspname=%3 AND c.relname=%1 AND a.attname=%2" ) - .arg( quotedValue( tableName ) ) - .arg( quotedValue( geomCol ) ) - .arg( quotedValue( schemaName ) ); + .arg( quotedValue( tableName ), + quotedValue( geomCol ), + quotedValue( schemaName ) ); QgsDebugMsg( QString( "Getting column datatype: %1" ).arg( sql ) ); result = connectionRO()->PQexec( sql, false ); QgsDebugMsg( QString( "Column datatype query returned %1" ).arg( result.PQntuples() ) ); @@ -2897,7 +2897,7 @@ bool QgsPostgresProvider::getGeometryDetails() // no data - so take what's requested if ( mRequestedGeomType == QGis::WKBUnknown || mRequestedSrid.isEmpty() ) { - QgsMessageLog::logMessage( tr( "Geometry type and srid for empty column %1 of %2 undefined." ).arg( mGeometryColumn ).arg( mQuery ) ); + QgsMessageLog::logMessage( tr( "Geometry type and srid for empty column %1 of %2 undefined." ).arg( mGeometryColumn, mQuery ) ); } } else @@ -2926,7 +2926,7 @@ bool QgsPostgresProvider::getGeometryDetails() else { // geometry type undetermined or not unrequested - QgsMessageLog::logMessage( tr( "Feature type or srid for %1 of %2 could not be determined or was not requested." ).arg( mGeometryColumn ).arg( mQuery ) ); + QgsMessageLog::logMessage( tr( "Feature type or srid for %1 of %2 could not be determined or was not requested." ).arg( mGeometryColumn, mQuery ) ); } } } @@ -2951,7 +2951,7 @@ bool QgsPostgresProvider::getGeometryDetails() { // explicitly disable adding new features and editing of geometries // as this would lead to corruption of measures - QgsMessageLog::logMessage( tr( "Editing and adding disabled for 2D+ layer (%1; %2)" ).arg( mGeometryColumn ).arg( mQuery ) ); + QgsMessageLog::logMessage( tr( "Editing and adding disabled for 2D+ layer (%1; %2)" ).arg( mGeometryColumn, mQuery ) ); mEnabledCapabilities &= ~( QgsVectorDataProvider::AddFeatures ); } @@ -3138,8 +3138,8 @@ QgsVectorLayerImport::ImportError QgsPostgresProvider::createEmptyLayer( " FROM pg_class AS cls JOIN pg_namespace AS nsp" " ON nsp.oid=cls.relnamespace " " WHERE cls.relname=%1 AND nsp.nspname=%2" ) - .arg( quotedValue( tableName ) ) - .arg( quotedValue( schemaName ) ); + .arg( quotedValue( tableName ), + quotedValue( schemaName ) ); QgsPostgresResult result( conn->PQexec( sql ) ); if ( result.PQresultStatus() != PGRES_TUPLES_OK ) @@ -3154,8 +3154,8 @@ QgsVectorLayerImport::ImportError QgsPostgresProvider::createEmptyLayer( " FROM pg_class AS cls JOIN pg_namespace AS nsp" " ON nsp.oid=cls.relnamespace " " WHERE cls.relname=%2 AND nsp.nspname=%1" ) - .arg( quotedValue( schemaName ) ) - .arg( quotedValue( tableName ) ); + .arg( quotedValue( schemaName ), + quotedValue( tableName ) ); result = conn->PQexec( sql ); if ( result.PQresultStatus() != PGRES_TUPLES_OK ) @@ -3170,9 +3170,9 @@ QgsVectorLayerImport::ImportError QgsPostgresProvider::createEmptyLayer( } sql = QString( "CREATE TABLE %1(%2 %3 PRIMARY KEY)" ) - .arg( schemaTableName ) - .arg( quotedIdentifier( primaryKey ) ) - .arg( primaryKeyType ); + .arg( schemaTableName, + quotedIdentifier( primaryKey ), + primaryKeyType ); result = conn->PQexec( sql ); if ( result.PQresultStatus() != PGRES_COMMAND_OK ) @@ -3188,9 +3188,9 @@ QgsVectorLayerImport::ImportError QgsPostgresProvider::createEmptyLayer( if ( !geometryType.isEmpty() ) { sql = QString( "SELECT AddGeometryColumn(%1,%2,%3,%4,%5,%6)" ) - .arg( quotedValue( schemaName ) ) - .arg( quotedValue( tableName ) ) - .arg( quotedValue( geometryColumn ) ) + .arg( quotedValue( schemaName ), + quotedValue( tableName ), + quotedValue( geometryColumn ) ) .arg( srid ) .arg( quotedValue( geometryType ) ) .arg( dim ); @@ -3210,8 +3210,8 @@ QgsVectorLayerImport::ImportError QgsPostgresProvider::createEmptyLayer( { if ( errorMessage ) *errorMessage = QObject::tr( "Creation of data source %1 failed: \n%2" ) - .arg( schemaTableName ) - .arg( e.errorMessage() ); + .arg( schemaTableName, + e.errorMessage() ); conn->PQexecNR( "ROLLBACK" ); conn->unref(); @@ -3280,7 +3280,7 @@ QgsVectorLayerImport::ImportError QgsPostgresProvider::createEmptyLayer( QgsDebugMsg( QString( "creating field #%1 -> #%2 name %3 type %4 typename %5 width %6 precision %7" ) .arg( fldIdx ).arg( offset ) - .arg( fld.name() ).arg( QVariant::typeToName( fld.type() ) ).arg( fld.typeName() ) + .arg( fld.name(), QVariant::typeToName( fld.type() ), fld.typeName() ) .arg( fld.length() ).arg( fld.precision() ) ); @@ -3364,7 +3364,7 @@ QString QgsPostgresProvider::description() const pgVersion = tr( "PostgreSQL not connected" ); } - return tr( "PostgreSQL/PostGIS provider\n%1\nPostGIS %2" ).arg( pgVersion ).arg( postgisVersion ); + return tr( "PostgreSQL/PostGIS provider\n%1\nPostGIS %2" ).arg( pgVersion, postgisVersion ); } // QgsPostgresProvider::description() /** @@ -3460,14 +3460,14 @@ QGISEXTERN bool deleteLayer( const QString& uri, QString& errCause ) "WHERE f_table_name=relname AND f_table_schema=nspname " "AND pg_class.relnamespace=pg_namespace.oid " "AND f_table_schema=%1 AND f_table_name=%2" ) - .arg( QgsPostgresConn::quotedValue( schemaName ) ) - .arg( QgsPostgresConn::quotedValue( tableName ) ); + .arg( QgsPostgresConn::quotedValue( schemaName ), + QgsPostgresConn::quotedValue( tableName ) ); QgsPostgresResult result( conn->PQexec( sql ) ); if ( result.PQresultStatus() != PGRES_TUPLES_OK ) { errCause = QObject::tr( "Unable to delete layer %1: \n%2" ) - .arg( schemaTableName ) - .arg( result.PQresultErrorMessage() ); + .arg( schemaTableName, + result.PQresultErrorMessage() ); conn->unref(); return false; } @@ -3478,24 +3478,24 @@ QGISEXTERN bool deleteLayer( const QString& uri, QString& errCause ) { // the table has more geometry columns, drop just the geometry column sql = QString( "SELECT DropGeometryColumn(%1,%2,%3)" ) - .arg( QgsPostgresConn::quotedValue( schemaName ) ) - .arg( QgsPostgresConn::quotedValue( tableName ) ) - .arg( QgsPostgresConn::quotedValue( geometryCol ) ); + .arg( QgsPostgresConn::quotedValue( schemaName ), + QgsPostgresConn::quotedValue( tableName ), + QgsPostgresConn::quotedValue( geometryCol ) ); } else { // drop the table sql = QString( "SELECT DropGeometryTable(%1,%2)" ) - .arg( QgsPostgresConn::quotedValue( schemaName ) ) - .arg( QgsPostgresConn::quotedValue( tableName ) ); + .arg( QgsPostgresConn::quotedValue( schemaName ), + QgsPostgresConn::quotedValue( tableName ) ); } result = conn->PQexec( sql ); if ( result.PQresultStatus() != PGRES_TUPLES_OK ) { errCause = QObject::tr( "Unable to delete layer %1: \n%2" ) - .arg( schemaTableName ) - .arg( result.PQresultErrorMessage() ); + .arg( schemaTableName, + result.PQresultErrorMessage() ); conn->unref(); return false; } @@ -3522,14 +3522,14 @@ QGISEXTERN bool deleteSchema( const QString& schema, const QgsDataSourceURI& uri // drop the schema QString sql = QString( "DROP SCHEMA %1 %2" ) - .arg( schemaName ).arg( cascade ? QString( "CASCADE" ) : QString() ); + .arg( schemaName, cascade ? QString( "CASCADE" ) : QString() ); QgsPostgresResult result( conn->PQexec( sql ) ); if ( result.PQresultStatus() != PGRES_COMMAND_OK ) { errCause = QObject::tr( "Unable to delete schema %1: \n%2" ) - .arg( schemaName ) - .arg( result.PQresultErrorMessage() ); + .arg( schemaName, + result.PQresultErrorMessage() ); conn->unref(); return false; } @@ -3671,7 +3671,7 @@ QGISEXTERN bool saveStyle( const QString& uri, const QString& qmlStyle, const QS .arg( QgsPostgresConn::quotedValue( dsUri.schema() ) ) .arg( QgsPostgresConn::quotedValue( dsUri.table() ) ) .arg( QgsPostgresConn::quotedValue( dsUri.geometryColumn() ) ); - sql = QString( "BEGIN; %1; %2; COMMIT;" ).arg( removeDefaultSql ).arg( sql ); + sql = QString( "BEGIN; %1; %2; COMMIT;" ).arg( removeDefaultSql, sql ); } res = conn->PQexec( sql ); diff --git a/src/providers/spatialite/qgsspatialiteconnection.cpp b/src/providers/spatialite/qgsspatialiteconnection.cpp index b6d6c5ec1b6..976858a0015 100644 --- a/src/providers/spatialite/qgsspatialiteconnection.cpp +++ b/src/providers/spatialite/qgsspatialiteconnection.cpp @@ -660,8 +660,8 @@ bool QgsSpatiaLiteConnection::isDeclaredHidden( sqlite3 * handle, QString table, return false; // checking if some Layer has been declared as HIDDEN QString sql = QString( "SELECT hidden FROM geometry_columns_auth" - " WHERE f_table_name=%1 and f_geometry_column=%2" ).arg( quotedValue( table ) ). - arg( quotedValue( geom ) ); + " WHERE f_table_name=%1 and f_geometry_column=%2" ).arg( quotedValue( table ), + quotedValue( geom ) ); ret = sqlite3_get_table( handle, sql.toUtf8().constData(), &results, &rows, &columns, &errMsg ); if ( ret != SQLITE_OK ) @@ -747,8 +747,8 @@ QgsSqliteHandle* QgsSqliteHandle::openDb( const QString & dbPath, bool shared ) { // failure QgsDebugMsg( QString( "Failure while connecting to: %1\n%2" ) - .arg( dbPath ) - .arg( QString::fromUtf8( sqlite3_errmsg( sqlite_handle ) ) ) ); + .arg( dbPath, + QString::fromUtf8( sqlite3_errmsg( sqlite_handle ) ) ) ); return NULL; } diff --git a/src/providers/spatialite/qgsspatialitedataitems.cpp b/src/providers/spatialite/qgsspatialitedataitems.cpp index cc8d390b4a2..0c07590ccb8 100644 --- a/src/providers/spatialite/qgsspatialitedataitems.cpp +++ b/src/providers/spatialite/qgsspatialitedataitems.cpp @@ -124,7 +124,7 @@ QVector QgsSLConnectionItem::createChildren() } QString msgDetails = connection.errorMessage(); if ( !msgDetails.isEmpty() ) - msg = QString( "%1 (%2)" ).arg( msg ).arg( msgDetails ); + msg = QString( "%1 (%2)" ).arg( msg, msgDetails ); children.append( new QgsErrorItem( this, msg, mPath + "/error" ) ); return children; } @@ -220,7 +220,7 @@ bool QgsSLConnectionItem::handleDrop( const QMimeData * data, Qt::DropAction ) importResults.append( tr( "%1: OK!" ).arg( u.name ) ); else { - importResults.append( QString( "%1: %2" ).arg( u.name ).arg( importError ) ); + importResults.append( QString( "%1: %2" ).arg( u.name, importError ) ); hasError = true; } } diff --git a/src/providers/spatialite/qgsspatialitefeatureiterator.cpp b/src/providers/spatialite/qgsspatialitefeatureiterator.cpp index 6cdd1a4fb36..c2c1e0bdaf1 100644 --- a/src/providers/spatialite/qgsspatialitefeatureiterator.cpp +++ b/src/providers/spatialite/qgsspatialitefeatureiterator.cpp @@ -183,7 +183,7 @@ bool QgsSpatiaLiteFeatureIterator::prepareStatement( QString whereClause ) if ( sqlite3_prepare_v2( mHandle->handle(), sql.toUtf8().constData(), -1, &sqliteStatement, NULL ) != SQLITE_OK ) { // some error occurred - QgsMessageLog::logMessage( QObject::tr( "SQLite error: %2\nSQL: %1" ).arg( sql ).arg( sqlite3_errmsg( mHandle->handle() ) ), QObject::tr( "SpatiaLite" ) ); + QgsMessageLog::logMessage( QObject::tr( "SQLite error: %2\nSQL: %1" ).arg( sql, sqlite3_errmsg( mHandle->handle() ) ), QObject::tr( "SpatiaLite" ) ); return false; } } @@ -229,12 +229,12 @@ QString QgsSpatiaLiteFeatureIterator::whereClauseRect() if ( mRequest.flags() & QgsFeatureRequest::ExactIntersect ) { // we are requested to evaluate a true INTERSECT relationship - whereClause += QString( "Intersects(%1, BuildMbr(%2)) AND " ).arg( QgsSpatiaLiteProvider::quotedIdentifier( mSource->mGeometryColumn ) ).arg( mbr( rect ) ); + whereClause += QString( "Intersects(%1, BuildMbr(%2)) AND " ).arg( QgsSpatiaLiteProvider::quotedIdentifier( mSource->mGeometryColumn ), mbr( rect ) ); } if ( mSource->mVShapeBased ) { // handling a VirtualShape layer - whereClause += QString( "MbrIntersects(%1, BuildMbr(%2))" ).arg( QgsSpatiaLiteProvider::quotedIdentifier( mSource->mGeometryColumn ) ).arg( mbr( rect ) ); + whereClause += QString( "MbrIntersects(%1, BuildMbr(%2))" ).arg( QgsSpatiaLiteProvider::quotedIdentifier( mSource->mGeometryColumn ), mbr( rect ) ); } else if ( rect.isFinite() ) { @@ -245,25 +245,25 @@ QString QgsSpatiaLiteFeatureIterator::whereClauseRect() mbrFilter += QString( "xmax >= %1 AND " ).arg( qgsDoubleToString( rect.xMinimum() ) ); mbrFilter += QString( "ymin <= %1 AND " ).arg( qgsDoubleToString( rect.yMaximum() ) ); mbrFilter += QString( "ymax >= %1" ).arg( qgsDoubleToString( rect.yMinimum() ) ); - QString idxName = QString( "idx_%1_%2" ).arg( mSource->mIndexTable ).arg( mSource->mIndexGeometry ); + QString idxName = QString( "idx_%1_%2" ).arg( mSource->mIndexTable, mSource->mIndexGeometry ); whereClause += QString( "%1 IN (SELECT pkid FROM %2 WHERE %3)" ) - .arg( quotedPrimaryKey() ) - .arg( QgsSpatiaLiteProvider::quotedIdentifier( idxName ) ) - .arg( mbrFilter ); + .arg( quotedPrimaryKey(), + QgsSpatiaLiteProvider::quotedIdentifier( idxName ), + mbrFilter ); } else if ( mSource->spatialIndexMbrCache ) { // using the MbrCache spatial index - QString idxName = QString( "cache_%1_%2" ).arg( mSource->mIndexTable ).arg( mSource->mIndexGeometry ); + QString idxName = QString( "cache_%1_%2" ).arg( mSource->mIndexTable, mSource->mIndexGeometry ); whereClause += QString( "%1 IN (SELECT rowid FROM %2 WHERE mbr = FilterMbrIntersects(%3))" ) - .arg( quotedPrimaryKey() ) - .arg( QgsSpatiaLiteProvider::quotedIdentifier( idxName ) ) - .arg( mbr( rect ) ); + .arg( quotedPrimaryKey(), + QgsSpatiaLiteProvider::quotedIdentifier( idxName ), + mbr( rect ) ); } else { // using simple MBR filtering - whereClause += QString( "MbrIntersects(%1, BuildMbr(%2))" ).arg( QgsSpatiaLiteProvider::quotedIdentifier( mSource->mGeometryColumn ) ).arg( mbr( rect ) ); + whereClause += QString( "MbrIntersects(%1, BuildMbr(%2))" ).arg( QgsSpatiaLiteProvider::quotedIdentifier( mSource->mGeometryColumn ), mbr( rect ) ); } } else @@ -277,10 +277,10 @@ QString QgsSpatiaLiteFeatureIterator::whereClauseRect() QString QgsSpatiaLiteFeatureIterator::mbr( const QgsRectangle& rect ) { return QString( "%1, %2, %3, %4" ) - .arg( qgsDoubleToString( rect.xMinimum() ) ) - .arg( qgsDoubleToString( rect.yMinimum() ) ) - .arg( qgsDoubleToString( rect.xMaximum() ) ) - .arg( qgsDoubleToString( rect.yMaximum() ) ); + .arg( qgsDoubleToString( rect.xMinimum() ), + qgsDoubleToString( rect.yMinimum() ), + qgsDoubleToString( rect.xMaximum() ), + qgsDoubleToString( rect.yMaximum() ) ); } diff --git a/src/providers/spatialite/qgsspatialiteprovider.cpp b/src/providers/spatialite/qgsspatialiteprovider.cpp index 4fcb3782e61..4c53edc294a 100644 --- a/src/providers/spatialite/qgsspatialiteprovider.cpp +++ b/src/providers/spatialite/qgsspatialiteprovider.cpp @@ -218,9 +218,9 @@ QgsSpatiaLiteProvider::createEmptyLayer( } sql = QString( "CREATE TABLE %1 (%2 %3 PRIMARY KEY)" ) - .arg( quotedIdentifier( tableName ) ) - .arg( quotedIdentifier( primaryKey ) ) - .arg( primaryKeyType ); + .arg( quotedIdentifier( tableName ), + quotedIdentifier( primaryKey ), + primaryKeyType ); ret = sqlite3_exec( sqliteHandle, sql.toUtf8().constData(), NULL, NULL, &errMsg ); if ( ret != SQLITE_OK ) @@ -282,8 +282,8 @@ QgsSpatiaLiteProvider::createEmptyLayer( if ( !geometryType.isEmpty() ) { sql = QString( "SELECT AddGeometryColumn(%1, %2, %3, %4, %5)" ) - .arg( QgsSpatiaLiteProvider::quotedValue( tableName ) ) - .arg( QgsSpatiaLiteProvider::quotedValue( geometryColumn ) ) + .arg( QgsSpatiaLiteProvider::quotedValue( tableName ), + QgsSpatiaLiteProvider::quotedValue( geometryColumn ) ) .arg( srid ) .arg( QgsSpatiaLiteProvider::quotedValue( geometryType ) ) .arg( dim ); @@ -305,14 +305,14 @@ QgsSpatiaLiteProvider::createEmptyLayer( catch ( SLException &e ) { QgsDebugMsg( QString( "creation of data source %1 failed. %2" ) - .arg( tableName ) - .arg( e.errorMessage() ) + .arg( tableName, + e.errorMessage() ) ); if ( errorMessage ) *errorMessage = QObject::tr( "creation of data source %1 failed. %2" ) - .arg( tableName ) - .arg( e.errorMessage() ); + .arg( tableName, + e.errorMessage() ); if ( toCommit ) @@ -782,7 +782,7 @@ void QgsSpatiaLiteProvider::loadFields() if ( sqlite3_prepare_v2( sqliteHandle, sql.toUtf8().constData(), -1, &stmt, NULL ) != SQLITE_OK ) { // some error occurred - QgsMessageLog::logMessage( tr( "SQLite error: %2\nSQL: %1" ).arg( sql ).arg( sqlite3_errmsg( sqliteHandle ) ), tr( "SpatiaLite" ) ); + QgsMessageLog::logMessage( tr( "SQLite error: %2\nSQL: %1" ).arg( sql, sqlite3_errmsg( sqliteHandle ) ), tr( "SpatiaLite" ) ); return; } @@ -852,7 +852,7 @@ void QgsSpatiaLiteProvider::loadFields() return; error: - QgsMessageLog::logMessage( tr( "SQLite error: %2\nSQL: %1" ).arg( sql ).arg( errMsg ? errMsg : tr( "unknown cause" ) ), tr( "SpatiaLite" ) ); + QgsMessageLog::logMessage( tr( "SQLite error: %2\nSQL: %1" ).arg( sql, errMsg ? errMsg : tr( "unknown cause" ) ), tr( "SpatiaLite" ) ); // unexpected error if ( errMsg != NULL ) { @@ -3242,8 +3242,8 @@ QgsCoordinateReferenceSystem QgsSpatiaLiteProvider::crs() if ( srs.srsid() == 0 ) { QString myName = QString( " * %1 (%2)" ) - .arg( QObject::tr( "Generated CRS", "A CRS automatically generated from layer info get this prefix for description" ) ) - .arg( srs.toProj4() ); + .arg( QObject::tr( "Generated CRS", "A CRS automatically generated from layer info get this prefix for description" ), + srs.toProj4() ); srs.saveAsUserCRS( myName ); } @@ -3291,7 +3291,7 @@ QVariant QgsSpatiaLiteProvider::minimumValue( int index ) // get the field name const QgsField& fld = field( index ); - sql = QString( "SELECT Min(%1) FROM %2" ).arg( quotedIdentifier( fld.name() ) ).arg( mQuery ); + sql = QString( "SELECT Min(%1) FROM %2" ).arg( quotedIdentifier( fld.name() ), mQuery ); if ( !mSubsetString.isEmpty() ) { @@ -3301,7 +3301,7 @@ QVariant QgsSpatiaLiteProvider::minimumValue( int index ) ret = sqlite3_get_table( sqliteHandle, sql.toUtf8().constData(), &results, &rows, &columns, &errMsg ); if ( ret != SQLITE_OK ) { - QgsMessageLog::logMessage( tr( "SQLite error: %2\nSQL: %1" ).arg( sql ).arg( errMsg ? errMsg : tr( "unknown cause" ) ), tr( "SpatiaLite" ) ); + QgsMessageLog::logMessage( tr( "SQLite error: %2\nSQL: %1" ).arg( sql, errMsg ? errMsg : tr( "unknown cause" ) ), tr( "SpatiaLite" ) ); // unexpected error if ( errMsg != NULL ) { @@ -3357,7 +3357,7 @@ QVariant QgsSpatiaLiteProvider::maximumValue( int index ) // get the field name const QgsField & fld = field( index ); - sql = QString( "SELECT Max(%1) FROM %2" ).arg( quotedIdentifier( fld.name() ) ).arg( mQuery ); + sql = QString( "SELECT Max(%1) FROM %2" ).arg( quotedIdentifier( fld.name() ), mQuery ); if ( !mSubsetString.isEmpty() ) { @@ -3367,7 +3367,7 @@ QVariant QgsSpatiaLiteProvider::maximumValue( int index ) ret = sqlite3_get_table( sqliteHandle, sql.toUtf8().constData(), &results, &rows, &columns, &errMsg ); if ( ret != SQLITE_OK ) { - QgsMessageLog::logMessage( tr( "SQLite error: %2\nSQL: %1" ).arg( sql ).arg( errMsg ? errMsg : tr( "unknown cause" ) ), tr( "SpatiaLite" ) ); + QgsMessageLog::logMessage( tr( "SQLite error: %2\nSQL: %1" ).arg( sql, errMsg ? errMsg : tr( "unknown cause" ) ), tr( "SpatiaLite" ) ); // unexpected error if ( errMsg != NULL ) { @@ -3423,7 +3423,7 @@ void QgsSpatiaLiteProvider::uniqueValues( int index, QList < QVariant > &uniqueV } const QgsField& fld = attributeFields[index]; - sql = QString( "SELECT DISTINCT %1 FROM %2" ).arg( quotedIdentifier( fld.name() ) ).arg( mQuery ); + sql = QString( "SELECT DISTINCT %1 FROM %2" ).arg( quotedIdentifier( fld.name() ), mQuery ); if ( !mSubsetString.isEmpty() ) { @@ -3441,7 +3441,7 @@ void QgsSpatiaLiteProvider::uniqueValues( int index, QList < QVariant > &uniqueV if ( sqlite3_prepare_v2( sqliteHandle, sql.toUtf8().constData(), -1, &stmt, NULL ) != SQLITE_OK ) { // some error occurred - QgsMessageLog::logMessage( tr( "SQLite error: %2\nSQL: %1" ).arg( sql ).arg( sqlite3_errmsg( sqliteHandle ) ), tr( "SpatiaLite" ) ); + QgsMessageLog::logMessage( tr( "SQLite error: %2\nSQL: %1" ).arg( sql, sqlite3_errmsg( sqliteHandle ) ), tr( "SpatiaLite" ) ); return; } @@ -3477,7 +3477,7 @@ void QgsSpatiaLiteProvider::uniqueValues( int index, QList < QVariant > &uniqueV } else { - QgsMessageLog::logMessage( tr( "SQLite error: %2\nSQL: %1" ).arg( sql ).arg( sqlite3_errmsg( sqliteHandle ) ), tr( "SpatiaLite" ) ); + QgsMessageLog::logMessage( tr( "SQLite error: %2\nSQL: %1" ).arg( sql, sqlite3_errmsg( sqliteHandle ) ), tr( "SpatiaLite" ) ); sqlite3_finalize( stmt ); return; } @@ -3700,7 +3700,7 @@ bool QgsSpatiaLiteProvider::addFeatures( QgsFeatureList & flist ) if ( ret != SQLITE_OK ) { - pushError( tr( "SQLite error: %2\nSQL: %1" ).arg( sql ).arg( errMsg ? errMsg : tr( "unknown cause" ) ) ); + pushError( tr( "SQLite error: %2\nSQL: %1" ).arg( sql, errMsg ? errMsg : tr( "unknown cause" ) ) ); if ( errMsg ) { sqlite3_free( errMsg ); @@ -3737,7 +3737,7 @@ bool QgsSpatiaLiteProvider::deleteFeatures( const QgsFeatureIds &id ) if ( sqlite3_prepare_v2( sqliteHandle, sql.toUtf8().constData(), -1, &stmt, NULL ) != SQLITE_OK ) { // some error occurred - pushError( tr( "SQLite error: %2\nSQL: %1" ).arg( sql ).arg( sqlite3_errmsg( sqliteHandle ) ) ); + pushError( tr( "SQLite error: %2\nSQL: %1" ).arg( sql, sqlite3_errmsg( sqliteHandle ) ) ); return false; } @@ -3779,7 +3779,7 @@ bool QgsSpatiaLiteProvider::deleteFeatures( const QgsFeatureIds &id ) return true; abort: - pushError( tr( "SQLite error: %2\nSQL: %1" ).arg( sql ).arg( errMsg ? errMsg : tr( "unknown cause" ) ) ); + pushError( tr( "SQLite error: %2\nSQL: %1" ).arg( sql, errMsg ? errMsg : tr( "unknown cause" ) ) ); if ( errMsg ) { sqlite3_free( errMsg ); @@ -3814,9 +3814,9 @@ bool QgsSpatiaLiteProvider::addAttributes( const QList &attributes ) for ( QList::const_iterator iter = attributes.begin(); iter != attributes.end(); ++iter ) { sql = QString( "ALTER TABLE \"%1\" ADD COLUMN \"%2\" %3" ) - .arg( mTableName ) - .arg( iter->name() ) - .arg( iter->typeName() ); + .arg( mTableName, + iter->name(), + iter->typeName() ); ret = sqlite3_exec( sqliteHandle, sql.toUtf8().constData(), NULL, NULL, &errMsg ); if ( ret != SQLITE_OK ) { @@ -3833,8 +3833,8 @@ bool QgsSpatiaLiteProvider::addAttributes( const QList &attributes ) } #ifdef SPATIALITE_VERSION_GE_4_0_0 sql = QString( "UPDATE geometry_columns_statistics set last_verified = 0 WHERE f_table_name=\"%1\" AND f_geometry_column=\"%2\";" ) - .arg( mTableName ) - .arg( mGeometryColumn ); + .arg( mTableName, + mGeometryColumn ); ret = sqlite3_exec( sqliteHandle, sql.toUtf8().constData(), NULL, NULL, &errMsg ); update_layer_statistics( sqliteHandle, mTableName.toUtf8().constData(), mGeometryColumn.toUtf8().constData() ); #elif SPATIALITE_VERSION_G_4_1_1 @@ -3848,7 +3848,7 @@ bool QgsSpatiaLiteProvider::addAttributes( const QList &attributes ) return true; abort: - pushError( tr( "SQLite error: %2\nSQL: %1" ).arg( sql ).arg( errMsg ? errMsg : tr( "unknown cause" ) ) ); + pushError( tr( "SQLite error: %2\nSQL: %1" ).arg( sql, errMsg ? errMsg : tr( "unknown cause" ) ) ); if ( errMsg ) { sqlite3_free( errMsg ); @@ -3921,12 +3921,12 @@ bool QgsSpatiaLiteProvider::changeAttributeValues( const QgsChangedAttributesMap else if ( type == QVariant::Int || type == QVariant::LongLong || type == QVariant::Double ) { // binding a NUMERIC value - sql += QString( "%1=%2" ).arg( quotedIdentifier( fld.name() ) ).arg( val.toString() ); + sql += QString( "%1=%2" ).arg( quotedIdentifier( fld.name() ) , val.toString() ); } else { // binding a TEXT value - sql += QString( "%1=%2" ).arg( quotedIdentifier( fld.name() ) ).arg( quotedValue( val.toString() ) ); + sql += QString( "%1=%2" ).arg( quotedIdentifier( fld.name() ), quotedValue( val.toString() ) ); } } catch ( SLFieldNotFound ) @@ -3954,7 +3954,7 @@ bool QgsSpatiaLiteProvider::changeAttributeValues( const QgsChangedAttributesMap return true; abort: - pushError( tr( "SQLite error: %2\nSQL: %1" ).arg( sql ).arg( errMsg ? errMsg : tr( "unknown cause" ) ) ); + pushError( tr( "SQLite error: %2\nSQL: %1" ).arg( sql, errMsg ? errMsg : tr( "unknown cause" ) ) ); if ( errMsg ) { sqlite3_free( errMsg ); @@ -3986,15 +3986,15 @@ bool QgsSpatiaLiteProvider::changeGeometryValues( QgsGeometryMap & geometry_map sql = QString( "UPDATE %1 SET %2=GeomFromWKB(?, %3) WHERE ROWID = ?" ) - .arg( quotedIdentifier( mTableName ) ) - .arg( quotedIdentifier( mGeometryColumn ) ) + .arg( quotedIdentifier( mTableName ), + quotedIdentifier( mGeometryColumn ) ) .arg( mSrid ); // SQLite prepared statement if ( sqlite3_prepare_v2( sqliteHandle, sql.toUtf8().constData(), -1, &stmt, NULL ) != SQLITE_OK ) { // some error occurred - QgsMessageLog::logMessage( tr( "SQLite error: %2\nSQL: %1" ).arg( sql ).arg( sqlite3_errmsg( sqliteHandle ) ), tr( "SpatiaLite" ) ); + QgsMessageLog::logMessage( tr( "SQLite error: %2\nSQL: %1" ).arg( sql, sqlite3_errmsg( sqliteHandle ) ), tr( "SpatiaLite" ) ); return false; } @@ -4040,7 +4040,7 @@ bool QgsSpatiaLiteProvider::changeGeometryValues( QgsGeometryMap & geometry_map return true; abort: - pushError( tr( "SQLite error: %2\nSQL: %1" ).arg( sql ).arg( errMsg ? errMsg : tr( "unknown cause" ) ) ); + pushError( tr( "SQLite error: %2\nSQL: %1" ).arg( sql, errMsg ? errMsg : tr( "unknown cause" ) ) ); if ( errMsg ) { sqlite3_free( errMsg ); @@ -4174,7 +4174,7 @@ bool QgsSpatiaLiteProvider::checkLayerType() } if ( errMsg ) { - QgsMessageLog::logMessage( tr( "SQLite error: %2\nSQL: %1" ).arg( sql ).arg( errMsg ), tr( "SpatiaLite" ) ); + QgsMessageLog::logMessage( tr( "SQLite error: %2\nSQL: %1" ).arg( sql, errMsg ), tr( "SpatiaLite" ) ); sqlite3_free( errMsg ); errMsg = 0; } @@ -4199,8 +4199,8 @@ bool QgsSpatiaLiteProvider::checkLayerType() // convert the custom query into a subquery mQuery = QString( "%1 as %2" ) - .arg( mQuery ) - .arg( quotedIdentifier( alias ) ); + .arg( mQuery, + quotedIdentifier( alias ) ); sql = QString( "SELECT 0 FROM %1 LIMIT 1" ).arg( mQuery ); ret = sqlite3_get_table( sqliteHandle, sql.toUtf8().constData(), &results, &rows, &columns, &errMsg ); @@ -4212,7 +4212,7 @@ bool QgsSpatiaLiteProvider::checkLayerType() } if ( errMsg ) { - QgsMessageLog::logMessage( tr( "SQLite error: %2\nSQL: %1" ).arg( sql ).arg( errMsg ), tr( "SpatiaLite" ) ); + QgsMessageLog::logMessage( tr( "SQLite error: %2\nSQL: %1" ).arg( sql, errMsg ), tr( "SpatiaLite" ) ); sqlite3_free( errMsg ); errMsg = 0; } @@ -4225,8 +4225,8 @@ bool QgsSpatiaLiteProvider::checkLayerType() "LEFT JOIN geometry_columns_auth " "USING (f_table_name, f_geometry_column) " "WHERE upper(f_table_name) = upper(%1) and upper(f_geometry_column) = upper(%2)" ) - .arg( quotedValue( mTableName ) ) - .arg( quotedValue( mGeometryColumn ) ); + .arg( quotedValue( mTableName ), + quotedValue( mGeometryColumn ) ); ret = sqlite3_get_table( sqliteHandle, sql.toUtf8().constData(), &results, &rows, &columns, &errMsg ); if ( ret != SQLITE_OK ) @@ -4235,8 +4235,8 @@ bool QgsSpatiaLiteProvider::checkLayerType() { sqlite3_free( errMsg ); sql = QString( "SELECT 0 FROM geometry_columns WHERE upper(f_table_name) = upper(%1) and upper(f_geometry_column) = upper(%2)" ) - .arg( quotedValue( mTableName ) ) - .arg( quotedValue( mGeometryColumn ) ); + .arg( quotedValue( mTableName ), + quotedValue( mGeometryColumn ) ); ret = sqlite3_get_table( sqliteHandle, sql.toUtf8().constData(), &results, &rows, &columns, &errMsg ); } } @@ -4256,7 +4256,7 @@ bool QgsSpatiaLiteProvider::checkLayerType() } if ( errMsg ) { - QgsMessageLog::logMessage( tr( "SQLite error: %2\nSQL: %1" ).arg( sql ).arg( errMsg ), tr( "SpatiaLite" ) ); + QgsMessageLog::logMessage( tr( "SQLite error: %2\nSQL: %1" ).arg( sql, errMsg ), tr( "SpatiaLite" ) ); sqlite3_free( errMsg ); errMsg = 0; } @@ -4264,8 +4264,8 @@ bool QgsSpatiaLiteProvider::checkLayerType() // checking if this one is a View-based layer sql = QString( "SELECT view_name, view_geometry FROM views_geometry_columns" - " WHERE view_name=%1 and view_geometry=%2" ).arg( quotedValue( mTableName ) ). - arg( quotedValue( mGeometryColumn ) ); + " WHERE view_name=%1 and view_geometry=%2" ).arg( quotedValue( mTableName ), + quotedValue( mGeometryColumn ) ); ret = sqlite3_get_table( sqliteHandle, sql.toUtf8().constData(), &results, &rows, &columns, &errMsg ); if ( ret == SQLITE_OK && rows == 1 ) @@ -4276,7 +4276,7 @@ bool QgsSpatiaLiteProvider::checkLayerType() } if ( errMsg ) { - QgsMessageLog::logMessage( tr( "SQLite error: %2\nSQL: %1" ).arg( sql ).arg( errMsg ), tr( "SpatiaLite" ) ); + QgsMessageLog::logMessage( tr( "SQLite error: %2\nSQL: %1" ).arg( sql, errMsg ), tr( "SpatiaLite" ) ); sqlite3_free( errMsg ); errMsg = 0; } @@ -4284,8 +4284,8 @@ bool QgsSpatiaLiteProvider::checkLayerType() // checking if this one is a VirtualShapefile-based layer sql = QString( "SELECT virt_name, virt_geometry FROM virts_geometry_columns" - " WHERE virt_name=%1 and virt_geometry=%2" ).arg( quotedValue( mTableName ) ). - arg( quotedValue( mGeometryColumn ) ); + " WHERE virt_name=%1 and virt_geometry=%2" ).arg( quotedValue( mTableName ), + quotedValue( mGeometryColumn ) ); ret = sqlite3_get_table( sqliteHandle, sql.toUtf8().constData(), &results, &rows, &columns, &errMsg ); if ( ret == SQLITE_OK && rows == 1 ) @@ -4296,7 +4296,7 @@ bool QgsSpatiaLiteProvider::checkLayerType() } if ( errMsg ) { - QgsMessageLog::logMessage( tr( "SQLite error: %2\nSQL: %1" ).arg( sql ).arg( errMsg ), tr( "SpatiaLite" ) ); + QgsMessageLog::logMessage( tr( "SQLite error: %2\nSQL: %1" ).arg( sql, errMsg ), tr( "SpatiaLite" ) ); sqlite3_free( errMsg ); errMsg = 0; } @@ -4394,8 +4394,8 @@ void QgsSpatiaLiteProvider::getViewSpatialIndexName() QString sql = QString( "SELECT f_table_name, f_geometry_column " "FROM views_geometry_columns " - "WHERE upper(view_name) = upper(%1) and upper(view_geometry) = upper(%2)" ).arg( quotedValue( mTableName ) ). - arg( quotedValue( mGeometryColumn ) ); + "WHERE upper(view_name) = upper(%1) and upper(view_geometry) = upper(%2)" ).arg( quotedValue( mTableName ), + quotedValue( mGeometryColumn ) ); ret = sqlite3_get_table( sqliteHandle, sql.toUtf8().constData(), &results, &rows, &columns, &errMsg ); if ( ret != SQLITE_OK ) goto error; @@ -4417,7 +4417,7 @@ error: // unexpected error if ( errMsg != NULL ) { - QgsMessageLog::logMessage( tr( "SQLite error: %2\nSQL: %1" ).arg( sql ).arg( errMsg ), tr( "SpatiaLite" ) ); + QgsMessageLog::logMessage( tr( "SQLite error: %2\nSQL: %1" ).arg( sql, errMsg ), tr( "SpatiaLite" ) ); sqlite3_free( errMsg ); } } @@ -4456,8 +4456,8 @@ bool QgsSpatiaLiteProvider::getTableGeometryDetails() mIndexGeometry = mGeometryColumn; QString sql = QString( "SELECT type, srid, spatial_index_enabled, coord_dimension FROM geometry_columns" - " WHERE upper(f_table_name) = upper(%1) and upper(f_geometry_column) = upper(%2)" ).arg( quotedValue( mTableName ) ). - arg( quotedValue( mGeometryColumn ) ); + " WHERE upper(f_table_name) = upper(%1) and upper(f_geometry_column) = upper(%2)" ).arg( quotedValue( mTableName ), + quotedValue( mGeometryColumn ) ); ret = sqlite3_get_table( sqliteHandle, sql.toUtf8().constData(), &results, &rows, &columns, &errMsg ); if ( ret != SQLITE_OK ) @@ -4533,7 +4533,7 @@ bool QgsSpatiaLiteProvider::getTableGeometryDetails() return getSridDetails(); error: - QgsMessageLog::logMessage( tr( "SQLite error: %2\nSQL: %1" ).arg( sql ).arg( errMsg ? errMsg : tr( "unknown cause" ) ), tr( "SpatiaLite" ) ); + QgsMessageLog::logMessage( tr( "SQLite error: %2\nSQL: %1" ).arg( sql, errMsg ? errMsg : tr( "unknown cause" ) ), tr( "SpatiaLite" ) ); // unexpected error if ( errMsg != NULL ) { @@ -4554,8 +4554,8 @@ bool QgsSpatiaLiteProvider::getViewGeometryDetails() QString sql = QString( "SELECT type, srid, spatial_index_enabled, f_table_name, f_geometry_column " " FROM views_geometry_columns" " JOIN geometry_columns USING (f_table_name, f_geometry_column)" - " WHERE upper(view_name) = upper(%1) and upper(view_geometry) = upper(%2)" ).arg( quotedValue( mTableName ) ). - arg( quotedValue( mGeometryColumn ) ); + " WHERE upper(view_name) = upper(%1) and upper(view_geometry) = upper(%2)" ).arg( quotedValue( mTableName ), + quotedValue( mGeometryColumn ) ); ret = sqlite3_get_table( sqliteHandle, sql.toUtf8().constData(), &results, &rows, &columns, &errMsg ); if ( ret != SQLITE_OK ) @@ -4619,7 +4619,7 @@ error: // unexpected error if ( errMsg != NULL ) { - QgsMessageLog::logMessage( tr( "SQLite error: %2\nSQL: %1" ).arg( sql ).arg( errMsg ), tr( "SpatiaLite" ) ); + QgsMessageLog::logMessage( tr( "SQLite error: %2\nSQL: %1" ).arg( sql, errMsg ), tr( "SpatiaLite" ) ); sqlite3_free( errMsg ); } return false; @@ -4635,8 +4635,8 @@ bool QgsSpatiaLiteProvider::getVShapeGeometryDetails() char *errMsg = NULL; QString sql = QString( "SELECT type, srid FROM virts_geometry_columns" - " WHERE virt_name=%1 and virt_geometry=%2" ).arg( quotedValue( mTableName ) ). - arg( quotedValue( mGeometryColumn ) ); + " WHERE virt_name=%1 and virt_geometry=%2" ).arg( quotedValue( mTableName ), + quotedValue( mGeometryColumn ) ); ret = sqlite3_get_table( sqliteHandle, sql.toUtf8().constData(), &results, &rows, &columns, &errMsg ); if ( ret != SQLITE_OK ) @@ -4689,7 +4689,7 @@ error: // unexpected error if ( errMsg != NULL ) { - QgsMessageLog::logMessage( tr( "SQLite error: %2\nSQL: %1" ).arg( sql ).arg( errMsg ), tr( "SpatiaLite" ) ); + QgsMessageLog::logMessage( tr( "SQLite error: %2\nSQL: %1" ).arg( sql, errMsg ), tr( "SpatiaLite" ) ); sqlite3_free( errMsg ); } return false; @@ -4710,8 +4710,8 @@ bool QgsSpatiaLiteProvider::getQueryGeometryDetails() // get stuff from the relevant column instead. This may (will?) // fail if there is no data in the relevant table. QString sql = QString( "select srid(%1), geometrytype(%1) from %2" ) - .arg( quotedIdentifier( mGeometryColumn ) ) - .arg( mQuery ); + .arg( quotedIdentifier( mGeometryColumn ), + mQuery ); //it is possible that the where clause restricts the feature type if ( !mSubsetString.isEmpty() ) @@ -4748,8 +4748,8 @@ bool QgsSpatiaLiteProvider::getQueryGeometryDetails() " when geometrytype(%1) IN ('POLYGON','MULTIPOLYGON') THEN 'POLYGON'" " end " "from %2" ) - .arg( quotedIdentifier( mGeometryColumn ) ) - .arg( mQuery ); + .arg( quotedIdentifier( mGeometryColumn ), + mQuery ); if ( !mSubsetString.isEmpty() ) sql += " where " + mSubsetString; @@ -4805,7 +4805,7 @@ error: // unexpected error if ( errMsg != NULL ) { - QgsMessageLog::logMessage( tr( "SQLite error: %2\nSQL: %1" ).arg( sql ).arg( errMsg ), tr( "SpatiaLite" ) ); + QgsMessageLog::logMessage( tr( "SQLite error: %2\nSQL: %1" ).arg( sql, errMsg ), tr( "SpatiaLite" ) ); sqlite3_free( errMsg ); } return false; @@ -4843,7 +4843,7 @@ error: // unexpected error if ( errMsg != NULL ) { - QgsMessageLog::logMessage( tr( "SQLite error: %2\nSQL: %1" ).arg( sql ).arg( errMsg ), tr( "SpatiaLite" ) ); + QgsMessageLog::logMessage( tr( "SQLite error: %2\nSQL: %1" ).arg( sql, errMsg ), tr( "SpatiaLite" ) ); sqlite3_free( errMsg ); } return false; @@ -4884,8 +4884,8 @@ bool QgsSpatiaLiteProvider::getTableSummary() char *errMsg = NULL; QString sql = QString( "SELECT Count(*)%1 FROM %2" ) - .arg( mGeometryColumn.isEmpty() ? "" : QString( ",Min(MbrMinX(%1)),Min(MbrMinY(%1)),Max(MbrMaxX(%1)),Max(MbrMaxY(%1))" ).arg( quotedIdentifier( mGeometryColumn ) ) ) - .arg( mQuery ); + .arg( mGeometryColumn.isEmpty() ? "" : QString( ",Min(MbrMinX(%1)),Min(MbrMinY(%1)),Max(MbrMaxX(%1)),Max(MbrMaxY(%1))" ).arg( quotedIdentifier( mGeometryColumn ) ), + mQuery ); if ( !mSubsetString.isEmpty() ) { @@ -4926,7 +4926,7 @@ error: // unexpected error if ( errMsg != NULL ) { - QgsMessageLog::logMessage( tr( "SQLite error: %2\nSQL: %1" ).arg( sql ).arg( errMsg ), tr( "SpatiaLite" ) ); + QgsMessageLog::logMessage( tr( "SQLite error: %2\nSQL: %1" ).arg( sql, errMsg ), tr( "SpatiaLite" ) ); sqlite3_free( errMsg ); } return false; @@ -5330,7 +5330,7 @@ QGISEXTERN bool saveStyle( const QString& uri, const QString& qmlStyle, const QS .arg( QgsSpatiaLiteProvider::quotedValue( dsUri.schema() ) ) .arg( QgsSpatiaLiteProvider::quotedValue( dsUri.table() ) ) .arg( QgsSpatiaLiteProvider::quotedValue( dsUri.geometryColumn() ) ); - sql = QString( "BEGIN; %1; %2; COMMIT;" ).arg( removeDefaultSql ).arg( sql ); + sql = QString( "BEGIN; %1; %2; COMMIT;" ).arg( removeDefaultSql, sql ); } ret = sqlite3_exec( sqliteHandle, sql.toUtf8().constData(), NULL, NULL, &errMsg ); diff --git a/src/providers/spatialite/qgsspatialitesourceselect.cpp b/src/providers/spatialite/qgsspatialitesourceselect.cpp index 780afca7d34..772248932c6 100644 --- a/src/providers/spatialite/qgsspatialitesourceselect.cpp +++ b/src/providers/spatialite/qgsspatialitesourceselect.cpp @@ -448,15 +448,15 @@ void QgsSpatiaLiteSourceSelect::on_btnConnect_clicked() break; case QgsSpatiaLiteConnection::FailedToOpen: QMessageBox::critical( this, tr( "SpatiaLite DB Open Error" ), - tr( "Failure while connecting to: %1\n\n%2" ).arg( mSqlitePath ).arg( errCause ) ); + tr( "Failure while connecting to: %1\n\n%2" ).arg( mSqlitePath, errCause ) ); break; case QgsSpatiaLiteConnection::FailedToGetTables: QMessageBox::critical( this, tr( "SpatiaLite getTableInfo Error" ), - tr( "Failure exploring tables from: %1\n\n%2" ).arg( mSqlitePath ).arg( errCause ) ); + tr( "Failure exploring tables from: %1\n\n%2" ).arg( mSqlitePath, errCause ) ); break; default: QMessageBox::critical( this, tr( "SpatiaLite Error" ), - tr( "Unexpected error when working with: %1\n\n%2" ).arg( mSqlitePath ).arg( errCause ) ); + tr( "Unexpected error when working with: %1\n\n%2" ).arg( mSqlitePath, errCause ) ); } mSqlitePath = QString(); return; diff --git a/src/providers/wcs/qgswcscapabilities.cpp b/src/providers/wcs/qgswcscapabilities.cpp index 296c3888c2c..e21d5770442 100644 --- a/src/providers/wcs/qgswcscapabilities.cpp +++ b/src/providers/wcs/qgswcscapabilities.cpp @@ -468,9 +468,9 @@ bool QgsWcsCapabilities::parseCapabilitiesDom( QByteArray const &xml, QgsWcsCapa mErrorTitle = tr( "Dom Exception" ); mErrorFormat = "text/plain"; mError = tr( "Could not get WCS capabilities in the expected format (DTD): no %1 found.\nThis might be due to an incorrect WCS Server URL.\nTag:%3\nResponse was:\n%4" ) - .arg( "Capabilities" ) - .arg( docElem.tagName() ) - .arg( QString( xml ) ); + .arg( "Capabilities", + docElem.tagName(), + QString( xml ) ); } QgsLogger::debug( "Dom Exception: " + mError ); @@ -775,9 +775,9 @@ bool QgsWcsCapabilities::parseDescribeCoverageDom10( QByteArray const &xml, QgsW mErrorTitle = tr( "Dom Exception" ); mErrorFormat = "text/plain"; mError = tr( "Could not get WCS capabilities in the expected format (DTD): no %1 found.\nThis might be due to an incorrect WCS Server URL.\nTag:%3\nResponse was:\n%4" ) - .arg( "CoverageDescription" ) - .arg( docElem.tagName() ) - .arg( QString( xml ) ); + .arg( "CoverageDescription", + docElem.tagName(), + QString( xml ) ); QgsLogger::debug( "Dom Exception: " + mError ); @@ -930,9 +930,9 @@ bool QgsWcsCapabilities::parseDescribeCoverageDom11( QByteArray const &xml, QgsW mErrorTitle = tr( "Dom Exception" ); mErrorFormat = "text/plain"; mError = tr( "Could not get WCS capabilities in the expected format (DTD): no %1 found.\nThis might be due to an incorrect WCS Server URL.\nTag:%3\nResponse was:\n%4" ) - .arg( "CoverageDescriptions" ) - .arg( docElem.tagName() ) - .arg( QString( xml ) ); + .arg( "CoverageDescriptions", + docElem.tagName(), + QString( xml ) ); QgsLogger::debug( "Dom Exception: " + mError ); @@ -1184,7 +1184,7 @@ bool QgsWcsCapabilities::setAuthorization( QNetworkRequest &request ) const else if ( mUri.hasParam( "username" ) && mUri.hasParam( "password" ) ) { QgsDebugMsg( "setAuthorization " + mUri.param( "username" ) ); - request.setRawHeader( "Authorization", "Basic " + QString( "%1:%2" ).arg( mUri.param( "username" ) ).arg( mUri.param( "password" ) ).toAscii().toBase64() ); + request.setRawHeader( "Authorization", "Basic " + QString( "%1:%2" ).arg( mUri.param( "username" ), mUri.param( "password" ) ).toAscii().toBase64() ); } return true; } diff --git a/src/providers/wcs/qgswcsprovider.cpp b/src/providers/wcs/qgswcsprovider.cpp index 20b688acb25..550c80e7f04 100644 --- a/src/providers/wcs/qgswcsprovider.cpp +++ b/src/providers/wcs/qgswcsprovider.cpp @@ -568,7 +568,7 @@ void QgsWcsProvider::readBlock( int bandNo, QgsRectangle const & viewExtent, in !qgsDoubleNearSig( cacheExtent.yMaximum(), viewExtent.yMaximum(), 10 ) ) { QgsDebugMsg( "cacheExtent and viewExtent differ" ); - QgsMessageLog::logMessage( tr( "Received coverage has wrong extent %1 (expected %2)" ).arg( cacheExtent.toString() ).arg( viewExtent.toString() ), tr( "WCS" ) ); + QgsMessageLog::logMessage( tr( "Received coverage has wrong extent %1 (expected %2)" ).arg( cacheExtent.toString(), viewExtent.toString() ), tr( "WCS" ) ); // We are doing all possible to avoid this situation, // If it happens, it would be possible to rescale the portion we get // to only part of the data block, but it is better to left it @@ -677,10 +677,10 @@ void QgsWcsProvider::getCache( int bandNo, QgsRectangle const & viewExtent, int // Bounding box in WCS format (Warning: does not work with scientific notation) QString bbox = QString( changeXY ? "%2,%1,%4,%3" : "%1,%2,%3,%4" ) - .arg( qgsDoubleToString( extent.xMinimum() ) ) - .arg( qgsDoubleToString( extent.yMinimum() ) ) - .arg( qgsDoubleToString( extent.xMaximum() ) ) - .arg( qgsDoubleToString( extent.yMaximum() ) ); + .arg( qgsDoubleToString( extent.xMinimum() ), + qgsDoubleToString( extent.yMinimum() ), + qgsDoubleToString( extent.xMaximum() ), + qgsDoubleToString( extent.yMaximum() ) ); QUrl url( mIgnoreGetCoverageUrl ? mBaseUrl : mCapabilities.getCoverageUrl() ); @@ -715,7 +715,7 @@ void QgsWcsProvider::getCache( int bandNo, QgsRectangle const & viewExtent, int if ( mCapabilities.version().startsWith( "1.1" ) ) { setQueryItem( url, "IDENTIFIER", mIdentifier ); - QString crsUrn = QString( "urn:ogc:def:crs:%1::%2" ).arg( crs.split( ':' ).value( 0 ) ).arg( crs.split( ':' ).value( 1 ) ); + QString crsUrn = QString( "urn:ogc:def:crs:%1::%2" ).arg( crs.split( ':' ).value( 0 ), crs.split( ':' ).value( 1 ) ); bbox += "," + crsUrn; if ( !mTime.isEmpty() ) @@ -744,8 +744,8 @@ void QgsWcsProvider::getCache( int bandNo, QgsRectangle const & viewExtent, int // Mapserver 6.0.3 does not work with origin on yMinimum (lower left) // Geoserver works OK with yMinimum (lower left) QString gridOrigin = QString( changeXY ? "%2,%1" : "%1,%2" ) - .arg( qgsDoubleToString( extent.xMinimum() ) ) - .arg( qgsDoubleToString( extent.yMaximum() ) ); + .arg( qgsDoubleToString( extent.xMinimum() ), + qgsDoubleToString( extent.yMaximum() ) ); setQueryItem( url, "GRIDORIGIN", gridOrigin ); // GridOffsets WCS 1.1: @@ -764,8 +764,8 @@ void QgsWcsProvider::getCache( int bandNo, QgsRectangle const & viewExtent, int QString gridOffsets = QString( changeXY ? "%2,%1" : "%1,%2" ) //setQueryItem( url, "GRIDTYPE", "urn:ogc:def:method:WCS:1.1:2dGridIn2dCrs" ); //QString gridOffsets = QString( changeXY ? "%2,0,0,%1" : "%1,0,0,%2" ) - .arg( qgsDoubleToString( xRes ) ) - .arg( qgsDoubleToString( yOff ) ); + .arg( qgsDoubleToString( xRes ), + qgsDoubleToString( yOff ) ); setQueryItem( url, "GRIDOFFSETS", gridOffsets ); } @@ -1743,8 +1743,8 @@ void QgsWcsDownloadHandler::cacheReplyFinished() QgsMessageLog::logMessage( tr( "Map request error (Status: %1; Reason phrase: %2; URL:%3)" ) .arg( status.toInt() ) - .arg( phrase.toString() ) - .arg( mCacheReply->url().toString() ), tr( "WCS" ) ); + .arg( phrase.toString(), + mCacheReply->url().toString() ), tr( "WCS" ) ); mCacheReply->deleteLater(); mCacheReply = 0; @@ -1774,15 +1774,15 @@ void QgsWcsDownloadHandler::cacheReplyFinished() && QgsWcsProvider::parseServiceExceptionReportDom( text, mWcsVersion, errorTitle, errorText ) ) { mCachedError.append( SRVERR( tr( "Map request error:
Title: %1
Error: %2
URL: %3)" ) - .arg( errorTitle ).arg( errorText ) - .arg( mCacheReply->url().toString() ) ) ); + .arg( errorTitle, errorText, + mCacheReply->url().toString() ) ) ); } else { QgsMessageLog::logMessage( tr( "Map request error (Status: %1; Response: %2; URL:%3)" ) .arg( status.toInt() ) - .arg( QString::fromUtf8( text ) ) - .arg( mCacheReply->url().toString() ), tr( "WCS" ) ); + .arg( QString::fromUtf8( text ), + mCacheReply->url().toString() ), tr( "WCS" ) ); } mCacheReply->deleteLater(); @@ -1836,14 +1836,14 @@ void QgsWcsDownloadHandler::cacheReplyFinished() if ( QgsWcsProvider::parseServiceExceptionReportDom( body, mWcsVersion, errorTitle, errorText ) ) { QgsMessageLog::logMessage( tr( "Map request error (Title:%1; Error:%2; URL: %3)" ) - .arg( errorTitle ).arg( errorText ) - .arg( mCacheReply->url().toString() ), tr( "WCS" ) ); + .arg( errorTitle, errorText, + mCacheReply->url().toString() ), tr( "WCS" ) ); } else { QgsMessageLog::logMessage( tr( "Map request error (Response: %1; URL:%2)" ) - .arg( QString::fromUtf8( body ) ) - .arg( mCacheReply->url().toString() ), tr( "WCS" ) ); + .arg( QString::fromUtf8( body ), + mCacheReply->url().toString() ), tr( "WCS" ) ); } mCacheReply->deleteLater(); @@ -1902,7 +1902,7 @@ void QgsWcsDownloadHandler::cacheReplyFinished() sErrors++; if ( sErrors < 100 ) { - QgsMessageLog::logMessage( tr( "Map request failed [error:%1 url:%2]" ).arg( mCacheReply->errorString() ).arg( mCacheReply->url().toString() ), tr( "WCS" ) ); + QgsMessageLog::logMessage( tr( "Map request failed [error:%1 url:%2]" ).arg( mCacheReply->errorString(), mCacheReply->url().toString() ), tr( "WCS" ) ); } else if ( sErrors == 100 ) { diff --git a/src/providers/wcs/qgswcsprovider.h b/src/providers/wcs/qgswcsprovider.h index dfed6f3663a..6d54ae26556 100644 --- a/src/providers/wcs/qgswcsprovider.h +++ b/src/providers/wcs/qgswcsprovider.h @@ -66,7 +66,7 @@ struct QgsWcsAuthorization } else if ( !mUserName.isNull() || !mPassword.isNull() ) { - request.setRawHeader( "Authorization", "Basic " + QString( "%1:%2" ).arg( mUserName ).arg( mPassword ).toAscii().toBase64() ); + request.setRawHeader( "Authorization", "Basic " + QString( "%1:%2" ).arg( mUserName, mPassword ).toAscii().toBase64() ); } return true; } diff --git a/src/providers/wfs/qgswfscapabilities.cpp b/src/providers/wfs/qgswfscapabilities.cpp index a2063583c8d..a19ef3851a1 100644 --- a/src/providers/wfs/qgswfscapabilities.cpp +++ b/src/providers/wfs/qgswfscapabilities.cpp @@ -125,10 +125,10 @@ QString QgsWFSCapabilities::uriGetFeature( QString typeName, QString crsString, if ( !bBox.isEmpty() ) { bBoxString = QString( "&BBOX=%1,%2,%3,%4" ) - .arg( qgsDoubleToString( bBox.xMinimum() ) ) - .arg( qgsDoubleToString( bBox.yMinimum() ) ) - .arg( qgsDoubleToString( bBox.xMaximum() ) ) - .arg( qgsDoubleToString( bBox.yMaximum() ) ); + .arg( qgsDoubleToString( bBox.xMinimum() ), + qgsDoubleToString( bBox.yMinimum() ), + qgsDoubleToString( bBox.xMaximum() ), + qgsDoubleToString( bBox.yMaximum() ) ); } QString uri = mBaseUrl; @@ -160,7 +160,7 @@ bool QgsWFSCapabilities::setAuthorization( QNetworkRequest &request ) const else if ( mUri.hasParam( "username" ) && mUri.hasParam( "password" ) ) { QgsDebugMsg( "setAuthorization " + mUri.param( "username" ) ); - request.setRawHeader( "Authorization", "Basic " + QString( "%1:%2" ).arg( mUri.param( "username" ) ).arg( mUri.param( "password" ) ).toAscii().toBase64() ); + request.setRawHeader( "Authorization", "Basic " + QString( "%1:%2" ).arg( mUri.param( "username" ), mUri.param( "password" ) ).toAscii().toBase64() ); } return true; } diff --git a/src/providers/wfs/qgswfsprovider.cpp b/src/providers/wfs/qgswfsprovider.cpp index 06734fd322a..f5f02d25d6d 100644 --- a/src/providers/wfs/qgswfsprovider.cpp +++ b/src/providers/wfs/qgswfsprovider.cpp @@ -1220,7 +1220,7 @@ int QgsWFSProvider::getFeaturesFromGML2( const QDomElement& wfsCollectionElement } const QgsField &fld = mFields[attr]; - QgsDebugMsg( QString( "set attribute %1: type=%2 value=%3" ).arg( attr ).arg( QVariant::typeToName( fld.type() ) ).arg( currentAttributeElement.text() ) ); + QgsDebugMsg( QString( "set attribute %1: type=%2 value=%3" ).arg( attr ).arg( QVariant::typeToName( fld.type() ), currentAttributeElement.text() ) ); f->setAttribute( attr, convertValue( fld.type(), currentAttributeElement.text() ) ); } else //a geometry attribute @@ -1704,8 +1704,8 @@ void QgsWFSProvider::handleException( const QDomDocument& serverResponse ) { QDomElement exception = exceptionElem.firstChildElement( "Exception" ); pushError( tr( "WFS exception report (code=%1 text=%2)" ) - .arg( exception.attribute( "exceptionCode", tr( "missing" ) ) ) - .arg( exception.firstChildElement( "ExceptionText" ).text() ) + .arg( exception.attribute( "exceptionCode", tr( "missing" ) ), + exception.firstChildElement( "ExceptionText" ).text() ) ); return; } @@ -1741,10 +1741,10 @@ void QgsWFSProvider::extendExtent( const QgsRectangle &extent ) setDataSourceUri( dataSourceUri().replace( QRegExp( "BBOX=[^&]*" ), QString( "BBOX=%1,%2,%3,%4" ) - .arg( qgsDoubleToString( mGetExtent.xMinimum() ) ) - .arg( qgsDoubleToString( mGetExtent.yMinimum() ) ) - .arg( qgsDoubleToString( mGetExtent.xMaximum() ) ) - .arg( qgsDoubleToString( mGetExtent.yMaximum() ) ) ) ); + .arg( qgsDoubleToString( mGetExtent.xMinimum() ), + qgsDoubleToString( mGetExtent.yMinimum() ), + qgsDoubleToString( mGetExtent.xMaximum() ), + qgsDoubleToString( mGetExtent.yMaximum() ) ) ) ); if ( !mPendingRetrieval ) { diff --git a/src/providers/wfs/qgswfsprovider.h b/src/providers/wfs/qgswfsprovider.h index dbb88fabd40..801231b5c7d 100644 --- a/src/providers/wfs/qgswfsprovider.h +++ b/src/providers/wfs/qgswfsprovider.h @@ -51,7 +51,7 @@ struct QgsWFSAuthorization } else if ( !mUserName.isNull() || !mPassword.isNull() ) { - request.setRawHeader( "Authorization", "Basic " + QString( "%1:%2" ).arg( mUserName ).arg( mPassword ).toAscii().toBase64() ); + request.setRawHeader( "Authorization", "Basic " + QString( "%1:%2" ).arg( mUserName, mPassword ).toAscii().toBase64() ); } return true; } diff --git a/src/providers/wms/qgswmscapabilities.cpp b/src/providers/wms/qgswmscapabilities.cpp index a1de2545a6f..f9d6281a02d 100644 --- a/src/providers/wms/qgswmscapabilities.cpp +++ b/src/providers/wms/qgswmscapabilities.cpp @@ -245,10 +245,10 @@ bool QgsWmsCapabilities::parseCapabilitiesDom( QByteArray const &xml, QgsWmsCapa mErrorCaption = QObject::tr( "Dom Exception" ); mErrorFormat = "text/plain"; mError = QObject::tr( "Could not get WMS capabilities in the expected format (DTD): no %1 or %2 found.\nThis might be due to an incorrect WMS Server URL.\nTag:%3\nResponse was:\n%4" ) - .arg( "WMS_Capabilities" ) - .arg( "WMT_MS_Capabilities" ) - .arg( docElem.tagName() ) - .arg( QString( xml ) ); + .arg( "WMS_Capabilities", + "WMT_MS_Capabilities", + docElem.tagName(), + QString( xml ) ); QgsLogger::debug( "Dom Exception: " + mError ); @@ -1296,9 +1296,9 @@ void QgsWmsCapabilities::parseWMTSContents( QDomElement const &e ) invert = !invert; QgsDebugMsg( QString( "tilematrix set: %1 (supportedCRS:%2 crs:%3; metersPerUnit:%4 axisInverted:%5)" ) - .arg( s.identifier ) - .arg( supportedCRS ) - .arg( s.crs ) + .arg( s.identifier, + supportedCRS, + s.crs ) .arg( metersPerUnit, 0, 'f' ) .arg( invert ? "yes" : "no" ) ); @@ -1629,9 +1629,9 @@ void QgsWmsCapabilities::parseWMTSContents( QDomElement const &e ) if ( format.isEmpty() || resourceType.isEmpty() || tmpl.isEmpty() ) { QgsDebugMsg( QString( "SKIPPING ResourceURL format=%1 resourceType=%2 template=%3" ) - .arg( format ) - .arg( resourceType ) - .arg( tmpl ) ); + .arg( format, + resourceType, + tmpl ) ); continue; } @@ -1673,9 +1673,9 @@ void QgsWmsCapabilities::parseWMTSContents( QDomElement const &e ) else { QgsDebugMsg( QString( "UNEXPECTED resourceType in ResourcURL format=%1 resourceType=%2 template=%3" ) - .arg( format ) - .arg( resourceType ) - .arg( tmpl ) ); + .arg( format, + resourceType, + tmpl ) ); } } @@ -1800,7 +1800,7 @@ bool QgsWmsCapabilities::detectTileLayerBoundingBox( QgsWmtsTileLayer& l ) tm.topLeft.y() - res * tm.tileHeight * tm.matrixHeight ); QgsDebugMsg( QString( "detecting WMTS layer bounding box: tileset %1 matrix %2 crs %3 res %4" ) - .arg( tmsIt->identifier ).arg( tm.identifier ).arg( tmsIt->crs ).arg( res ) ); + .arg( tmsIt->identifier, tm.identifier, tmsIt->crs ).arg( res ) ); QgsRectangle extent( tm.topLeft, bottomRight ); extent.normalize(); diff --git a/src/providers/wms/qgswmscapabilities.h b/src/providers/wms/qgswmscapabilities.h index 1e53f8e7943..0c5a7063bbe 100644 --- a/src/providers/wms/qgswmscapabilities.h +++ b/src/providers/wms/qgswmscapabilities.h @@ -446,7 +446,7 @@ struct QgsWmsAuthorization } else if ( !mUserName.isNull() || !mPassword.isNull() ) { - request.setRawHeader( "Authorization", "Basic " + QString( "%1:%2" ).arg( mUserName ).arg( mPassword ).toAscii().toBase64() ); + request.setRawHeader( "Authorization", "Basic " + QString( "%1:%2" ).arg( mUserName, mPassword ).toAscii().toBase64() ); } if ( !mReferer.isNull() ) diff --git a/src/providers/wms/qgswmsprovider.cpp b/src/providers/wms/qgswmsprovider.cpp index 42fb900e712..b744697c9a4 100644 --- a/src/providers/wms/qgswmsprovider.cpp +++ b/src/providers/wms/qgswmsprovider.cpp @@ -391,7 +391,7 @@ bool QgsWmsProvider::setImageCrs( QString const & crs ) if ( mCaps.mTileMatrixSets[ tms ].crs != mImageCrs ) { - QgsDebugMsg( QString( "tile matrix set '%1' has crs %2 instead of %3." ).arg( tms ).arg( mCaps.mTileMatrixSets[ tms ].crs ).arg( mImageCrs ) ); + QgsDebugMsg( QString( "tile matrix set '%1' has crs %2 instead of %3." ).arg( tms, mCaps.mTileMatrixSets[ tms ].crs, mImageCrs ) ); continue; } @@ -619,15 +619,15 @@ QImage *QgsWmsProvider::draw( QgsRectangle const &viewExtent, int pixelWidth, in } QgsDebugMsg( QString( "layer extent: %1,%2 %3x%4" ) - .arg( qgsDoubleToString( mLayerExtent.xMinimum() ) ) - .arg( qgsDoubleToString( mLayerExtent.yMinimum() ) ) + .arg( qgsDoubleToString( mLayerExtent.xMinimum() ), + qgsDoubleToString( mLayerExtent.yMinimum() ) ) .arg( mLayerExtent.width() ) .arg( mLayerExtent.height() ) ); QgsDebugMsg( QString( "view extent: %1,%2 %3x%4 res:%5" ) - .arg( qgsDoubleToString( viewExtent.xMinimum() ) ) - .arg( qgsDoubleToString( viewExtent.yMinimum() ) ) + .arg( qgsDoubleToString( viewExtent.xMinimum() ), + qgsDoubleToString( viewExtent.yMinimum() ) ) .arg( viewExtent.width() ) .arg( viewExtent.height() ) .arg( vres, 0, 'f' ) @@ -643,7 +643,7 @@ QImage *QgsWmsProvider::draw( QgsRectangle const &viewExtent, int pixelWidth, in // calculate tile coordinates double twMap = tm->tileWidth * tres; double thMap = tm->tileHeight * tres; - QgsDebugMsg( QString( "tile map size: %1,%2" ).arg( qgsDoubleToString( twMap ) ).arg( qgsDoubleToString( thMap ) ) ); + QgsDebugMsg( QString( "tile map size: %1,%2" ).arg( qgsDoubleToString( twMap ), qgsDoubleToString( thMap ) ) ); int minTileCol = 0; int maxTileCol = tm->matrixWidth - 1; @@ -661,8 +661,8 @@ QImage *QgsWmsProvider::draw( QgsRectangle const &viewExtent, int pixelWidth, in minTileRow = tml.minTileRow; maxTileRow = tml.maxTileRow; QgsDebugMsg( QString( "%1 %2: TileMatrixLimits col %3-%4 row %5-%6" ) - .arg( mTileMatrixSet->identifier ) - .arg( tm->identifier ) + .arg( mTileMatrixSet->identifier, + tm->identifier ) .arg( minTileCol ).arg( maxTileCol ) .arg( minTileRow ).arg( maxTileRow ) ); } @@ -731,10 +731,10 @@ QImage *QgsWmsProvider::draw( QgsRectangle const &viewExtent, int pixelWidth, in QString turl; turl += url.toString(); turl += QString( changeXY ? "&BBOX=%2,%1,%4,%3" : "&BBOX=%1,%2,%3,%4" ) - .arg( qgsDoubleToString( tm->topLeft.x() + col * twMap /* + twMap * 0.001 */ ) ) - .arg( qgsDoubleToString( tm->topLeft.y() - ( row + 1 ) * thMap /* - thMap * 0.001 */ ) ) - .arg( qgsDoubleToString( tm->topLeft.x() + ( col + 1 ) * twMap /* - twMap * 0.001 */ ) ) - .arg( qgsDoubleToString( tm->topLeft.y() - row * thMap /* + thMap * 0.001 */ ) ); + .arg( qgsDoubleToString( tm->topLeft.x() + col * twMap /* + twMap * 0.001 */ ), + qgsDoubleToString( tm->topLeft.y() - ( row + 1 ) * thMap /* - thMap * 0.001 */ ), + qgsDoubleToString( tm->topLeft.x() + ( col + 1 ) * twMap /* - twMap * 0.001 */ ), + qgsDoubleToString( tm->topLeft.y() - row * thMap /* + thMap * 0.001 */ ) ); QgsDebugMsg( QString( "tileRequest %1 %2/%3 (%4,%5): %6" ).arg( mTileReqNo ).arg( i++ ).arg( n ).arg( row ).arg( col ).arg( turl ) ); QRectF rect( tm->topLeft.x() + col * twMap, tm->topLeft.y() - ( row + 1 ) * thMap, twMap, thMap ); @@ -1200,7 +1200,7 @@ bool QgsWmsProvider::calculateExtent() { int i; for ( i = 0; i < mTileLayer->boundingBoxes.size() && mTileLayer->boundingBoxes[i].crs != mImageCrs; i++ ) - QgsDebugMsg( QString( "Skip %1 [%2]" ).arg( mTileLayer->boundingBoxes[i].crs ).arg( mImageCrs ) ); + QgsDebugMsg( QString( "Skip %1 [%2]" ).arg( mTileLayer->boundingBoxes[i].crs, mImageCrs ) ); if ( i < mTileLayer->boundingBoxes.size() ) { @@ -1219,7 +1219,7 @@ bool QgsWmsProvider::calculateExtent() QgsCoordinateTransform ct( qgisSrsSource, qgisSrsDest ); - QgsDebugMsg( QString( "ct: %1 => %2" ).arg( mTileLayer->boundingBoxes[i].crs ).arg( mImageCrs ) ); + QgsDebugMsg( QString( "ct: %1 => %2" ).arg( mTileLayer->boundingBoxes[i].crs, mImageCrs ) ); try { @@ -1685,7 +1685,7 @@ QString QgsWmsProvider::metadata() it != mTileLayer->getTileURLs.constEnd(); ++it ) { - metadata += QString( "%1:%2
" ).arg( it.key() ).arg( it.value() ); + metadata += QString( "%1:%2
" ).arg( it.key(), it.value() ); } metadata += ""; @@ -1697,7 +1697,7 @@ QString QgsWmsProvider::metadata() it != mTileLayer->getFeatureInfoURLs.constEnd(); ++it ) { - metadata += QString( "%1:%2
" ).arg( it.key() ).arg( it.value() ); + metadata += QString( "%1:%2
" ).arg( it.key(), it.value() ); } metadata += ""; } @@ -1901,16 +1901,20 @@ QString QgsWmsProvider::metadata() "%13" "%14" "" ) - .arg( tr( "Selected tile matrix set " ) ).arg( mSettings.mTileMatrixSetId ) - .arg( tr( "Scale" ) ) - .arg( tr( "Tile size [px]" ) ) - .arg( tr( "Tile size [mu]" ) ) - .arg( tr( "Matrix size" ) ) - .arg( tr( "Matrix extent [mu]" ) ) - .arg( tr( "Bounds" ) ) - .arg( tr( "Width" ) ).arg( tr( "Height" ) ) - .arg( tr( "Top" ) ).arg( tr( "Left" ) ) - .arg( tr( "Bottom" ) ).arg( tr( "Right" ) ); + .arg( tr( "Selected tile matrix set " ), + mSettings.mTileMatrixSetId, + tr( "Scale" ), + tr( "Tile size [px]" ), + tr( "Tile size [mu]" ), + tr( "Matrix size" ), + tr( "Matrix extent [mu]" ) ) + .arg( tr( "Bounds" ), + tr( "Width" ), + tr( "Height" ), + tr( "Top" ), + tr( "Left" ), + tr( "Bottom" ), + tr( "Right" ) ); Q_FOREACH ( const QVariant& res, property( "resolutions" ).toList() ) { @@ -1940,8 +1944,8 @@ QString QgsWmsProvider::metadata() if ( mLayerExtent.yMaximum() > r.yMaximum() ) { metadata += QString( "%2\">%3" ) - .arg( tr( "%n missing row(s)", 0, ( int ) ceil(( mLayerExtent.yMaximum() - r.yMaximum() ) / th ) ) ) - .arg( tr( "Layer's upper bound: %1" ).arg( mLayerExtent.yMaximum(), 0, 'f' ) ) + .arg( tr( "%n missing row(s)", 0, ( int ) ceil(( mLayerExtent.yMaximum() - r.yMaximum() ) / th ) ), + tr( "Layer's upper bound: %1" ).arg( mLayerExtent.yMaximum(), 0, 'f' ) ) .arg( r.yMaximum(), 0, 'f' ); } else @@ -1953,8 +1957,8 @@ QString QgsWmsProvider::metadata() if ( mLayerExtent.xMinimum() < r.xMinimum() ) { metadata += QString( "%2\">%3" ) - .arg( tr( "%n missing column(s)", 0, ( int ) ceil(( r.xMinimum() - mLayerExtent.xMinimum() ) / tw ) ) ) - .arg( tr( "Layer's left bound: %1" ).arg( mLayerExtent.xMinimum(), 0, 'f' ) ) + .arg( tr( "%n missing column(s)", 0, ( int ) ceil(( r.xMinimum() - mLayerExtent.xMinimum() ) / tw ) ), + tr( "Layer's left bound: %1" ).arg( mLayerExtent.xMinimum(), 0, 'f' ) ) .arg( r.xMinimum(), 0, 'f' ); } else @@ -1966,8 +1970,8 @@ QString QgsWmsProvider::metadata() if ( mLayerExtent.yMaximum() > r.yMaximum() ) { metadata += QString( "%2\">%3" ) - .arg( tr( "%n missing row(s)", 0, ( int ) ceil(( mLayerExtent.yMaximum() - r.yMaximum() ) / th ) ) ) - .arg( tr( "Layer's lower bound: %1" ).arg( mLayerExtent.yMaximum(), 0, 'f' ) ) + .arg( tr( "%n missing row(s)", 0, ( int ) ceil(( mLayerExtent.yMaximum() - r.yMaximum() ) / th ) ), + tr( "Layer's lower bound: %1" ).arg( mLayerExtent.yMaximum(), 0, 'f' ) ) .arg( r.yMaximum(), 0, 'f' ); } else @@ -1979,8 +1983,8 @@ QString QgsWmsProvider::metadata() if ( mLayerExtent.xMaximum() > r.xMaximum() ) { metadata += QString( "%2\">%3" ) - .arg( tr( "%n missing column(s)", 0, ( int ) ceil(( mLayerExtent.xMaximum() - r.xMaximum() ) / tw ) ) ) - .arg( tr( "Layer's right bound: %1" ).arg( mLayerExtent.xMaximum(), 0, 'f' ) ) + .arg( tr( "%n missing column(s)", 0, ( int ) ceil(( mLayerExtent.xMaximum() - r.xMaximum() ) / tw ) ), + tr( "Layer's right bound: %1" ).arg( mLayerExtent.xMaximum(), 0, 'f' ) ) .arg( r.xMaximum(), 0, 'f' ); } else @@ -2156,10 +2160,10 @@ QgsRasterIdentifyResult QgsWmsProvider::identify( const QgsPoint & thePoint, Qgs // Compose request to WMS server QString bbox = QString( changeXY ? "%2,%1,%4,%3" : "%1,%2,%3,%4" ) - .arg( qgsDoubleToString( myExtent.xMinimum() ) ) - .arg( qgsDoubleToString( myExtent.yMinimum() ) ) - .arg( qgsDoubleToString( myExtent.xMaximum() ) ) - .arg( qgsDoubleToString( myExtent.yMaximum() ) ); + .arg( qgsDoubleToString( myExtent.xMinimum() ), + qgsDoubleToString( myExtent.yMinimum() ), + qgsDoubleToString( myExtent.xMaximum() ), + qgsDoubleToString( myExtent.yMaximum() ) ); //QgsFeatureList featureList; @@ -2261,15 +2265,15 @@ QgsRasterIdentifyResult QgsWmsProvider::identify( const QgsPoint & thePoint, Qgs tm = &it.value(); QgsDebugMsg( QString( "layer extent: %1,%2 %3x%4" ) - .arg( qgsDoubleToString( mLayerExtent.xMinimum() ) ) - .arg( qgsDoubleToString( mLayerExtent.yMinimum() ) ) + .arg( qgsDoubleToString( mLayerExtent.xMinimum() ), + qgsDoubleToString( mLayerExtent.yMinimum() ) ) .arg( mLayerExtent.width() ) .arg( mLayerExtent.height() ) ); QgsDebugMsg( QString( "view extent: %1,%2 %3x%4 res:%5" ) - .arg( qgsDoubleToString( theExtent.xMinimum() ) ) - .arg( qgsDoubleToString( theExtent.yMinimum() ) ) + .arg( qgsDoubleToString( theExtent.xMinimum() ), + qgsDoubleToString( theExtent.yMinimum() ) ) .arg( theExtent.width() ) .arg( theExtent.height() ) .arg( vres, 0, 'f' ) @@ -2285,7 +2289,7 @@ QgsRasterIdentifyResult QgsWmsProvider::identify( const QgsPoint & thePoint, Qgs // calculate tile coordinates double twMap = tm->tileWidth * tres; double thMap = tm->tileHeight * tres; - QgsDebugMsg( QString( "tile map size: %1,%2" ).arg( qgsDoubleToString( twMap ) ).arg( qgsDoubleToString( thMap ) ) ); + QgsDebugMsg( QString( "tile map size: %1,%2" ).arg( qgsDoubleToString( twMap ), qgsDoubleToString( thMap ) ) ); int col = ( int ) floor(( thePoint.x() - tm->topLeft.x() ) / twMap ); int row = ( int ) floor(( tm->topLeft.y() - thePoint.y() ) / thMap ); @@ -2402,8 +2406,8 @@ QgsRasterIdentifyResult QgsWmsProvider::identify( const QgsPoint & thePoint, Qgs if ( isXml && parseServiceExceptionReportDom( body, mErrorCaption, mError ) ) { QgsMessageLog::logMessage( tr( "Get feature info request error (Title:%1; Error:%2; URL: %3)" ) - .arg( mErrorCaption ).arg( mError ) - .arg( requestUrl.toString() ), tr( "WMS" ) ); + .arg( mErrorCaption, mError, + requestUrl.toString() ), tr( "WMS" ) ); continue; } } @@ -2586,7 +2590,7 @@ QgsRasterIdentifyResult QgsWmsProvider::identify( const QgsPoint & thePoint, Qgs // for results -> verify CRS and reprojects if necessary QMap features = gml.featuresMap(); QgsCoordinateReferenceSystem featuresCrs = gml.crs(); - QgsDebugMsg( QString( "%1 features read, crs: %2 %3" ).arg( features.size() ).arg( featuresCrs.authid() ).arg( featuresCrs.description() ) ); + QgsDebugMsg( QString( "%1 features read, crs: %2 %3" ).arg( features.size() ).arg( featuresCrs.authid(), featuresCrs.description() ) ); QgsCoordinateTransform *coordinateTransform = 0; if ( featuresCrs.isValid() && featuresCrs != crs() ) { @@ -2657,7 +2661,7 @@ QgsRasterIdentifyResult QgsWmsProvider::identify( const QgsPoint & thePoint, Qgs if ( crsType == "name" ) crsText = result.property( "crs" ).property( "name" ).toString(); else if ( crsType == "EPSG" ) - crsText = QString( "%1:%2" ).arg( crsType ).arg( result.property( "crs" ).property( "properties" ).property( "code" ).toString() ); + crsText = QString( "%1:%2" ).arg( crsType, result.property( "crs" ).property( "properties" ).property( "code" ).toString() ); else { QgsDebugMsg( QString( "crs not supported:%1" ).arg( result.property( "crs" ).toString() ) ); @@ -2748,7 +2752,7 @@ QgsRasterIdentifyResult QgsWmsProvider::identify( const QgsPoint & thePoint, Qgs } catch ( const QString &err ) { - QgsDebugMsg( QString( "JSON error: %1\nResult: %2" ).arg( err ).arg( QString::fromUtf8( mIdentifyResultBodies.value( jsonPart ) ) ) ); + QgsDebugMsg( QString( "JSON error: %1\nResult: %2" ).arg( err, QString::fromUtf8( mIdentifyResultBodies.value( jsonPart ) ) ) ); } delete coordinateTransform; @@ -2815,7 +2819,7 @@ void QgsWmsProvider::identifyReplyFinished() { //mIdentifyResult = tr( "ERROR: GetFeatureInfo failed" ); mErrorFormat = "text/plain"; - mError = tr( "Map getfeatureinfo error: %1 [%2]" ).arg( mIdentifyReply->errorString() ).arg( mIdentifyReply->url().toString() ); + mError = tr( "Map getfeatureinfo error: %1 [%2]" ).arg( mIdentifyReply->errorString(), mIdentifyReply->url().toString() ); emit statusChanged( mError ); QgsMessageLog::logMessage( mError, tr( "WMS" ) ); } @@ -3232,8 +3236,8 @@ void QgsWmsImageDownloadHandler::cacheReplyFinished() QgsMessageLog::logMessage( tr( "Map request error (Status: %1; Reason phrase: %2; URL:%3)" ) .arg( status.toInt() ) - .arg( phrase.toString() ) - .arg( mCacheReply->url().toString() ), tr( "WMS" ) ); + .arg( phrase.toString(), + mCacheReply->url().toString() ), tr( "WMS" ) ); mCacheReply->deleteLater(); mCacheReply = 0; @@ -3255,7 +3259,7 @@ void QgsWmsImageDownloadHandler::cacheReplyFinished() contentType.compare( "application/octet-stream", Qt::CaseInsensitive ) == 0 ) { QgsMessageLog::logMessage( tr( "Returned image is flawed [Content-Type:%1; URL:%2]" ) - .arg( contentType ).arg( mCacheReply->url().toString() ), tr( "WMS" ) ); + .arg( contentType, mCacheReply->url().toString() ), tr( "WMS" ) ); } else { @@ -3263,16 +3267,16 @@ void QgsWmsImageDownloadHandler::cacheReplyFinished() if ( contentType.toLower() == "text/xml" && QgsWmsProvider::parseServiceExceptionReportDom( text, errorTitle, errorText ) ) { QgsMessageLog::logMessage( tr( "Map request error (Title:%1; Error:%2; URL: %3)" ) - .arg( errorTitle ).arg( errorText ) - .arg( mCacheReply->url().toString() ), tr( "WMS" ) ); + .arg( errorTitle, errorText, + mCacheReply->url().toString() ), tr( "WMS" ) ); } else { QgsMessageLog::logMessage( tr( "Map request error (Status: %1; Response: %2; Content-Type: %3; URL:%4)" ) .arg( status.toInt() ) - .arg( QString::fromUtf8( text ) ) - .arg( contentType ) - .arg( mCacheReply->url().toString() ), tr( "WMS" ) ); + .arg( QString::fromUtf8( text ), + contentType, + mCacheReply->url().toString() ), tr( "WMS" ) ); } mCacheReply->deleteLater(); @@ -3294,7 +3298,7 @@ void QgsWmsImageDownloadHandler::cacheReplyFinished() stat.errors++; if ( stat.errors < 100 ) { - QgsMessageLog::logMessage( tr( "Map request failed [error:%1 url:%2]" ).arg( mCacheReply->errorString() ).arg( mCacheReply->url().toString() ), tr( "WMS" ) ); + QgsMessageLog::logMessage( tr( "Map request failed [error:%1 url:%2]" ).arg( mCacheReply->errorString(), mCacheReply->url().toString() ), tr( "WMS" ) ); } else if ( stat.errors == 100 ) { @@ -3379,8 +3383,8 @@ void QgsWmsTiledImageDownloadHandler::tileReplyFinished() Q_FOREACH ( const QNetworkReply::RawHeaderPair &pair, reply->rawHeaderPairs() ) { QgsDebugMsgLevel( QString( " %1:%2" ) - .arg( QString::fromUtf8( pair.first ) ) - .arg( QString::fromUtf8( pair.second ) ), 3 ); + .arg( QString::fromUtf8( pair.first ), + QString::fromUtf8( pair.second ) ), 3 ); } #endif @@ -3417,8 +3421,8 @@ void QgsWmsTiledImageDownloadHandler::tileReplyFinished() .arg( tileReqNo ).arg( mTileReqNo ).arg( tileNo ).arg( retry ) .arg( r.left(), 0, 'f' ).arg( r.bottom(), 0, 'f' ).arg( r.right(), 0, 'f' ).arg( r.top(), 0, 'f' ) .arg( fromCache ) - .arg( reply->errorString() ) - .arg( reply->url().toString() ) + .arg( reply->errorString(), + reply->url().toString() ) ); if ( reply->error() == QNetworkReply::NoError ) @@ -3473,14 +3477,14 @@ void QgsWmsTiledImageDownloadHandler::tileReplyFinished() if ( contentType.toLower() == "text/xml" && QgsWmsProvider::parseServiceExceptionReportDom( text, errorTitle, errorText ) ) { QgsMessageLog::logMessage( tr( "Tile request error (Title:%1; Error:%2; URL: %3)" ) - .arg( errorTitle ).arg( errorText ) - .arg( reply->url().toString() ), tr( "WMS" ) ); + .arg( errorTitle, errorText, + reply->url().toString() ), tr( "WMS" ) ); } else { QgsMessageLog::logMessage( tr( "Tile request error (Status:%1; Content-Type:%2; Length:%3; URL: %4)" ) - .arg( status.toString() ) - .arg( contentType ) + .arg( status.toString(), + contentType ) .arg( text.size() ) .arg( reply->url().toString() ), tr( "WMS" ) ); #ifdef QGISDEBUG @@ -3535,7 +3539,7 @@ void QgsWmsTiledImageDownloadHandler::tileReplyFinished() else { QgsMessageLog::logMessage( tr( "Returned image is flawed [Content-Type:%1; URL: %2]" ) - .arg( contentType ).arg( reply->url().toString() ), tr( "WMS" ) ); + .arg( contentType, reply->url().toString() ), tr( "WMS" ) ); repeatTileRequest( reply->request() ); } @@ -3624,10 +3628,10 @@ QString QgsWmsProvider::toParamValue( const QgsRectangle& rect, bool changeXY ) { // Warning: does not work with scientific notation return QString( changeXY ? "%2,%1,%4,%3" : "%1,%2,%3,%4" ) - .arg( qgsDoubleToString( rect.xMinimum() ) ) - .arg( qgsDoubleToString( rect.yMinimum() ) ) - .arg( qgsDoubleToString( rect.xMaximum() ) ) - .arg( qgsDoubleToString( rect.yMaximum() ) ); + .arg( qgsDoubleToString( rect.xMinimum() ), + qgsDoubleToString( rect.yMinimum() ), + qgsDoubleToString( rect.xMaximum() ), + qgsDoubleToString( rect.yMaximum() ) ); } void QgsWmsProvider::setSRSQueryItem( QUrl& url ) diff --git a/src/providers/wms/qgswmssourceselect.cpp b/src/providers/wms/qgswmssourceselect.cpp index a9491092c65..ef8ba32f8bf 100644 --- a/src/providers/wms/qgswmssourceselect.cpp +++ b/src/providers/wms/qgswmssourceselect.cpp @@ -320,7 +320,7 @@ bool QgsWMSSourceSelect::populateLayerList( const QgsWmsCapabilities& capabiliti // Layer Styles for ( int j = 0; j < layer->style.size(); j++ ) { - QgsDebugMsg( QString( "got style name %1 and title '%2'." ).arg( layer->style[j].name ).arg( layer->style[j].title ) ); + QgsDebugMsg( QString( "got style name %1 and title '%2'." ).arg( layer->style[j].name, layer->style[j].title ) ); QgsNumericSortTreeWidgetItem *lItem2 = new QgsNumericSortTreeWidgetItem( lItem ); lItem2->setText( 0, QString::number( ++layerAndStyleCount ) ); @@ -1065,7 +1065,7 @@ void QgsWMSSourceSelect::showError( QgsWmsProvider * wms ) } else { - mv->setMessageAsPlainText( tr( "Could not understand the response. The %1 provider said:\n%2" ).arg( wms->name() ).arg( wms->lastError() ) ); + mv->setMessageAsPlainText( tr( "Could not understand the response. The %1 provider said:\n%2" ).arg( wms->name(), wms->lastError() ) ); } mv->showMessage( true ); // Is deleted when closed } diff --git a/src/python/qgspythonutilsimpl.cpp b/src/python/qgspythonutilsimpl.cpp index f2a8a407973..1c20bc13dbf 100644 --- a/src/python/qgspythonutilsimpl.cpp +++ b/src/python/qgspythonutilsimpl.cpp @@ -315,7 +315,7 @@ bool QgsPythonUtilsImpl::runString( const QString& command, QString msgOnError, QString str = "" + msgOnError + "
\n" + traceback + "\n
" + QObject::tr( "Python version:" ) + "
" + version + "

" - + QObject::tr( "QGIS version:" ) + "
" + QString( "%1 '%2', %3" ).arg( QGis::QGIS_VERSION ).arg( QGis::QGIS_RELEASE_NAME ).arg( QGis::QGIS_DEV_VERSION ) + "

" + + QObject::tr( "QGIS version:" ) + "
" + QString( "%1 '%2', %3" ).arg( QGis::QGIS_VERSION, QGis::QGIS_RELEASE_NAME, QGis::QGIS_DEV_VERSION ) + "

" + QObject::tr( "Python path:" ) + "
" + path; str.replace( "\n", "
" ).replace( " ", "  " ); diff --git a/tests/src/analysis/testqgsalignraster.cpp b/tests/src/analysis/testqgsalignraster.cpp index 87f8a8d186c..ba629804eb5 100644 --- a/tests/src/analysis/testqgsalignraster.cpp +++ b/tests/src/analysis/testqgsalignraster.cpp @@ -28,7 +28,7 @@ static QString _tempFile( const QString& name ) { - return QString( "%1/aligntest-%2.tif" ).arg( QDir::tempPath() ).arg( name ); + return QString( "%1/aligntest-%2.tif" ).arg( QDir::tempPath(), name ); } diff --git a/tests/src/core/testqgscomposermap.cpp b/tests/src/core/testqgscomposermap.cpp index ac0bd899324..03dbcf55a21 100644 --- a/tests/src/core/testqgscomposermap.cpp +++ b/tests/src/core/testqgscomposermap.cpp @@ -280,7 +280,7 @@ void TestQgsComposerMap::dataDefinedLayers() //test subset of valid layers mComposerMap->setDataDefinedProperty( QgsComposerObject::MapLayers, true, true, - QString( "'%1|%2'" ).arg( mPolysLayer->name() ).arg( mRasterLayer->name() ), QString() ); + QString( "'%1|%2'" ).arg( mPolysLayer->name(), mRasterLayer->name() ), QString() ); result = mComposerMap->layersToRender(); QCOMPARE( result.count(), 2 ); QVERIFY( result.contains( mPolysLayer->id() ) ); @@ -288,7 +288,7 @@ void TestQgsComposerMap::dataDefinedLayers() //test non-existant layer mComposerMap->setDataDefinedProperty( QgsComposerObject::MapLayers, true, true, - QString( "'x|%1|%2'" ).arg( mLinesLayer->name() ).arg( mPointsLayer->name() ), QString() ); + QString( "'x|%1|%2'" ).arg( mLinesLayer->name(), mPointsLayer->name() ), QString() ); result = mComposerMap->layersToRender(); QCOMPARE( result.count(), 2 ); QVERIFY( result.contains( mLinesLayer->id() ) ); @@ -328,7 +328,7 @@ void TestQgsComposerMap::dataDefinedLayers() //render test mComposerMap->setDataDefinedProperty( QgsComposerObject::MapLayers, true, true, - QString( "'%1|%2'" ).arg( mPolysLayer->name() ).arg( mPointsLayer->name() ), QString() ); + QString( "'%1|%2'" ).arg( mPolysLayer->name(), mPointsLayer->name() ), QString() ); mComposerMap->setNewExtent( QgsRectangle( -110.0, 25.0, -90, 40.0 ) ); QgsCompositionChecker checker( "composermap_ddlayers", mComposition ); diff --git a/tests/src/core/testqgscoordinatereferencesystem.cpp b/tests/src/core/testqgscoordinatereferencesystem.cpp index 39d813efccc..37565b55c35 100644 --- a/tests/src/core/testqgscoordinatereferencesystem.cpp +++ b/tests/src/core/testqgscoordinatereferencesystem.cpp @@ -178,10 +178,10 @@ QString TestQgsCoordinateReferenceSystem::testESRIWkt( int i, QgsCoordinateRefer #endif if ( myCrs.toProj4().indexOf( myTOWGS84Strings[i] ) == -1 ) return QString( "test %1 [%2] not found, PROJ.4 = [%3] expecting [%4]" - ).arg( i ).arg( myTOWGS84Strings[i] ).arg( myCrs.toProj4() ).arg( myProj4Strings[i] ); + ).arg( i ).arg( myTOWGS84Strings[i], myCrs.toProj4(), myProj4Strings[i] ); if ( myCrs.authid() != myAuthIdStrings[i] ) return QString( "test %1 AUTHID = [%2] expecting [%3]" - ).arg( i ).arg( myCrs.authid() ).arg( myAuthIdStrings[i] ); + ).arg( i ).arg( myCrs.authid(), myAuthIdStrings[i] ); return ""; } @@ -257,7 +257,7 @@ void TestQgsCoordinateReferenceSystem::createFromESRIWkt() if ( GDAL_VERSION_NUM < myGdalVersionOK[i] ) { QEXPECT_FAIL( "", QString( "expected failure with GDAL %1 : %2 using layer %3" - ).arg( GDAL_VERSION_NUM ).arg( msg ).arg( fileStr ).toLocal8Bit().constData(), + ).arg( GDAL_VERSION_NUM ).arg( msg, fileStr ).toLocal8Bit().constData(), Continue ); } if ( !msg.isEmpty() ) diff --git a/tests/src/core/testqgsdataitem.cpp b/tests/src/core/testqgsdataitem.cpp index 89eb37ec1ae..ae27fb46eca 100644 --- a/tests/src/core/testqgsdataitem.cpp +++ b/tests/src/core/testqgsdataitem.cpp @@ -125,9 +125,9 @@ void TestQgsDataItem::testDirItemChildren() QFileInfo info( layerItem->path() ); QString lFile = info.fileName(); QString lProvider = layerItem->providerKey(); - QString errStr = QString( "layer #%1 - %2 provider = %3 tmpSetting = %4" ).arg( i ).arg( lFile ).arg( lProvider ).arg( tmpSetting ); + QString errStr = QString( "layer #%1 - %2 provider = %3 tmpSetting = %4" ).arg( i ).arg( lFile, lProvider, tmpSetting ); - QgsDebugMsg( QString( "testing child name=%1 provider=%2 path=%3 tmpSetting = %4" ).arg( layerItem->name() ).arg( lProvider ).arg( lFile ).arg( tmpSetting ) ); + QgsDebugMsg( QString( "testing child name=%1 provider=%2 path=%3 tmpSetting = %4" ).arg( layerItem->name(), lProvider, lFile, tmpSetting ) ); if ( lFile == "landsat.tif" ) { @@ -152,7 +152,7 @@ void TestQgsDataItem::testDirItemChildren() // test layerName() does not include extension for gdal and ogr items (bug #5621) QString lName = layerItem->layerName(); - errStr = QString( "layer #%1 - %2 lName = %3 tmpSetting = %4" ).arg( i ).arg( lFile ).arg( lName ).arg( tmpSetting ); + errStr = QString( "layer #%1 - %2 lName = %3 tmpSetting = %4" ).arg( i ).arg( lFile, lName, tmpSetting ); if ( lFile == "landsat.tif" ) { diff --git a/tests/src/core/testqgsrasterlayer.cpp b/tests/src/core/testqgsrasterlayer.cpp index 8ffdc25791a..5ad2635fa03 100644 --- a/tests/src/core/testqgsrasterlayer.cpp +++ b/tests/src/core/testqgsrasterlayer.cpp @@ -425,7 +425,7 @@ void TestQgsRasterLayer::checkScaleOffset() if ( values.value( bandNo ).isNull() ) { valueString = tr( "no data" ); - mReport += QString( " %1 = %2
\n" ).arg( myProvider->generateBandName( bandNo ) ).arg( valueString ); + mReport += QString( " %1 = %2
\n" ).arg( myProvider->generateBandName( bandNo ), valueString ); delete myRasterLayer; QVERIFY( false ); return; @@ -435,7 +435,7 @@ void TestQgsRasterLayer::checkScaleOffset() double expected = 0.99995432; double value = values.value( bandNo ).toDouble(); valueString = QgsRasterBlock::printValue( value ); - mReport += QString( " %1 = %2
\n" ).arg( myProvider->generateBandName( bandNo ) ).arg( valueString ); + mReport += QString( " %1 = %2
\n" ).arg( myProvider->generateBandName( bandNo ), valueString ); mReport += QString( " value = %1 expected = %2 diff = %3
\n" ).arg( value ).arg( expected ).arg( fabs( value - expected ) ); QVERIFY( fabs( value - expected ) < 0.0000001 ); } diff --git a/tests/src/core/testqgsstylev2.cpp b/tests/src/core/testqgsstylev2.cpp index 40d405b59c4..d307ea6d69e 100644 --- a/tests/src/core/testqgsstylev2.cpp +++ b/tests/src/core/testqgsstylev2.cpp @@ -143,7 +143,7 @@ bool TestStyleV2::testValidColor( QgsVectorColorRampV2 *ramp, double value, cons if ( result != expected ) { QWARN( QString( "value = %1 result = %2 expected = %3" ).arg( value ).arg( - result.name() ).arg( expected.name() ).toLocal8Bit().data() ); + result.name(), expected.name() ).toLocal8Bit().data() ); return false; } return true; diff --git a/tests/src/core/testziplayer.cpp b/tests/src/core/testziplayer.cpp index d28d3c70597..e5856eca4ce 100644 --- a/tests/src/core/testziplayer.cpp +++ b/tests/src/core/testziplayer.cpp @@ -145,7 +145,7 @@ bool TestZipLayer::testZipItemPassthru( const QString& myFileName, const QString bool TestZipLayer::testZipItem( const QString& myFileName, const QString& myChildName, const QString& myProviderName ) { QgsDebugMsg( QString( "\n=======================================\nfile = %1 name = %2 provider = %3" - ).arg( myFileName ).arg( myChildName ).arg( myProviderName ) ); + ).arg( myFileName, myChildName, myProviderName ) ); QFileInfo myFileInfo( myFileName ); QgsZipItem *myZipItem = new QgsZipItem( NULL, myFileInfo.fileName(), myFileName ); myZipItem->populate(); @@ -171,7 +171,7 @@ bool TestZipLayer::testZipItem( const QString& myFileName, const QString& myChil QgsLayerItem *layerItem = dynamic_cast( item ); if ( layerItem ) { - QgsDebugMsg( QString( "child name=%1 provider=%2 path=%3" ).arg( layerItem->name() ).arg( layerItem->providerKey() ).arg( layerItem->path() ) ); + QgsDebugMsg( QString( "child name=%1 provider=%2 path=%3" ).arg( layerItem->name(), layerItem->providerKey(), layerItem->path() ) ); if ( myChildName == "" || myChildName == item->name() ) { QgsMapLayer* layer = getLayer( layerItem->path(), layerItem->name(), layerItem->providerKey() ); @@ -200,7 +200,7 @@ bool TestZipLayer::testZipItem( const QString& myFileName, const QString& myChil if ( ! ok ) { QWARN( QString( "Layer %1 opened by provider %2, expecting %3" - ).arg( layerItem->path() ).arg( layerItem->providerKey() ).arg( myProviderName ).toLocal8Bit().data() ); + ).arg( layerItem->path(), layerItem->providerKey(), myProviderName ).toLocal8Bit().data() ); } } break; @@ -250,7 +250,7 @@ int TestZipLayer::getLayerTransparency( const QString& myFileName, const QString } } else - QWARN( QString( "Could not open filename %1 using %2 provider" ).arg( myFileName ).arg( myProviderKey ).toLocal8Bit().data() ); + QWARN( QString( "Could not open filename %1 using %2 provider" ).arg( myFileName, myProviderKey ).toLocal8Bit().data() ); if ( myLayer ) delete myLayer; return myTransparency; diff --git a/tests/src/providers/grass/testqgsgrassprovider.cpp b/tests/src/providers/grass/testqgsgrassprovider.cpp index 005f98acf0a..8334f54e556 100644 --- a/tests/src/providers/grass/testqgsgrassprovider.cpp +++ b/tests/src/providers/grass/testqgsgrassprovider.cpp @@ -1199,14 +1199,14 @@ bool TestQgsGrassProvider::equal( QgsFeature feature, QgsFeature expectedFeature { names << feature.fields()->at( j ).name(); } - reportRow( QString( "Attribute %1 not found, feature attributes: %2" ).arg( name ).arg( names.join( "," ) ) ); + reportRow( QString( "Attribute %1 not found, feature attributes: %2" ).arg( name, names.join( "," ) ) ); return false; } indexes.remove( index ); if ( feature.attribute( index ) != expectedFeature.attribute( i ) ) { - reportRow( QString( "Attribute name %1, value: '%2' does not match expected value: '%2'" ) - .arg( name ).arg( feature.attribute( index ).toString() ).arg( expectedFeature.attribute( i ).toString() ) ); + reportRow( QString( "Attribute name %1, value: '%2' does not match expected value: '%3'" ) + .arg( name, feature.attribute( index ).toString(), expectedFeature.attribute( i ).toString() ) ); return false; } } diff --git a/tests/src/providers/testqgswcsprovider.cpp b/tests/src/providers/testqgswcsprovider.cpp index a41641119dd..2ec3343e107 100644 --- a/tests/src/providers/testqgswcsprovider.cpp +++ b/tests/src/providers/testqgswcsprovider.cpp @@ -127,7 +127,7 @@ void TestQgsWcsProvider::read() qDebug() << "copy " << testFilePath << " to " << tmpFilePath; if ( !QFile::copy( testFilePath, tmpFilePath ) ) { - mReport += QString( "Cannot copy %1 to %2" ).arg( testFilePath ).arg( tmpFilePath ); + mReport += QString( "Cannot copy %1 to %2" ).arg( testFilePath, tmpFilePath ); ok = false; continue; } diff --git a/tests/src/providers/testqgswcspublicservers.cpp b/tests/src/providers/testqgswcspublicservers.cpp index 8846ba95be8..2bb61afa2ba 100644 --- a/tests/src/providers/testqgswcspublicservers.cpp +++ b/tests/src/providers/testqgswcspublicservers.cpp @@ -618,7 +618,7 @@ void TestQgsWcsPublicServers::report() QDir myVersionDir( myVersionDirPath ); QString myVersion = myVersionLog.value( "version" ); - myServerReport += QString( "

Version: %2

" ).arg( myVersionLog.value( "getCapabilitiesUrl" ) ).arg( myVersion.isEmpty() ? "(empty)" : myVersion ); + myServerReport += QString( "

Version: %2

" ).arg( myVersionLog.value( "getCapabilitiesUrl" ), myVersion.isEmpty() ? "(empty)" : myVersion ); if ( !myVersionLog.value( "error" ).isEmpty() ) { @@ -648,7 +648,7 @@ void TestQgsWcsPublicServers::report() myVersionReport += ""; QStringList myValues; - myValues << QString( "%2" ).arg( myLog.value( "describeCoverageUrl" ) ).arg( myLog.value( "identifier" ) ); + myValues << QString( "%2" ).arg( myLog.value( "describeCoverageUrl" ), myLog.value( "identifier" ) ); //myValues << myLog.value( "hasSize" ); myVersionReport += cells( myValues, "", 1, 2 ); myValues.clear(); @@ -834,7 +834,7 @@ QString TestQgsWcsPublicServers::cells( const QStringList& theValues, const QStr { rowspanStr = QString( "rowspan=%1" ).arg( rowspan ); } - myRow += QString( "%4" ).arg( theClass ).arg( colspanStr ).arg( rowspanStr ).arg( val ); + myRow += QString( "%4" ).arg( theClass, colspanStr, rowspanStr, val ); } return myRow; } @@ -850,7 +850,7 @@ QString TestQgsWcsPublicServers::row( const QStringList& theValues, const QStrin { colspan = QString( "colspan=%1" ).arg( mHead.size() - theValues.size() + 1 ); } - myRow += QString( "%3" ).arg( theClass ).arg( colspan ).arg( val ); + myRow += QString( "%3" ).arg( theClass, colspan, val ); } myRow += "\n"; return myRow;