Skip to content

Commit

Permalink
QgsVectorLayer: deprecate old API: select(), nextFeature(), featureAt…
Browse files Browse the repository at this point in the history
…Id()
  • Loading branch information
wonder-sk committed Jan 26, 2013
1 parent 5ad61f5 commit 8da06cb
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 44 deletions.
6 changes: 0 additions & 6 deletions python/core/qgsvectordataprovider.sip
Expand Up @@ -54,12 +54,6 @@ class QgsVectorDataProvider : QgsDataProvider
*/
virtual QgsFeatureIterator getFeatures( const QgsFeatureRequest& request = QgsFeatureRequest() ) = 0;

// temporary
QgsFeatureIterator select( QList<int> fetchAttributes = QList<int>(),
QgsRectangle rect = QgsRectangle(),
bool fetchGeometry = true,
bool useIntersect = false ) /Deprecated/;

/**
* Get feature type.
* @return int representing the feature type
Expand Down
6 changes: 3 additions & 3 deletions python/core/qgsvectorlayer.sip
Expand Up @@ -302,7 +302,7 @@ class QgsVectorLayer : QgsMapLayer
void select( QList<int> fetchAttributes,
QgsRectangle rect = QgsRectangle(),
bool fetchGeometry = true,
bool useIntersect = false );
bool useIntersect = false ) /Deprecated/;

/**
* Query the provider for features specified in request.
Expand All @@ -314,11 +314,11 @@ class QgsVectorLayer : QgsMapLayer
* @param feature buffer to read the feature into
* @return true, if a feature was fetched, false, if there are no more features
*/
bool nextFeature( QgsFeature& feature );
bool nextFeature( QgsFeature& feature ) /Deprecated/;

/**Gets the feature at the given feature id. Considers the changed, added, deleted and permanent features
@return true in case of success*/
bool featureAtId( QgsFeatureId featureId, QgsFeature &f, bool fetchGeometries = true, bool fetchAttributes = true );
bool featureAtId( QgsFeatureId featureId, QgsFeature &f, bool fetchGeometries = true, bool fetchAttributes = true ) /Deprecated/;

/** Adds a feature
@param f feature to add
Expand Down
21 changes: 0 additions & 21 deletions src/core/qgsvectordataprovider.cpp
Expand Up @@ -491,25 +491,4 @@ void QgsVectorDataProvider::pushError( QString msg )
mErrors << msg;
}

QgsFeatureIterator QgsVectorDataProvider::select( QgsAttributeList fetchAttributes,
QgsRectangle rect,
bool fetchGeometry,
bool useIntersect )
{
qDebug( "OLD SELECT!" );

QgsFeatureRequest request;
if ( !rect.isEmpty() )
{
request.setFilterRect( rect );
}
if ( !fetchGeometry )
request.setFlags( QgsFeatureRequest::NoGeometry );
if ( useIntersect )
request.setFlags( request.flags() | QgsFeatureRequest::ExactIntersect );
request.setSubsetOfAttributes( fetchAttributes );
return getFeatures( request );
}


QStringList QgsVectorDataProvider::smEncodings;
6 changes: 0 additions & 6 deletions src/core/qgsvectordataprovider.h
Expand Up @@ -111,12 +111,6 @@ class CORE_EXPORT QgsVectorDataProvider : public QgsDataProvider
*/
virtual QgsFeatureIterator getFeatures( const QgsFeatureRequest& request = QgsFeatureRequest() ) = 0;

// temporary
QgsFeatureIterator select( QgsAttributeList fetchAttributes,
QgsRectangle rect = QgsRectangle(),
bool fetchGeometry = true,
bool useIntersect = false );

/**
* Get feature type.
* @return int representing the feature type
Expand Down
11 changes: 3 additions & 8 deletions src/core/qgsvectorlayer.h
Expand Up @@ -448,16 +448,11 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
* @param fetchGeometry fetch features with geometry
* @param useIntersect fetch only features that actually intersect the window (not just the bounding box)
*/
void select( QgsAttributeList fetchAttributes,
Q_DECL_DEPRECATED void select( QgsAttributeList fetchAttributes,
QgsRectangle rect = QgsRectangle(),
bool fetchGeometry = true,
bool useIntersect = false );

/** Select features based on criteria specified in the request
* @note added in 2.0
*/
//void select( const QgsFeatureRequest& request );

/**
* Query the provider for features specified in request.
*/
Expand All @@ -468,11 +463,11 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
* @param feature buffer to read the feature into
* @return true, if a feature was fetched, false, if there are no more features
*/
bool nextFeature( QgsFeature& feature );
Q_DECL_DEPRECATED bool nextFeature( QgsFeature& feature );

/**Gets the feature at the given feature id. Considers the changed, added, deleted and permanent features
@return true in case of success*/
bool featureAtId( QgsFeatureId featureId, QgsFeature &f, bool fetchGeometries = true, bool fetchAttributes = true );
Q_DECL_DEPRECATED bool featureAtId( QgsFeatureId featureId, QgsFeature &f, bool fetchGeometries = true, bool fetchAttributes = true );

/** Adds a feature
@param f feature to add
Expand Down

0 comments on commit 8da06cb

Please sign in to comment.