Skip to content
Permalink
Browse files

Add missing references to Q_FOREACH loops

  • Loading branch information
nyalldawson committed May 9, 2016
1 parent 0b940ca commit 239865b70880c3fd1221728dcae4b95c5fbf6a89
@@ -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;

@@ -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 );
}
@@ -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;
}
@@ -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;
@@ -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 );
@@ -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
@@ -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() );
@@ -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() )
@@ -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_" ) )
{

0 comments on commit 239865b

Please sign in to comment.
You can’t perform that action at this time.