diff --git a/src/app/main.cpp b/src/app/main.cpp index 5421862db8d1..0684ed852c11 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -1172,7 +1172,7 @@ int main( int argc, char *argv[] ) } else { - Q_FOREACH ( QgsMapLayer *ml, QgsMapLayerRegistry::instance()->mapLayers().values() ) + Q_FOREACH ( QgsMapLayer *ml, QgsMapLayerRegistry::instance()->mapLayers() ) { QgsVectorLayer *vl = qobject_cast( ml ); if ( !vl ) diff --git a/src/app/nodetool/qgsmaptoolnodetool.cpp b/src/app/nodetool/qgsmaptoolnodetool.cpp index 27bf53a815e3..d2edb3cae7b7 100644 --- a/src/app/nodetool/qgsmaptoolnodetool.cpp +++ b/src/app/nodetool/qgsmaptoolnodetool.cpp @@ -67,7 +67,7 @@ void QgsMapToolNodeTool::createTopologyRubberBands() // Snap vertex QMultiMap snapResults; vlayer->snapWithContext( vertexEntry->pointV1(), ZERO_TOLERANCE, snapResults, QgsSnapper::SnapToVertex ); - Q_FOREACH ( const QgsSnappingResult& snapResult, snapResults.values() ) + Q_FOREACH ( const QgsSnappingResult& snapResult, snapResults ) { // Get geometry of snapped feature QgsFeatureId snapFeatureId = snapResult.snappedAtGeometry; diff --git a/src/app/qgisapp.cpp b/src/app/qgisapp.cpp index 29494b32dd87..4c4785c08a2c 100644 --- a/src/app/qgisapp.cpp +++ b/src/app/qgisapp.cpp @@ -4798,7 +4798,7 @@ bool QgisApp::openLayer( const QString & fileName, bool allowInteractive ) if ( QgsRasterLayer::isValidRasterFileName( fileName ) ) { // open .adf as a directory - if ( fileName.toLower().endsWith( ".adf" ) ) + if ( fileName.endsWith( ".adf", Qt::CaseInsensitive ) ) { QString dirName = fileInfo.path(); ok = addRasterLayer( dirName, QFileInfo( dirName ).completeBaseName() ); @@ -10337,7 +10337,7 @@ QgsRasterLayer* QgisApp::addRasterLayerPrivate( // XXX ya know QgsRasterLayer can snip out the basename on its own; // XXX why do we have to pass it in for it? // ET : we may not be getting "normal" files here, so we still need the baseName argument - if ( !providerKey.isEmpty() && uri.toLower().endsWith( ".adf" ) ) + if ( !providerKey.isEmpty() && uri.endsWith( ".adf", Qt::CaseInsensitive ) ) { QFileInfo fileInfo( uri ); QString dirName = fileInfo.path(); diff --git a/src/app/qgsalignrasterdialog.cpp b/src/app/qgsalignrasterdialog.cpp index 53e8b7dfe75a..a86b46ac5b2b 100644 --- a/src/app/qgsalignrasterdialog.cpp +++ b/src/app/qgsalignrasterdialog.cpp @@ -36,7 +36,7 @@ static QgsMapLayer* _rasterLayer( const QString& filename ) { QMap layers = QgsMapLayerRegistry::instance()->mapLayers(); - Q_FOREACH ( QgsMapLayer* layer, layers.values() ) + Q_FOREACH ( QgsMapLayer* layer, layers ) { if ( layer->type() == QgsMapLayer::RasterLayer && layer->source() == filename ) return layer; @@ -457,7 +457,7 @@ void QgsAlignRasterLayerConfigDialog::browseOutputFilename() if ( !fileName.isEmpty() ) { // ensure the user never ommited the extension from the file name - if ( !fileName.toLower().endsWith( ".tif" ) && !fileName.toLower().endsWith( ".tiff" ) ) + if ( !fileName.endsWith( ".tif", Qt::CaseInsensitive ) && !fileName.endsWith( ".tiff", Qt::CaseInsensitive ) ) { fileName += ".tif"; } diff --git a/src/app/qgsbookmarks.cpp b/src/app/qgsbookmarks.cpp index 620936a5e715..1715001189ff 100644 --- a/src/app/qgsbookmarks.cpp +++ b/src/app/qgsbookmarks.cpp @@ -326,7 +326,7 @@ void QgsBookmarks::exportToXML() } // ensure the user never ommited the extension from the file name - if ( !fileName.toLower().endsWith( ".xml" ) ) + if ( !fileName.endsWith( ".xml", Qt::CaseInsensitive ) ) { fileName += ".xml"; } diff --git a/src/app/qgsconfigureshortcutsdialog.cpp b/src/app/qgsconfigureshortcutsdialog.cpp index 1b8f0193e924..7e37e7ef64d2 100644 --- a/src/app/qgsconfigureshortcutsdialog.cpp +++ b/src/app/qgsconfigureshortcutsdialog.cpp @@ -107,7 +107,7 @@ void QgsConfigureShortcutsDialog::saveShortcuts() return; // ensure the user never omitted the extension from the file name - if ( !fileName.toLower().endsWith( ".xml" ) ) + if ( !fileName.endsWith( ".xml", Qt::CaseInsensitive ) ) { fileName += ".xml"; } diff --git a/src/app/qgsnewspatialitelayerdialog.cpp b/src/app/qgsnewspatialitelayerdialog.cpp index a4c555bb766c..2f1657e23137 100644 --- a/src/app/qgsnewspatialitelayerdialog.cpp +++ b/src/app/qgsnewspatialitelayerdialog.cpp @@ -117,7 +117,7 @@ void QgsNewSpatialiteLayerDialog::on_toolButtonNewDatabase_clicked() if ( fileName.isEmpty() ) return; - if ( !fileName.toLower().endsWith( ".sqlite" ) && !fileName.toLower().endsWith( ".db" ) ) + if ( !fileName.endsWith( ".sqlite", Qt::CaseInsensitive ) && !fileName.endsWith( ".db", Qt::CaseInsensitive ) ) { fileName += ".sqlite"; } diff --git a/src/app/qgsoptions.cpp b/src/app/qgsoptions.cpp index a6e4bb5f332c..558001801710 100644 --- a/src/app/qgsoptions.cpp +++ b/src/app/qgsoptions.cpp @@ -2001,7 +2001,7 @@ void QgsOptions::on_pbnExportScales_clicked() } // ensure the user never ommited the extension from the file name - if ( !fileName.toLower().endsWith( ".xml" ) ) + if ( !fileName.endsWith( ".xml", Qt::CaseInsensitive ) ) { fileName += ".xml"; } @@ -2160,7 +2160,7 @@ void QgsOptions::on_mButtonExportColors_clicked() } // ensure filename contains extension - if ( !fileName.toLower().endsWith( ".gpl" ) ) + if ( !fileName.endsWith( ".gpl", Qt::CaseInsensitive ) ) { fileName += ".gpl"; } diff --git a/src/app/qgsprojectproperties.cpp b/src/app/qgsprojectproperties.cpp index ff261e21c767..cef458c45698 100644 --- a/src/app/qgsprojectproperties.cpp +++ b/src/app/qgsprojectproperties.cpp @@ -643,7 +643,7 @@ QgsProjectProperties::QgsProjectProperties( QgsMapCanvas* mapCanvas, QWidget *pa mTabRelations->layout()->addWidget( mRelationManagerDlg ); QList vectorLayers; - Q_FOREACH ( QgsMapLayer* mapLayer, mapLayers.values() ) + Q_FOREACH ( QgsMapLayer* mapLayer, mapLayers ) { if ( QgsMapLayer::VectorLayer == mapLayer->type() ) { @@ -1482,7 +1482,7 @@ void QgsProjectProperties::on_pbnLaunchOWSChecker_clicked() QStringList duplicateNames, regExpMessages; QRegExp snRegExp = QgsApplication::shortNameRegExp(); - Q_FOREACH ( QString name, owsNames ) + Q_FOREACH ( const QString& name, owsNames ) { if ( !snRegExp.exactMatch( name ) ) regExpMessages << tr( "Use short name for \"%1\"" ).arg( name ); @@ -1583,7 +1583,7 @@ void QgsProjectProperties::on_pbnExportScales_clicked() } // ensure the user never ommited the extension from the file name - if ( !fileName.toLower().endsWith( ".xml" ) ) + if ( !fileName.endsWith( ".xml", Qt::CaseInsensitive ) ) { fileName += ".xml"; } @@ -2015,7 +2015,7 @@ void QgsProjectProperties::on_mButtonExportColors_clicked() } // ensure filename contains extension - if ( !fileName.toLower().endsWith( ".gpl" ) ) + if ( !fileName.endsWith( ".gpl", Qt::CaseInsensitive ) ) { fileName += ".gpl"; } diff --git a/src/gui/editorwidgets/qgsvaluemapconfigdlg.cpp b/src/gui/editorwidgets/qgsvaluemapconfigdlg.cpp index 8fc5f95e5343..97377079721f 100644 --- a/src/gui/editorwidgets/qgsvaluemapconfigdlg.cpp +++ b/src/gui/editorwidgets/qgsvaluemapconfigdlg.cpp @@ -111,7 +111,7 @@ void QgsValueMapConfigDlg::removeSelectedButtonPushed() } } } - for ( i = 0; i < rowsToRemove.values().size(); i++ ) + for ( i = 0; i < rowsToRemove.size(); i++ ) { tableWidget->removeRow( rowsToRemove.values().at( i ) - removed ); removed++; diff --git a/src/gui/qgisgui.cpp b/src/gui/qgisgui.cpp index a86910142fba..894a49891026 100644 --- a/src/gui/qgisgui.cpp +++ b/src/gui/qgisgui.cpp @@ -168,7 +168,7 @@ namespace QgisGui #endif // Add the file type suffix to the fileName if required - if ( !ext.isNull() && !outputFileName.toLower().endsWith( '.' + ext.toLower() ) ) + if ( !ext.isNull() && !outputFileName.endsWith( '.' + ext.toLower(), Qt::CaseInsensitive ) ) { outputFileName += '.' + ext; } diff --git a/src/gui/qgscolordialog.cpp b/src/gui/qgscolordialog.cpp index 9abf82e1dfd8..bf065e0d7d54 100644 --- a/src/gui/qgscolordialog.cpp +++ b/src/gui/qgscolordialog.cpp @@ -572,7 +572,7 @@ void QgsColorDialogV2::exportColors() } // ensure filename contains extension - if ( !fileName.toLower().endsWith( ".gpl" ) ) + if ( !fileName.endsWith( ".gpl", Qt::CaseInsensitive ) ) { fileName += ".gpl"; } diff --git a/src/gui/qgsmanageconnectionsdialog.cpp b/src/gui/qgsmanageconnectionsdialog.cpp index f6bb97f74f62..22a338d51807 100644 --- a/src/gui/qgsmanageconnectionsdialog.cpp +++ b/src/gui/qgsmanageconnectionsdialog.cpp @@ -99,7 +99,7 @@ void QgsManageConnectionsDialog::doExportImport() } // ensure the user never ommited the extension from the file name - if ( !fileName.toLower().endsWith( ".xml" ) ) + if ( !fileName.endsWith( ".xml", Qt::CaseInsensitive ) ) { fileName += ".xml"; } diff --git a/src/gui/qgsprojectionselector.cpp b/src/gui/qgsprojectionselector.cpp index 96bf5b00c57a..acfcfa849e4c 100644 --- a/src/gui/qgsprojectionselector.cpp +++ b/src/gui/qgsprojectionselector.cpp @@ -172,7 +172,7 @@ QString QgsProjectionSelector::ogcWmsCrsFilterAsSqlExpression( QSet * c // iterate through all incoming CRSs - Q_FOREACH ( const QString& auth_id, crsFilter->values() ) + Q_FOREACH ( const QString& auth_id, *crsFilter ) { QStringList parts = auth_id.split( ':' ); diff --git a/src/gui/qgsrasterlayersaveasdialog.cpp b/src/gui/qgsrasterlayersaveasdialog.cpp index cfa43018b235..89bce90f45af 100644 --- a/src/gui/qgsrasterlayersaveasdialog.cpp +++ b/src/gui/qgsrasterlayersaveasdialog.cpp @@ -204,7 +204,7 @@ void QgsRasterLayerSaveAsDialog::on_mBrowseButton_clicked() if ( !fileName.isEmpty() ) { // ensure the user never ommited the extension from the file name - if ( !fileName.toLower().endsWith( ".tif" ) && !fileName.toLower().endsWith( ".tiff" ) ) + if ( !fileName.endsWith( ".tif", Qt::CaseInsensitive ) && !fileName.endsWith( ".tiff", Qt::CaseInsensitive ) ) { fileName += ".tif"; } diff --git a/src/gui/symbology-ng/qgssmartgroupeditordialog.cpp b/src/gui/symbology-ng/qgssmartgroupeditordialog.cpp index 384982e0f237..b6f7bb3b8a36 100644 --- a/src/gui/symbology-ng/qgssmartgroupeditordialog.cpp +++ b/src/gui/symbology-ng/qgssmartgroupeditordialog.cpp @@ -106,7 +106,7 @@ void QgsSmartGroupEditorDialog::addCondition() // enable the remove buttons when 2nd condition is added if ( mConditionMap.count() == 1 ) { - Q_FOREACH ( QgsSmartGroupCondition *condition, mConditionMap.values() ) + Q_FOREACH ( QgsSmartGroupCondition *condition, mConditionMap ) { condition->hideRemoveButton( false ); } @@ -128,7 +128,7 @@ void QgsSmartGroupEditorDialog::removeCondition( int id ) // hide the remove button of the last condition when 2nd last is removed if ( mConditionMap.count() == 2 ) { - Q_FOREACH ( QgsSmartGroupCondition* condition, mConditionMap.values() ) + Q_FOREACH ( QgsSmartGroupCondition* condition, mConditionMap ) { condition->hideRemoveButton( true ); } @@ -142,7 +142,7 @@ QgsSmartConditionMap QgsSmartGroupEditorDialog::conditionMap() { QgsSmartConditionMap conditions; - Q_FOREACH ( QgsSmartGroupCondition* condition, mConditionMap.values() ) + Q_FOREACH ( QgsSmartGroupCondition* condition, mConditionMap ) { conditions.insert( condition->constraint(), condition->parameter() ); } diff --git a/src/gui/symbology-ng/qgsstylev2exportimportdialog.cpp b/src/gui/symbology-ng/qgsstylev2exportimportdialog.cpp index 298ab250d217..692f1d8e886c 100644 --- a/src/gui/symbology-ng/qgsstylev2exportimportdialog.cpp +++ b/src/gui/symbology-ng/qgsstylev2exportimportdialog.cpp @@ -134,7 +134,7 @@ void QgsStyleV2ExportImportDialog::doExportImport() } // ensure the user never ommited the extension from the file name - if ( !fileName.toLower().endsWith( ".xml" ) ) + if ( !fileName.endsWith( ".xml", Qt::CaseInsensitive ) ) { fileName += ".xml"; } diff --git a/src/plugins/dxf2shp_converter/dxf2shpconvertergui.cpp b/src/plugins/dxf2shp_converter/dxf2shpconvertergui.cpp index 637b2018636e..4c276e5e541d 100644 --- a/src/plugins/dxf2shp_converter/dxf2shpconvertergui.cpp +++ b/src/plugins/dxf2shp_converter/dxf2shpconvertergui.cpp @@ -163,7 +163,7 @@ void dxf2shpConverterGui::getOutputDir() if ( !s.isEmpty() ) { - if ( !s.toLower().endsWith( ".shp" ) ) + if ( !s.endsWith( ".shp", Qt::CaseInsensitive ) ) { s += ".shp"; } diff --git a/src/plugins/gps_importer/qgsgpsplugin.cpp b/src/plugins/gps_importer/qgsgpsplugin.cpp index cffb39ed8f7e..b367d4e20f1d 100644 --- a/src/plugins/gps_importer/qgsgpsplugin.cpp +++ b/src/plugins/gps_importer/qgsgpsplugin.cpp @@ -174,7 +174,7 @@ void QgsGPSPlugin::createGPX() tr( "GPS eXchange file" ) + " (*.gpx)" ); if ( !fileName.isEmpty() ) { - if ( !fileName.toLower().endsWith( ".gpx" ) ) + if ( !fileName.endsWith( ".gpx", Qt::CaseInsensitive ) ) { fileName += ".gpx"; } diff --git a/src/plugins/gps_importer/qgsgpsplugingui.cpp b/src/plugins/gps_importer/qgsgpsplugingui.cpp index a4fe4d1c88ec..9e1d23ed6ac3 100644 --- a/src/plugins/gps_importer/qgsgpsplugingui.cpp +++ b/src/plugins/gps_importer/qgsgpsplugingui.cpp @@ -116,7 +116,7 @@ void QgsGPSPluginGui::on_buttonBox_accepted() int featureType = cmbDLFeatureType->currentIndex(); QString fileName = leDLOutput->text(); - if ( !fileName.toLower().endsWith( ".gpx" ) ) + if ( !fileName.endsWith( ".gpx", Qt::CaseInsensitive ) ) { fileName += ".gpx"; } @@ -166,7 +166,7 @@ void QgsGPSPluginGui::on_pbnDLOutput_clicked() tr( "GPS eXchange format" ) + " (*.gpx)" ); if ( !myFileNameQString.isEmpty() ) { - if ( !myFileNameQString.toLower().endsWith( ".gpx" ) ) + if ( !myFileNameQString.endsWith( ".gpx", Qt::CaseInsensitive ) ) { myFileNameQString += ".gpx"; } @@ -316,7 +316,7 @@ void QgsGPSPluginGui::on_pbnIMPOutput_clicked() tr( "GPS eXchange format" ) + " (*.gpx)" ); if ( !myFileNameQString.isEmpty() ) { - if ( !myFileNameQString.toLower().endsWith( ".gpx" ) ) + if ( !myFileNameQString.endsWith( ".gpx", Qt::CaseInsensitive ) ) { myFileNameQString += ".gpx"; } @@ -423,7 +423,7 @@ void QgsGPSPluginGui::on_pbnCONVOutput_clicked() tr( "GPS eXchange format" ) + " (*.gpx)" ); if ( !myFileNameQString.isEmpty() ) { - if ( !myFileNameQString.toLower().endsWith( ".gpx" ) ) + if ( !myFileNameQString.endsWith( ".gpx", Qt::CaseInsensitive ) ) { myFileNameQString += ".gpx"; } diff --git a/src/plugins/offline_editing/offline_editing_plugin_gui.cpp b/src/plugins/offline_editing/offline_editing_plugin_gui.cpp index 5b84b986e1d4..7dd54af84c6b 100644 --- a/src/plugins/offline_editing/offline_editing_plugin_gui.cpp +++ b/src/plugins/offline_editing/offline_editing_plugin_gui.cpp @@ -117,7 +117,7 @@ void QgsOfflineEditingPluginGui::on_mBrowseButton_clicked() if ( !fileName.isEmpty() ) { - if ( !fileName.toLower().endsWith( ".sqlite" ) ) + if ( !fileName.endsWith( ".sqlite", Qt::CaseInsensitive ) ) { fileName += ".sqlite"; } diff --git a/src/providers/virtual/qgsvirtuallayersourceselect.cpp b/src/providers/virtual/qgsvirtuallayersourceselect.cpp index a901f169cd4a..1bcb3d6ce7b3 100644 --- a/src/providers/virtual/qgsvirtuallayersourceselect.cpp +++ b/src/providers/virtual/qgsvirtuallayersourceselect.cpp @@ -87,7 +87,7 @@ QgsVirtualLayerSourceSelect::QgsVirtualLayerSourceSelect( QWidget* parent, Qt::W } // configure auto completion with table and column names - Q_FOREACH ( QgsMapLayer* l, QgsMapLayerRegistry::instance()->mapLayers().values() ) + Q_FOREACH ( QgsMapLayer* l, QgsMapLayerRegistry::instance()->mapLayers() ) { if ( l->type() == QgsMapLayer::VectorLayer ) { diff --git a/tests/src/gui/testprojectionissues.cpp b/tests/src/gui/testprojectionissues.cpp index 6d4d3c199422..2f76121c444a 100644 --- a/tests/src/gui/testprojectionissues.cpp +++ b/tests/src/gui/testprojectionissues.cpp @@ -68,7 +68,7 @@ void TestProjectionIssues::initTestCase() // Add all layers in registry to the canvas QList canvasLayers; - Q_FOREACH ( QgsMapLayer* layer, QgsMapLayerRegistry::instance()->mapLayers().values() ) + Q_FOREACH ( QgsMapLayer* layer, QgsMapLayerRegistry::instance()->mapLayers() ) { canvasLayers.append( QgsMapCanvasLayer( layer ) ); }