83 changes: 68 additions & 15 deletions src/core/qgsvectorlayerfeatureiterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ QgsVectorLayerFeatureIterator::QgsVectorLayerFeatureIterator( QgsVectorLayer* la
{
QgsVectorLayerJoinBuffer* joinBuffer = L->mJoinBuffer;

// by default provider's request is the same
mProviderRequest = mRequest;
mChangedFeaturesRequest = mRequest;

if ( L->editBuffer() )
{
mAddedFeatures = QgsFeatureMap( L->editBuffer()->addedFeatures() );
Expand All @@ -33,15 +37,13 @@ QgsVectorLayerFeatureIterator::QgsVectorLayerFeatureIterator( QgsVectorLayer* la
mChangedAttributeValues = QgsChangedAttributesMap( L->editBuffer()->changedAttributeValues() );
mAddedAttributes = QList<QgsField>( L->editBuffer()->addedAttributes() );
mDeletedAttributeIds = QgsAttributeList( L->editBuffer()->deletedAttributeIds() );
mChangedFeaturesRequest.setFilterFids( L->editBuffer()->changedAttributeValues().keys().toSet() );
}

// prepare joins: may add more attributes to fetch (in order to allow join)
if ( joinBuffer->containsJoins() )
prepareJoins();

// by default provider's request is the same
mProviderRequest = mRequest;

if ( mProviderRequest.flags() & QgsFeatureRequest::SubsetOfAttributes )
{
// prepare list of attributes to match provider fields
Expand All @@ -65,10 +67,22 @@ QgsVectorLayerFeatureIterator::QgsVectorLayerFeatureIterator( QgsVectorLayer* la
}
else // no filter or filter by rect
{
mProviderIterator = L->dataProvider()->getFeatures( mProviderRequest );
if ( L->editBuffer() )
{
mChangedFeaturesIterator = L->dataProvider()->getFeatures( mChangedFeaturesRequest );
}
else
{
mProviderIterator = L->dataProvider()->getFeatures( mProviderRequest );
}

rewindEditBuffer();
}

if ( mRequest.filterType() == QgsFeatureRequest::FilterExpression )
{
mRequest.filterExpression()->prepare( L->pendingFields() );
}
}


Expand All @@ -79,7 +93,7 @@ QgsVectorLayerFeatureIterator::~QgsVectorLayerFeatureIterator()



bool QgsVectorLayerFeatureIterator::nextFeature( QgsFeature& f )
bool QgsVectorLayerFeatureIterator::fetchFeature( QgsFeature& f )
{
f.setValid( false );

Expand All @@ -99,8 +113,29 @@ bool QgsVectorLayerFeatureIterator::nextFeature( QgsFeature& f )
{
if ( fetchNextChangedGeomFeature( f ) )
return true;

// no more changed geometries
}

if ( mRequest.filterType() == QgsFeatureRequest::FilterExpression )
{
if ( fetchNextChangedAttributeFeature( f ) )
return true;

// no more changed features
}

while ( fetchNextAddedFeature( f ) )
{
return true;
}
// no more added features

if ( mProviderIterator.isClosed() )
{
mChangedFeaturesIterator.close();
mProviderIterator = L->dataProvider()->getFeatures( mProviderRequest );
}
// no more changed geometries

while ( mProviderIterator.nextFeature( f ) )
{
Expand All @@ -125,11 +160,6 @@ bool QgsVectorLayerFeatureIterator::nextFeature( QgsFeature& f )
}
// no more provider features

if ( fetchNextAddedFeature( f ) )
return true;
// no more added features


close();
return false;
}
Expand Down Expand Up @@ -178,17 +208,16 @@ bool QgsVectorLayerFeatureIterator::fetchNextAddedFeature( QgsFeature& f )
// must have changed geometry outside rectangle
continue;

if ( mRequest.filterType() == QgsFeatureRequest::FilterRect &&
mFetchAddedFeaturesIt->geometry() &&
!mFetchAddedFeaturesIt->geometry()->intersects( mRequest.filterRect() ) )
// skip added features not in rectangle
if ( !mRequest.acceptFeature ( *mFetchAddedFeaturesIt ) )
// skip features which are not accepted by the filter
continue;

useAddedFeature( *mFetchAddedFeaturesIt, f );

return true;
}

mFetchAddedFeaturesIt = mAddedFeatures.constBegin();
return false; // no more added features
}

Expand Down Expand Up @@ -239,6 +268,30 @@ bool QgsVectorLayerFeatureIterator::fetchNextChangedGeomFeature( QgsFeature& f )
return false; // no more changed geometries
}

