Skip to content
Permalink
Browse files

fix precise build (+ foreach->Q_FOREACH)

  • Loading branch information
jef-n committed Dec 21, 2015
1 parent e19ad4b commit b508790cd93acaf9e203ebc5314d789ab4cf7b75
@@ -64,7 +64,7 @@ QgsVirtualLayerFeatureIterator::QgsVirtualLayerFeatureIterator( QgsVirtualLayerF
{
QString values = quotedColumn( mDefinition.uid() ) + " IN (";
bool first = true;
foreach ( auto& v, request.filterFids() )
Q_FOREACH ( const QgsFeatureId &v, request.filterFids() )

This comment has been minimized.

Copy link
@nyalldawson

nyalldawson Dec 21, 2015

Collaborator

just a note - I think this should be a copy, not a reference, since QgsFeatureId is an int64 and passing by value will be faster

{
if ( !first )
{
@@ -82,7 +82,7 @@ QgsVirtualLayerFeatureIterator::QgsVirtualLayerFeatureIterator( QgsVirtualLayerF
{

// copy only selected fields
foreach ( int idx, request.subsetOfAttributes() )
Q_FOREACH ( int idx, request.subsetOfAttributes() )
{
mAttributes << idx;
}
@@ -103,7 +103,7 @@ QgsVirtualLayerFeatureIterator::QgsVirtualLayerFeatureIterator( QgsVirtualLayerF
{
columns = "0";
}
foreach ( int i, mAttributes )
Q_FOREACH ( int i, mAttributes )
{
columns += ",";
QString cname = mFields.at( i ).name().toLower();
@@ -190,7 +190,7 @@ bool QgsVirtualLayerFeatureIterator::fetchFeature( QgsFeature& feature )

int n = mQuery->columnCount();
int i = 0;
foreach ( int idx, mAttributes )
Q_FOREACH ( int idx, mAttributes )
{
int type = mQuery->columnType( i + 1 );
switch ( type )
@@ -97,7 +97,7 @@ QgsVirtualLayerProvider::QgsVirtualLayerProvider( QString const &uri )

bool QgsVirtualLayerProvider::loadSourceLayers()
{
foreach ( const QgsVirtualLayerDefinition::SourceLayer& layer, mDefinition.sourceLayers() )
Q_FOREACH ( const QgsVirtualLayerDefinition::SourceLayer &layer, mDefinition.sourceLayers() )
{
if ( layer.isReferenced() )
{
@@ -221,7 +221,7 @@ bool QgsVirtualLayerProvider::createIt()
{

QStringList tables = referencedTables( mDefinition.query() );
foreach ( const QString& tname, tables )
Q_FOREACH ( const QString &tname, tables )
{
// is it in source layers ?
if ( mDefinition.hasSourceLayer( tname ) )
@@ -230,7 +230,7 @@ bool QgsVirtualLayerProvider::createIt()
}
// is it in loaded layers ?
bool found = false;
foreach ( const QgsMapLayer* l, QgsMapLayerRegistry::instance()->mapLayers() )
Q_FOREACH ( const QgsMapLayer *l, QgsMapLayerRegistry::instance()->mapLayers() )
{
if ( l->type() != QgsMapLayer::VectorLayer )
continue;
@@ -418,7 +418,7 @@ bool QgsVirtualLayerProvider::createIt()
mTableName = mLayers[0].name;

TableDef td = tableDefinitionFromVirtualTable( mSqlite.get(), mTableName );
foreach ( const ColumnDef& c, td )
Q_FOREACH ( const ColumnDef &c, td )
{
if ( !c.isGeometry() )
{

0 comments on commit b508790

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