Skip to content

Commit

Permalink
Add missing references to Q_FOREACH loops
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed May 15, 2016
1 parent 0b940ca commit 239865b
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/app/qgsmaptoolshowhidelabels.cpp
Expand Up @@ -166,7 +166,7 @@ void QgsMapToolShowHideLabels::showHideLabels( QMouseEvent * e )
QList<QgsLabelPosition> positions;
if ( selectedLabelFeatures( vlayer, positions ) )
{
Q_FOREACH ( QgsLabelPosition pos, positions )
Q_FOREACH ( const QgsLabelPosition& pos, positions )
{
mCurrentLabel.pos = pos;

Expand Down
6 changes: 3 additions & 3 deletions src/core/dxf/qgsdxfexport.cpp
Expand Up @@ -3393,7 +3393,7 @@ void QgsDxfExport::writePoint( const QgsPointV2 &pt, const QString& layer, const
void QgsDxfExport::writePolyline( const QgsPolyline &line, const QString& layer, const QString& lineStyleName, const QColor& color, double width )
{
QgsPointSequenceV2 s;
Q_FOREACH ( const QgsPoint p, line )
Q_FOREACH ( const QgsPoint& p, line )
s << QgsPointV2( p );
writePolyline( s, layer, lineStyleName, color, width );
}
Expand Down Expand Up @@ -3468,10 +3468,10 @@ void QgsDxfExport::writePolygon( const QgsPolygon &polygon, const QString& layer
{
QgsRingSequenceV2 r;

Q_FOREACH ( const QgsPolyline l, polygon )
Q_FOREACH ( const QgsPolyline& l, polygon )
{
QgsPointSequenceV2 s;
Q_FOREACH ( const QgsPoint p, l )
Q_FOREACH ( const QgsPoint& p, l )
s << QgsPointV2( p );
r << s;
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsgml.cpp
Expand Up @@ -180,7 +180,7 @@ int QgsGml::getFeatures( const QByteArray &data, QGis::WkbType* wkbType, QgsRect
void QgsGml::fillMapsFromParser()
{
QVector<QgsGmlStreamingParser::QgsGmlFeaturePtrGmlIdPair> features = mParser.getAndStealReadyFeatures();
Q_FOREACH ( QgsGmlStreamingParser::QgsGmlFeaturePtrGmlIdPair featPair, features )
Q_FOREACH ( const QgsGmlStreamingParser::QgsGmlFeaturePtrGmlIdPair& featPair, features )
{
QgsFeature* feat = featPair.first;
const QString& gmlId = featPair.second;
Expand Down
2 changes: 1 addition & 1 deletion src/providers/spatialite/qgsspatialiteprovider.cpp
Expand Up @@ -451,7 +451,7 @@ QgsSpatiaLiteProvider::QgsSpatiaLiteProvider( QString const &uri )
if ( mSqliteHandle )
{
QStringList pragmaList = anUri.params( "pragma" );
Q_FOREACH ( QString pragma, pragmaList )
Q_FOREACH ( const QString& pragma, pragmaList )
{
char* errMsg = nullptr;
int ret = sqlite3_exec( mSqliteHandle, ( "PRAGMA " + pragma ).toUtf8(), nullptr, nullptr, &errMsg );
Expand Down
4 changes: 2 additions & 2 deletions src/providers/virtual/qgsvirtuallayersourceselect.cpp
Expand Up @@ -49,7 +49,7 @@ QgsVirtualLayerSourceSelect::QgsVirtualLayerSourceSelect( QWidget* parent, Qt::W
QObject::connect( mLayersTable->selectionModel(), SIGNAL( currentRowChanged( const QModelIndex&, const QModelIndex& ) ), this, SLOT( onTableRowChanged( const QModelIndex&, const QModelIndex& ) ) );

// prepare provider list
Q_FOREACH ( QString pk, QgsProviderRegistry::instance()->providerList() )
Q_FOREACH ( const QString& pk, QgsProviderRegistry::instance()->providerList() )
{
// we cannot know before trying to actually load a dataset
// if the provider is raster or vector
Expand Down Expand Up @@ -293,7 +293,7 @@ void QgsVirtualLayerSourceSelect::onImportLayer()
if ( mEmbeddedSelectionDialog->exec() == QDialog::Accepted )
{
QStringList ids = mEmbeddedSelectionDialog->layers();
Q_FOREACH ( QString id, ids )
Q_FOREACH ( const QString& id, ids )
{
QgsVectorLayer *vl = static_cast<QgsVectorLayer*>( QgsMapLayerRegistry::instance()->mapLayer( id ) );
addEmbeddedLayer( vl->name(), vl->providerType(), vl->dataProvider()->encoding(), vl->source() );
Expand Down
4 changes: 2 additions & 2 deletions src/providers/wfs/qgswfsutils.cpp
Expand Up @@ -116,7 +116,7 @@ bool QgsWFSUtils::removeDir( const QString &dirName )
{
QDir dir( dirName );
QFileInfoList fileList( dir.entryInfoList( QDir::NoDotAndDotDot | QDir::AllDirs | QDir::Files ) );
Q_FOREACH ( QFileInfo info, fileList )
Q_FOREACH ( const QFileInfo& info, fileList )
{
bool result;
if ( info.isDir() )
Expand Down Expand Up @@ -219,7 +219,7 @@ void QgsWFSUtils::init()
{
const qint64 currentTimestamp = QDateTime::currentMSecsSinceEpoch();
QFileInfoList fileList( dir.entryInfoList( QDir::NoDotAndDotDot | QDir::AllDirs | QDir::Files ) );
Q_FOREACH ( QFileInfo info, fileList )
Q_FOREACH ( const QFileInfo& info, fileList )
{
if ( info.isDir() && info.fileName().startsWith( "pid_" ) )
{
Expand Down

0 comments on commit 239865b

Please sign in to comment.