bool QgsVectorLayerFeatureIterator::fetchNextChangedAttributeFeature( QgsFeature& f )
{
while ( mChangedFeaturesIterator.nextFeature( f ) )
{
mFetchConsidered << f.id();

updateChangedAttributes( f );

if ( mRequest.filterType() == QgsFeatureRequest::FilterExpression )
{
if ( mRequest.filterExpression()->evaluate( &f ).toBool() )
{
return true;
}
}
else
{
return true;
}
}

return false;
}


void QgsVectorLayerFeatureIterator::useChangedAttributeFeature( QgsFeatureId fid, const QgsGeometry& geom, QgsFeature& f )
{
Expand Down
13 changes: 10 additions & 3 deletions src/core/qgsvectorlayerfeatureiterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,26 @@ class CORE_EXPORT QgsVectorLayerFeatureIterator : public QgsAbstractFeatureItera

~QgsVectorLayerFeatureIterator();

//! fetch next feature, return true on success
virtual bool nextFeature( QgsFeature& feature );

//! reset the iterator to the starting position
virtual bool rewind();

//! end of iterating: free the resources / lock
virtual bool close();

protected:
//! fetch next feature, return true on success
virtual bool fetchFeature( QgsFeature& feature );

//! Overrides default method as we only need to filter features in the edit buffer
//! while for others filtering is left to the provider implementation.
inline virtual bool nextFeatureFilterExpression( QgsFeature &f ) { return fetchFeature( f ); }

QgsVectorLayer* L;

QgsFeatureRequest mProviderRequest;
QgsFeatureIterator mProviderIterator;
QgsFeatureRequest mChangedFeaturesRequest;
QgsFeatureIterator mChangedFeaturesIterator;

#if 0
// general stuff
Expand All @@ -67,6 +73,7 @@ class CORE_EXPORT QgsVectorLayerFeatureIterator : public QgsAbstractFeatureItera
void prepareJoins();
bool fetchNextAddedFeature( QgsFeature& f );
bool fetchNextChangedGeomFeature( QgsFeature& f );
bool fetchNextChangedAttributeFeature( QgsFeature& f );
void useAddedFeature( const QgsFeature& src, QgsFeature& f );
void useChangedAttributeFeature( QgsFeatureId fid, const QgsGeometry& geom, QgsFeature& f );
bool nextFeatureFid( QgsFeature& f );
Expand Down
5 changes: 5 additions & 0 deletions src/gui/attributetable/qgsattributetablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -642,3 +642,8 @@ void QgsAttributeTableModel::prefetchColumnData( int column )
mCachedField = fieldId;
}
}

void QgsAttributeTableModel::setRequest( const QgsFeatureRequest& request )
{
mFeatureRequest = request;
}
2 changes: 2 additions & 0 deletions src/gui/attributetable/qgsattributetablemodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ class GUI_EXPORT QgsAttributeTableModel: public QAbstractTableModel
*/
void prefetchColumnData( int column );

void setRequest( const QgsFeatureRequest& request );

