Skip to content
Permalink
Browse files

Cleanups

  • Loading branch information
nyalldawson committed Mar 11, 2021
1 parent c578658 commit 59a2286eb7dd5db1858c752baba3a45fbda6c5bf
@@ -61,7 +61,7 @@ QgsOgrFeatureIterator::QgsOgrFeatureIterator( QgsOgrFeatureSource *source, bool
&& mRequest.filterType() != QgsFeatureRequest::FilterType::FilterFids );

QgsCPLHTTPFetchOverrider oCPLHTTPFetcher( mAuthCfg );
QgsSetCPLHTTPFetchOverriderInitiatorClass( oCPLHTTPFetcher, QStringLiteral( "QgsOgrFeatureIterator" ) );
QgsSetCPLHTTPFetchOverriderInitiatorClass( oCPLHTTPFetcher, QStringLiteral( "QgsOgrFeatureIterator" ) )

for ( const auto &id : mRequest.filterFids() )
{
@@ -155,6 +155,7 @@ QgsOgrFeatureIterator::QgsOgrFeatureIterator( QgsOgrFeatureSource *source, bool
{
QSet<int> attributeIndexes;
const auto usedAttributeIndices = mRequest.orderBy().usedAttributeIndices( mSource->mFields );
attributeIndexes.reserve( usedAttributeIndices.size() );
for ( int attrIdx : usedAttributeIndices )
{
attributeIndexes << attrIdx;
@@ -347,7 +348,7 @@ bool QgsOgrFeatureIterator::fetchFeature( QgsFeature &feature )
QMutexLocker locker( mSharedDS ? &mSharedDS->mutex() : nullptr );

QgsCPLHTTPFetchOverrider oCPLHTTPFetcher( mAuthCfg, mInterruptionChecker );
QgsSetCPLHTTPFetchOverriderInitiatorClass( oCPLHTTPFetcher, QStringLiteral( "QgsOgrFeatureIterator" ) );
QgsSetCPLHTTPFetchOverriderInitiatorClass( oCPLHTTPFetcher, QStringLiteral( "QgsOgrFeatureIterator" ) )

feature.setValid( false );

@@ -501,7 +502,7 @@ void QgsOgrFeatureIterator::getFeatureAttribute( OGRFeatureH ogrFet, QgsFeature
f.setAttribute( attindex, value );
}

bool QgsOgrFeatureIterator::readFeature( gdal::ogr_feature_unique_ptr fet, QgsFeature &feature ) const
bool QgsOgrFeatureIterator::readFeature( const gdal::ogr_feature_unique_ptr &fet, QgsFeature &feature ) const
{
feature.setId( OGR_F_GetFID( fet.get() ) );
feature.initAttributes( mSource->mFields.count() );
@@ -82,7 +82,7 @@ class QgsOgrFeatureIterator final: public QgsAbstractFeatureIteratorFromSource<Q

private:

bool readFeature( gdal::ogr_feature_unique_ptr fet, QgsFeature &feature ) const;
bool readFeature( const gdal::ogr_feature_unique_ptr &fet, QgsFeature &feature ) const;

//! Gets an attribute associated with a feature
void getFeatureAttribute( OGRFeatureH ogrFet, QgsFeature &f, int attindex ) const;

0 comments on commit 59a2286

Please sign in to comment.