Skip to content

Commit 8da06cb

Browse files
committedJan 26, 2013
QgsVectorLayer: deprecate old API: select(), nextFeature(), featureAtId()
1 parent 5ad61f5 commit 8da06cb

File tree

5 files changed

+6
-44
lines changed

5 files changed

+6
-44
lines changed
 

‎python/core/qgsvectordataprovider.sip

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,6 @@ class QgsVectorDataProvider : QgsDataProvider
5454
*/
5555
virtual QgsFeatureIterator getFeatures( const QgsFeatureRequest& request = QgsFeatureRequest() ) = 0;
5656

57-
// temporary
58-
QgsFeatureIterator select( QList<int> fetchAttributes = QList<int>(),
59-
QgsRectangle rect = QgsRectangle(),
60-
bool fetchGeometry = true,
61-
bool useIntersect = false ) /Deprecated/;
62-
6357
/**
6458
* Get feature type.
6559
* @return int representing the feature type

‎python/core/qgsvectorlayer.sip

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ class QgsVectorLayer : QgsMapLayer
302302
void select( QList<int> fetchAttributes,
303303
QgsRectangle rect = QgsRectangle(),
304304
bool fetchGeometry = true,
305-
bool useIntersect = false );
305+
bool useIntersect = false ) /Deprecated/;
306306

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

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

323323
/** Adds a feature
324324
@param f feature to add

‎src/core/qgsvectordataprovider.cpp

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -491,25 +491,4 @@ void QgsVectorDataProvider::pushError( QString msg )
491491
mErrors << msg;
492492
}
493493

494-
QgsFeatureIterator QgsVectorDataProvider::select( QgsAttributeList fetchAttributes,
495-
QgsRectangle rect,
496-
bool fetchGeometry,
497-
bool useIntersect )
498-
{
499-
qDebug( "OLD SELECT!" );
500-
501-
QgsFeatureRequest request;
502-
if ( !rect.isEmpty() )
503-
{
504-
request.setFilterRect( rect );
505-
}
506-
if ( !fetchGeometry )
507-
request.setFlags( QgsFeatureRequest::NoGeometry );
508-
if ( useIntersect )
509-
request.setFlags( request.flags() | QgsFeatureRequest::ExactIntersect );
510-
request.setSubsetOfAttributes( fetchAttributes );
511-
return getFeatures( request );
512-
}
513-
514-
515494
QStringList QgsVectorDataProvider::smEncodings;

‎src/core/qgsvectordataprovider.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,6 @@ class CORE_EXPORT QgsVectorDataProvider : public QgsDataProvider
111111
*/
112112
virtual QgsFeatureIterator getFeatures( const QgsFeatureRequest& request = QgsFeatureRequest() ) = 0;
113113

114-
// temporary
115-
QgsFeatureIterator select( QgsAttributeList fetchAttributes,
116-
QgsRectangle rect = QgsRectangle(),
117-
bool fetchGeometry = true,
118-
bool useIntersect = false );
119-
120114
/**
121115
* Get feature type.
122116
* @return int representing the feature type

‎src/core/qgsvectorlayer.h

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -448,16 +448,11 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
448448
* @param fetchGeometry fetch features with geometry
449449
* @param useIntersect fetch only features that actually intersect the window (not just the bounding box)
450450
*/
451-
void select( QgsAttributeList fetchAttributes,
451+
Q_DECL_DEPRECATED void select( QgsAttributeList fetchAttributes,
452452
QgsRectangle rect = QgsRectangle(),
453453
bool fetchGeometry = true,
454454
bool useIntersect = false );
455455

456-
/** Select features based on criteria specified in the request
457-
* @note added in 2.0
458-
*/
459-
//void select( const QgsFeatureRequest& request );
460-
461456
/**
462457
* Query the provider for features specified in request.
463458
*/
@@ -468,11 +463,11 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
468463
* @param feature buffer to read the feature into
469464
* @return true, if a feature was fetched, false, if there are no more features
470465
*/
471-
bool nextFeature( QgsFeature& feature );
466+
Q_DECL_DEPRECATED bool nextFeature( QgsFeature& feature );
472467

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

477472
/** Adds a feature
478473
@param f feature to add

0 commit comments

Comments
 (0)
Please sign in to comment.