signals:
/**
* Model has been changed
Expand Down
12 changes: 9 additions & 3 deletions src/gui/attributetable/qgsdualview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ QgsDualView::~QgsDualView()
delete mAttributeDialog;
}

void QgsDualView::init( QgsVectorLayer* layer, QgsMapCanvas* mapCanvas, QgsDistanceArea myDa )
void QgsDualView::init( QgsVectorLayer* layer, QgsMapCanvas* mapCanvas, QgsDistanceArea myDa, const QgsFeatureRequest &request )
{
mDistanceArea = myDa;

connect( mTableView, SIGNAL( willShowContextMenu( QMenu*, QModelIndex ) ), this, SLOT( viewWillShowContextMenu( QMenu*, QModelIndex ) ) );

initLayerCache( layer );
initModels( mapCanvas );
initModels( mapCanvas, request );

mTableView->setModel( mFilterModel );
mFeatureList->setModel( mFeatureListModel );
Expand Down Expand Up @@ -233,9 +233,10 @@ void QgsDualView::initLayerCache( QgsVectorLayer* layer )
connect( layer, SIGNAL( featureDeleted( QgsFeatureId ) ), this, SLOT( featureDeleted( QgsFeatureId ) ) );
}

void QgsDualView::initModels( QgsMapCanvas* mapCanvas )
void QgsDualView::initModels( QgsMapCanvas* mapCanvas, const QgsFeatureRequest& request )
{
mMasterModel = new QgsAttributeTableModel( mLayerCache, this );
mMasterModel->setRequest( request );

connect( mMasterModel, SIGNAL( progress( int, bool & ) ), this, SLOT( progress( int, bool & ) ) );
connect( mMasterModel, SIGNAL( finished() ), this, SLOT( finished() ) );
Expand Down Expand Up @@ -514,6 +515,11 @@ void QgsDualView::setFilteredFeatures( QgsFeatureIds filteredFeatures )
mFilterModel->setFilteredFeatures( filteredFeatures );
}

void QgsDualView::setRequest( const QgsFeatureRequest& request )
{
mMasterModel->setRequest( request );
}

void QgsDualView::progress( int i, bool& cancel )
{
if ( !mProgressDlg )
Expand Down
7 changes: 5 additions & 2 deletions src/gui/attributetable/qgsdualview.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ class GUI_EXPORT QgsDualView : public QStackedWidget, private Ui::QgsDualViewBas
* @param mapCanvas The mapCanvas (used for the FilterMode
* {@link QgsAttributeTableFilterModel::ShowVisible}
* @param myDa Used for attribute dialog creation
* @param request Use a modified request to limit the shown features
*/
void init( QgsVectorLayer* layer, QgsMapCanvas* mapCanvas, QgsDistanceArea myDa );
void init( QgsVectorLayer* layer, QgsMapCanvas* mapCanvas, QgsDistanceArea myDa, const QgsFeatureRequest& request = QgsFeatureRequest() );

/**
* Change the current view mode.
Expand Down Expand Up @@ -130,6 +131,8 @@ class GUI_EXPORT QgsDualView : public QStackedWidget, private Ui::QgsDualViewBas
*/
QgsAttributeTableModel* masterModel() const { return mMasterModel; }

void setRequest( const QgsFeatureRequest& request );

