Skip to content
Permalink
Browse files

Add missing references in Q_FOREACH loops

  • Loading branch information
nyalldawson committed Oct 22, 2016
1 parent 35ecdd1 commit 06cf59a4c2eab00d33d0e2f2043ce0feb78af209
@@ -3264,7 +3264,7 @@ static QVariant fcnArrayRemoveAll( const QVariantList& values, const QgsExpressi
static QVariant fcnArrayCat( const QVariantList& values, const QgsExpressionContext*, QgsExpression* parent )
{
QVariantList list;
Q_FOREACH ( QVariant cur, values )
Q_FOREACH ( const QVariant& cur, values )
{
list += getListValue( cur, parent );
}
@@ -3274,7 +3274,11 @@ static QVariant fcnArrayCat( const QVariantList& values, const QgsExpressionCont
static QVariant fcnArrayIntersect( const QVariantList& values, const QgsExpressionContext*, QgsExpression* parent )
{
const QVariantList array1 = getListValue( values.at( 0 ), parent );
Q_FOREACH ( QVariant cur, getListValue( values.at( 1 ), parent ) ) if ( array1.contains( cur ) ) return QVariant( true );
Q_FOREACH ( const QVariant& cur, getListValue( values.at( 1 ), parent ) )
{
if ( array1.contains( cur ) )
return QVariant( true );
}
return QVariant( false );
}

@@ -3315,7 +3319,7 @@ static QVariant fcnMapInsert( const QVariantList& values, const QgsExpressionCon
static QVariant fcnMapConcat( const QVariantList& values, const QgsExpressionContext*, QgsExpression* parent )
{
QVariantMap result;
Q_FOREACH ( QVariant cur, values )
Q_FOREACH ( const QVariant& cur, values )
{
const QVariantMap curMap = getMapValue( cur, parent );
for ( QVariantMap::const_iterator it = curMap.constBegin(); it != curMap.constEnd(); ++it )
@@ -299,7 +299,7 @@ QVariantList QgsJSONUtils::parseArray( const QString& json, QVariant::Type type
QgsLogger::warning( QString( "Cannot parse json (%1) as array: %2" ).arg( error.errorString(), json ) );
return result;
}
Q_FOREACH ( const QJsonValue cur, jsonDoc.array() )
Q_FOREACH ( const QJsonValue& cur, jsonDoc.array() )
{
QVariant curVariant = cur.toVariant();
if ( curVariant.convert( type ) )
@@ -308,4 +308,4 @@ QVariantList QgsJSONUtils::parseArray( const QString& json, QVariant::Type type
QgsLogger::warning( QString( "Cannot convert json array element: %1" ).arg( cur.toString() ) );
}
return result;
}
}
@@ -3293,7 +3293,7 @@ QDomElement QgsOgcUtilsSQLStatementToFilter::toOgcFilter( const QgsSQLStatement:
}

QList<QDomElement> listElem;
Q_FOREACH ( QString columnName, node->usingColumns() )
Q_FOREACH ( const QString& columnName, node->usingColumns() )
{
QDomElement eqElem = mDoc.createElement( mFilterPrefix + ":PropertyIsEqualTo" );
QDomElement propElem1 = mDoc.createElement( mFilterPrefix + ":" + mPropertyName );
@@ -3312,7 +3312,7 @@ QDomElement QgsOgcUtilsSQLStatementToFilter::toOgcFilter( const QgsSQLStatement:
else if ( listElem.size() > 1 )
{
QDomElement andElem = mDoc.createElement( mFilterPrefix + ":And" );
Q_FOREACH ( QDomElement elem, listElem )
Q_FOREACH ( const QDomElement& elem, listElem )
{
andElem.appendChild( elem );
}
@@ -3383,7 +3383,7 @@ QDomElement QgsOgcUtilsSQLStatementToFilter::toOgcFilter( const QgsSQLStatement:
else if ( listElem.size() > 1 )
{
QDomElement andElem = mDoc.createElement( mFilterPrefix + ":And" );
Q_FOREACH ( QDomElement elem, listElem )
Q_FOREACH ( const QDomElement& elem, listElem )
{
andElem.appendChild( elem );
}
@@ -231,7 +231,7 @@ bool QgsSQLStatement::doBasicValidationChecks( QString& errorMsgOut ) const
QgsSQLStatementCollectTableNames v;
mRootNode->accept( v );

Q_FOREACH ( QgsSQLStatementCollectTableNames::TableColumnPair pair, v.tableNamesReferenced )
Q_FOREACH ( const QgsSQLStatementCollectTableNames::TableColumnPair& pair, v.tableNamesReferenced )
{
if ( !v.tableNamesDeclared.contains( pair.first ) )
{
@@ -263,7 +263,7 @@ void QgsVectorFileWriter::init( QString vectorFileName,
{
QFileInfoList fileList = dir.entryInfoList(
QDir::NoDotAndDotDot | QDir::System | QDir::Hidden | QDir::AllDirs | QDir::Files, QDir::DirsFirst );
Q_FOREACH ( QFileInfo info, fileList )
Q_FOREACH ( const QFileInfo& info, fileList )
{
QFile::remove( info.absoluteFilePath() );
}
@@ -37,7 +37,7 @@ QVector<QgsDataItem*> QgsAfsRootItem::createChildren()
{
QVector<QgsDataItem*> connections;

foreach ( QString connName, QgsOwsConnection::connectionList( "ArcGisFeatureServer" ) )
Q_FOREACH ( const QString& connName, QgsOwsConnection::connectionList( "ArcGisFeatureServer" ) )
{
QgsOwsConnection connection( "ArcGisFeatureServer", connName );
QString path = "afs:/" + connName;
@@ -33,7 +33,7 @@ QVector<QgsDataItem*> QgsAmsRootItem::createChildren()
{
QVector<QgsDataItem*> connections;

foreach ( QString connName, QgsOwsConnection::connectionList( "ArcGisMapServer" ) )
Q_FOREACH ( const QString& connName, QgsOwsConnection::connectionList( "ArcGisMapServer" ) )
{
QgsOwsConnection connection( "ArcGisMapServer", connName );
QString path = "ams:/" + connName;
@@ -202,7 +202,7 @@ static QgsAbstractGeometry* parseEsriGeometryMultiPoint( const QVariantMap& geom
return nullptr;

QgsMultiPointV2* multiPoint = new QgsMultiPointV2();
foreach ( QVariant coordData, coordsList )
Q_FOREACH ( const QVariant& coordData, coordsList )
{
QVariantList coordList = coordData.toList();
QgsPointV2* p = parsePoint( coordList, pointType );
@@ -30,7 +30,7 @@ QgsWFSDataSourceURI::QgsWFSDataSourceURI( const QString& uri )
// Transform all param keys to lowercase
typedef QPair<QString, QString> queryItem;
QList<queryItem> items( url.queryItems() );
foreach ( queryItem item, items )
Q_FOREACH ( const queryItem& item, items )
{
url.removeQueryItem( item.first );
url.addQueryItem( item.first.toLower(), item.second );
@@ -410,7 +410,7 @@ bool QgsWFSProvider::processSQL( const QString& sqlString, QString& errorMsg, QS
}

QString concatenatedTypenames;
Q_FOREACH ( QString typeName, typenameList )
Q_FOREACH ( const QString& typeName, typenameList )
{
if ( !concatenatedTypenames.isEmpty() )
concatenatedTypenames += ",";
@@ -441,7 +441,7 @@ bool QgsWFSProvider::processSQL( const QString& sqlString, QString& errorMsg, QS
mShared->mLayerPropertiesList.clear();
QMap < QString, QgsFields > mapTypenameToFields;
QMap < QString, QString > mapTypenameToGeometryAttribute;
Q_FOREACH ( QString typeName, typenameList )
Q_FOREACH ( const QString& typeName, typenameList )
{
QString geometryAttribute;
QgsFields fields;
@@ -558,7 +558,7 @@ bool QgsWFSProvider::processSQL( const QString& sqlString, QString& errorMsg, QS
else
{
// * syntax
Q_FOREACH ( QString typeName, typenameList )
Q_FOREACH ( const QString& typeName, typenameList )
{
const QgsFields tableFields = mapTypenameToFields[typeName];
for ( int i = 0; i < tableFields.size();i++ )
@@ -383,7 +383,7 @@ bool QgsWFSSharedData::createCache()
{
mCacheTablename = "features";
sql = QString( "CREATE TABLE %1 (%2 INTEGER PRIMARY KEY" ).arg( mCacheTablename, fidName );
Q_FOREACH ( QgsField field, cacheFields )
Q_FOREACH ( const QgsField& field, cacheFields )
{
QString type( "VARCHAR" );
if ( field.type() == QVariant::Int )
@@ -830,7 +830,7 @@ void QgsWFSSharedData::serializeFeatures( QVector<QgsWFSFeatureGmlIdPair>& featu
QVector<QgsWFSFeatureGmlIdPair> updatedFeatureList;

QgsRectangle localComputedExtent( mComputedExtent );
Q_FOREACH ( QgsWFSFeatureGmlIdPair featPair, featureList )
Q_FOREACH ( const QgsWFSFeatureGmlIdPair& featPair, featureList )
{
const QgsFeature& gmlFeature = featPair.first;

0 comments on commit 06cf59a

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