Skip to content

Commit 239865b

Browse files
committedMay 15, 2016
Add missing references to Q_FOREACH loops
1 parent 0b940ca commit 239865b

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed
 

‎src/app/qgsmaptoolshowhidelabels.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ void QgsMapToolShowHideLabels::showHideLabels( QMouseEvent * e )
166166
QList<QgsLabelPosition> positions;
167167
if ( selectedLabelFeatures( vlayer, positions ) )
168168
{
169-
Q_FOREACH ( QgsLabelPosition pos, positions )
169+
Q_FOREACH ( const QgsLabelPosition& pos, positions )
170170
{
171171
mCurrentLabel.pos = pos;
172172

‎src/core/dxf/qgsdxfexport.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3393,7 +3393,7 @@ void QgsDxfExport::writePoint( const QgsPointV2 &pt, const QString& layer, const
33933393
void QgsDxfExport::writePolyline( const QgsPolyline &line, const QString& layer, const QString& lineStyleName, const QColor& color, double width )
33943394
{
33953395
QgsPointSequenceV2 s;
3396-
Q_FOREACH ( const QgsPoint p, line )
3396+
Q_FOREACH ( const QgsPoint& p, line )
33973397
s << QgsPointV2( p );
33983398
writePolyline( s, layer, lineStyleName, color, width );
33993399
}
@@ -3468,10 +3468,10 @@ void QgsDxfExport::writePolygon( const QgsPolygon &polygon, const QString& layer
34683468
{
34693469
QgsRingSequenceV2 r;
34703470

3471-
Q_FOREACH ( const QgsPolyline l, polygon )
3471+
Q_FOREACH ( const QgsPolyline& l, polygon )
34723472
{
34733473
QgsPointSequenceV2 s;
3474-
Q_FOREACH ( const QgsPoint p, l )
3474+
Q_FOREACH ( const QgsPoint& p, l )
34753475
s << QgsPointV2( p );
34763476
r << s;
34773477
}

‎src/core/qgsgml.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ int QgsGml::getFeatures( const QByteArray &data, QGis::WkbType* wkbType, QgsRect
180180
void QgsGml::fillMapsFromParser()
181181
{
182182
QVector<QgsGmlStreamingParser::QgsGmlFeaturePtrGmlIdPair> features = mParser.getAndStealReadyFeatures();
183-
Q_FOREACH ( QgsGmlStreamingParser::QgsGmlFeaturePtrGmlIdPair featPair, features )
183+
Q_FOREACH ( const QgsGmlStreamingParser::QgsGmlFeaturePtrGmlIdPair& featPair, features )
184184
{
185185
QgsFeature* feat = featPair.first;
186186
const QString& gmlId = featPair.second;

‎src/providers/spatialite/qgsspatialiteprovider.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ QgsSpatiaLiteProvider::QgsSpatiaLiteProvider( QString const &uri )
451451
if ( mSqliteHandle )
452452
{
453453
QStringList pragmaList = anUri.params( "pragma" );
454-
Q_FOREACH ( QString pragma, pragmaList )
454+
Q_FOREACH ( const QString& pragma, pragmaList )
455455
{
456456
char* errMsg = nullptr;
457457
int ret = sqlite3_exec( mSqliteHandle, ( "PRAGMA " + pragma ).toUtf8(), nullptr, nullptr, &errMsg );

‎src/providers/virtual/qgsvirtuallayersourceselect.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ QgsVirtualLayerSourceSelect::QgsVirtualLayerSourceSelect( QWidget* parent, Qt::W
4949
QObject::connect( mLayersTable->selectionModel(), SIGNAL( currentRowChanged( const QModelIndex&, const QModelIndex& ) ), this, SLOT( onTableRowChanged( const QModelIndex&, const QModelIndex& ) ) );
5050

5151
// prepare provider list
52-
Q_FOREACH ( QString pk, QgsProviderRegistry::instance()->providerList() )
52+
Q_FOREACH ( const QString& pk, QgsProviderRegistry::instance()->providerList() )
5353
{
5454
// we cannot know before trying to actually load a dataset
5555
// if the provider is raster or vector
@@ -293,7 +293,7 @@ void QgsVirtualLayerSourceSelect::onImportLayer()
293293
if ( mEmbeddedSelectionDialog->exec() == QDialog::Accepted )
294294
{
295295
QStringList ids = mEmbeddedSelectionDialog->layers();
296-
Q_FOREACH ( QString id, ids )
296+
Q_FOREACH ( const QString& id, ids )
297297
{
298298
QgsVectorLayer *vl = static_cast<QgsVectorLayer*>( QgsMapLayerRegistry::instance()->mapLayer( id ) );
299299
addEmbeddedLayer( vl->name(), vl->providerType(), vl->dataProvider()->encoding(), vl->source() );

‎src/providers/wfs/qgswfsutils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ bool QgsWFSUtils::removeDir( const QString &dirName )
116116
{
117117
QDir dir( dirName );
118118
QFileInfoList fileList( dir.entryInfoList( QDir::NoDotAndDotDot | QDir::AllDirs | QDir::Files ) );
119-
Q_FOREACH ( QFileInfo info, fileList )
119+
Q_FOREACH ( const QFileInfo& info, fileList )
120120
{
121121
bool result;
122122
if ( info.isDir() )
@@ -219,7 +219,7 @@ void QgsWFSUtils::init()
219219
{
220220
const qint64 currentTimestamp = QDateTime::currentMSecsSinceEpoch();
221221
QFileInfoList fileList( dir.entryInfoList( QDir::NoDotAndDotDot | QDir::AllDirs | QDir::Files ) );
222-
Q_FOREACH ( QFileInfo info, fileList )
222+
Q_FOREACH ( const QFileInfo& info, fileList )
223223
{
224224
if ( info.isDir() && info.fileName().startsWith( "pid_" ) )
225225
{

0 commit comments

Comments
 (0)
Please sign in to comment.