protected:
/**
* Initializes widgets which depend on the attributes of this layer
Expand Down Expand Up @@ -230,7 +233,7 @@ class GUI_EXPORT QgsDualView : public QStackedWidget, private Ui::QgsDualViewBas

private:
void initLayerCache( QgsVectorLayer *layer );
void initModels( QgsMapCanvas* mapCanvas );
void initModels( QgsMapCanvas* mapCanvas, const QgsFeatureRequest& request );

QgsAttributeTableModel* mMasterModel;
QgsAttributeTableFilterModel* mFilterModel;
Expand Down
3 changes: 2 additions & 1 deletion src/gui/qgsattributedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
int QgsAttributeDialog::smFormCounter = 0;

QgsAttributeDialog::QgsAttributeDialog( QgsVectorLayer *vl, QgsFeature *thepFeature, bool featureOwner, QgsDistanceArea myDa, QWidget* parent, bool showDialogButtons )
: mDialog( 0 )
: QObject( parent )
, mDialog( 0 )
, mSettingsPath( "/Windows/AttributeDialog/" )
, mLayer( vl )
, mFeature( thepFeature )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ QgsDelimitedTextFeatureIterator::~QgsDelimitedTextFeatureIterator()
close();
}

bool QgsDelimitedTextFeatureIterator::nextFeature( QgsFeature& feature )
bool QgsDelimitedTextFeatureIterator::fetchFeature( QgsFeature& feature )
{
// before we do anything else, assume that there's something wrong with
// the feature
Expand Down
6 changes: 3 additions & 3 deletions src/providers/delimitedtext/qgsdelimitedtextfeatureiterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ class QgsDelimitedTextFeatureIterator : public QgsAbstractFeatureIterator

~QgsDelimitedTextFeatureIterator();

//! fetch next feature, return true on success
virtual bool nextFeature( QgsFeature& feature );

//! reset the iterator to the starting position
virtual bool rewind();

Expand All @@ -58,6 +55,9 @@ class QgsDelimitedTextFeatureIterator : public QgsAbstractFeatureIterator
bool wantGeometry( QgsGeometry *geom ) const;

protected:
//! fetch next feature, return true on success
virtual bool fetchFeature( QgsFeature& feature );

QgsDelimitedTextProvider* P;
QList<QgsFeatureId> mFeatureIds;
IteratorMode mMode;
Expand Down
2 changes: 1 addition & 1 deletion src/providers/gpx/qgsgpxfeatureiterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ bool QgsGPXFeatureIterator::close()
return true;
}

bool QgsGPXFeatureIterator::nextFeature( QgsFeature& feature )
bool QgsGPXFeatureIterator::fetchFeature( QgsFeature& feature )
{
feature.setValid( false );

Expand Down
6 changes: 3 additions & 3 deletions src/providers/gpx/qgsgpxfeatureiterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ class QgsGPXFeatureIterator : public QgsAbstractFeatureIterator

~QgsGPXFeatureIterator();

//! fetch next feature, return true on success
virtual bool nextFeature( QgsFeature& feature );

//! reset the iterator to the starting position
virtual bool rewind();

Expand All @@ -39,6 +36,9 @@ class QgsGPXFeatureIterator : public QgsAbstractFeatureIterator

protected:

//! fetch next feature, return true on success
virtual bool fetchFeature( QgsFeature& feature );

bool readFid( QgsFeature& feature );

bool readWaypoint( const QgsWaypoint& wpt, QgsFeature& feature );
Expand Down
2 changes: 1 addition & 1 deletion src/providers/grass/qgsgrassfeatureiterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ QgsGrassFeatureIterator::~QgsGrassFeatureIterator()
close();
}

bool QgsGrassFeatureIterator::nextFeature( QgsFeature& feature )
bool QgsGrassFeatureIterator::fetchFeature( QgsFeature& feature )
{
if ( mClosed )
return false;
Expand Down
2 changes: 1 addition & 1 deletion src/providers/grass/qgsgrassfeatureiterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class QgsGrassFeatureIterator : public QgsAbstractFeatureIterator
~QgsGrassFeatureIterator();

//! fetch next feature, return true on success
virtual bool nextFeature( QgsFeature& feature );
virtual bool fetchFeature( QgsFeature& feature );

//! reset the iterator to the starting position
virtual bool rewind();
Expand Down
2 changes: 1 addition & 1 deletion src/providers/memory/qgsmemoryfeatureiterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ QgsMemoryFeatureIterator::~QgsMemoryFeatureIterator()
}


bool QgsMemoryFeatureIterator::nextFeature( QgsFeature& feature )
bool QgsMemoryFeatureIterator::fetchFeature( QgsFeature& feature )
{
feature.setValid( false );

Expand Down
6 changes: 3 additions & 3 deletions src/providers/memory/qgsmemoryfeatureiterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ class QgsMemoryFeatureIterator : public QgsAbstractFeatureIterator

~QgsMemoryFeatureIterator();

//! fetch next feature, return true on success
virtual bool nextFeature( QgsFeature& feature );

//! reset the iterator to the starting position
virtual bool rewind();

Expand All @@ -40,6 +37,9 @@ class QgsMemoryFeatureIterator : public QgsAbstractFeatureIterator

protected:

//! fetch next feature, return true on success
virtual bool fetchFeature( QgsFeature& feature );

bool nextFeatureUsingList( QgsFeature& feature );
bool nextFeatureTraverseAll( QgsFeature& feature );

Expand Down
2 changes: 1 addition & 1 deletion src/providers/mssql/qgsmssqlfeatureiterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ void QgsMssqlFeatureIterator::BuildStatement( const QgsFeatureRequest& request )
}


bool QgsMssqlFeatureIterator::nextFeature( QgsFeature& feature )
bool QgsMssqlFeatureIterator::fetchFeature( QgsFeature& feature )
{
feature.setValid( false );

Expand Down
6 changes: 3 additions & 3 deletions src/providers/mssql/qgsmssqlfeatureiterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ class QgsMssqlFeatureIterator : public QgsAbstractFeatureIterator

~QgsMssqlFeatureIterator();

//! fetch next feature, return true on success
virtual bool nextFeature( QgsFeature& feature );

//! reset the iterator to the starting position
virtual bool rewind();

Expand All @@ -48,6 +45,9 @@ class QgsMssqlFeatureIterator : public QgsAbstractFeatureIterator
void BuildStatement( const QgsFeatureRequest& request );

private:
//! fetch next feature, return true on success
virtual bool fetchFeature( QgsFeature& feature );

// The current database
QSqlDatabase mDatabase;

Expand Down
2 changes: 1 addition & 1 deletion src/providers/ogr/qgsogrfeatureiterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ void QgsOgrFeatureIterator::ensureRelevantFields()
}


bool QgsOgrFeatureIterator::nextFeature( QgsFeature& feature )
bool QgsOgrFeatureIterator::fetchFeature( QgsFeature& feature )
{
feature.setValid( false );

Expand Down
6 changes: 3 additions & 3 deletions src/providers/ogr/qgsogrfeatureiterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ class QgsOgrFeatureIterator : public QgsAbstractFeatureIterator

~QgsOgrFeatureIterator();

//! fetch next feature, return true on success
virtual bool nextFeature( QgsFeature& feature );

//! reset the iterator to the starting position
virtual bool rewind();

//! end of iterating: free the resources / lock
virtual bool close();

protected:
//! fetch next feature, return true on success
virtual bool fetchFeature( QgsFeature& feature );

QgsOgrProvider* P;

void ensureRelevantFields();
Expand Down
1 change: 1 addition & 0 deletions src/providers/ogr/qgsogrprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ QgsOgrProvider::QgsOgrProvider( QString const & uri )
// If there is no & in the uri, then the uri is just the filename. The loaded
// layer will be layer 0.
//this is not true for geojson

if ( !uri.contains( '|', Qt::CaseSensitive ) )
{
mFilePath = uri;
Expand Down
7 changes: 6 additions & 1 deletion src/providers/postgres/qgspostgresfeatureiterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ QgsPostgresFeatureIterator::QgsPostgresFeatureIterator( QgsPostgresProvider* p,
{
whereClause = P->whereClause( request.filterFid() );
}
else if ( request.filterType() == QgsFeatureRequest::FilterFids )
{
whereClause = P->whereClause( request.filterFids() );
}

if ( !P->mSqlWhereClause.isEmpty() )
{
Expand All @@ -86,7 +90,7 @@ QgsPostgresFeatureIterator::~QgsPostgresFeatureIterator()
}


bool QgsPostgresFeatureIterator::nextFeature( QgsFeature& feature )
bool QgsPostgresFeatureIterator::fetchFeature( QgsFeature& feature )
{
feature.setValid( false );

Expand Down Expand Up @@ -162,6 +166,7 @@ bool QgsPostgresFeatureIterator::nextFeature( QgsFeature& feature )

feature.setValid( true );
feature.setFields( &P->mAttributeFields ); // allow name-based attribute lookups

return true;
}

Expand Down
8 changes: 5 additions & 3 deletions src/providers/postgres/qgspostgresfeatureiterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,25 @@ class QgsPostgresFeatureIterator : public QgsAbstractFeatureIterator

~QgsPostgresFeatureIterator();

//! fetch next feature, return true on success
virtual bool nextFeature( QgsFeature& feature );

//! reset the iterator to the starting position
virtual bool rewind();

//! end of iterating: free the resources / lock
virtual bool close();

protected:
//! fetch next feature, return true on success
virtual bool fetchFeature( QgsFeature& feature );

QgsPostgresProvider* P;

QString whereClauseRect();
bool getFeature( QgsPostgresResult &queryResult, int row, QgsFeature &feature );
void getFeatureAttribute( int idx, QgsPostgresResult& queryResult, int row, int& col, QgsFeature& feature );
bool declareCursor( const QString& whereClause );

bool fetchNextFeature( QgsFeature& feature );

QString mCursorName;

/**
Expand Down
15 changes: 9 additions & 6 deletions src/providers/postgres/qgspostgresprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -510,15 +510,18 @@ QString QgsPostgresProvider::whereClause( QgsFeatureId featureId ) const
break;
}

if ( !mSqlWhereClause.isEmpty() )
{
if ( !whereClause.isEmpty() )
whereClause += " AND ";
return whereClause;
}

whereClause += "(" + mSqlWhereClause + ")";
QString QgsPostgresProvider::whereClause( QgsFeatureIds featureIds ) const
{
QStringList whereClauses;
foreach ( const QgsFeatureId featureId, featureIds )
{
whereClauses << whereClause( featureId );
}

return whereClause;
return whereClauses.join( " AND " );
}

QString QgsPostgresProvider::filterWhereClause() const
Expand Down
1 change: 1 addition & 0 deletions src/providers/postgres/qgspostgresprovider.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ class QgsPostgresProvider : public QgsVectorDataProvider
*/
QString pkParamWhereClause( int offset, const char* alias = 0 ) const;
QString whereClause( QgsFeatureId featureId ) const;
QString whereClause( QgsFeatureIds featureIds ) const;
QString filterWhereClause() const;

bool hasSufficientPermsAndCapabilities();
Expand Down
2 changes: 1 addition & 1 deletion src/providers/spatialite/qgsspatialitefeatureiterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ QgsSpatiaLiteFeatureIterator::~QgsSpatiaLiteFeatureIterator()
}


bool QgsSpatiaLiteFeatureIterator::nextFeature( QgsFeature& feature )
bool QgsSpatiaLiteFeatureIterator::fetchFeature( QgsFeature& feature )
{
if ( mClosed )
return false;
Expand Down
7 changes: 4 additions & 3 deletions src/providers/spatialite/qgsspatialitefeatureiterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,17 @@ class QgsSpatiaLiteFeatureIterator : public QgsAbstractFeatureIterator

~QgsSpatiaLiteFeatureIterator();

//! fetch next feature, return true on success
virtual bool nextFeature( QgsFeature& feature );

//! reset the iterator to the starting position
virtual bool rewind();

//! end of iterating: free the resources / lock
virtual bool close();

protected:

//! fetch next feature, return true on success
virtual bool fetchFeature( QgsFeature& feature );

QgsSpatiaLiteProvider* P;

QString whereClauseRect();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ QgsSqlAnywhereFeatureIterator::~QgsSqlAnywhereFeatureIterator()
}

bool
QgsSqlAnywhereFeatureIterator::nextFeature( QgsFeature& feature )
QgsSqlAnywhereFeatureIterator::fetchFeature( QgsFeature& feature )
{
if ( mClosed )
return false;
Expand Down
6 changes: 4 additions & 2 deletions src/providers/sqlanywhere/qgssqlanywherefeatureiterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ class QgsSqlAnywhereFeatureIterator : public QgsAbstractFeatureIterator

~QgsSqlAnywhereFeatureIterator();

//! fetch next feature, return true on success
virtual bool nextFeature( QgsFeature& feature );
bool nextFeature( QgsFeature& feature, SqlAnyStatement *stmt );

//! reset the iterator to the starting position
Expand All @@ -42,6 +40,10 @@ class QgsSqlAnywhereFeatureIterator : public QgsAbstractFeatureIterator
virtual bool close();

protected:

//! fetch next feature, return true on success
virtual bool fetchFeature( QgsFeature& feature );

QgsSqlAnywhereProvider* P;

private:
Expand Down
2 changes: 1 addition & 1 deletion src/providers/wfs/qgswfsfeatureiterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ QgsWFSFeatureIterator::~QgsWFSFeatureIterator()
close();
}

bool QgsWFSFeatureIterator::nextFeature( QgsFeature& f )
bool QgsWFSFeatureIterator::fetchFeature( QgsFeature& f )
{
if ( !mProvider )
{
Expand Down
4 changes: 3 additions & 1 deletion src/providers/wfs/qgswfsfeatureiterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ class QgsWFSFeatureIterator: public QgsAbstractFeatureIterator
QgsWFSFeatureIterator( QgsWFSProvider* provider, const QgsFeatureRequest& request );
~QgsWFSFeatureIterator();

bool nextFeature( QgsFeature& f );
bool rewind();
bool close();

protected:
bool fetchFeature( QgsFeature& f );

private:
QgsWFSProvider* mProvider;
QList<QgsFeatureId> mSelectedFeatures;
Expand Down