mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-18 00:03:05 -04:00
API Cleanup: Use begin() instead of reset() to move to start of selected features
git-svn-id: http://svn.osgeo.org/qgis/trunk@9447 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
8892abffb9
commit
107a21bfd0
@ -112,7 +112,7 @@ class QgsVectorDataProvider : QgsDataProvider
|
|||||||
virtual QString dataComment() const;
|
virtual QString dataComment() const;
|
||||||
|
|
||||||
/** Restart reading features from previous select operation */
|
/** Restart reading features from previous select operation */
|
||||||
virtual void reset() = 0;
|
virtual void begin() = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the minimum value of an attributs
|
* Returns the minimum value of an attributs
|
||||||
|
@ -155,7 +155,7 @@ class CORE_EXPORT QgsVectorDataProvider : public QgsDataProvider
|
|||||||
virtual QString dataComment() const;
|
virtual QString dataComment() const;
|
||||||
|
|
||||||
/** Restart reading features from previous select operation */
|
/** Restart reading features from previous select operation */
|
||||||
virtual void reset() = 0;
|
virtual void begin() = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the minimum value of an attribute
|
* Returns the minimum value of an attribute
|
||||||
|
@ -434,7 +434,7 @@ void QgsDelimitedTextProvider::select( QgsAttributeList fetchAttributes,
|
|||||||
{
|
{
|
||||||
mSelectionRectangle = rect;
|
mSelectionRectangle = rect;
|
||||||
}
|
}
|
||||||
reset();
|
begin();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -476,7 +476,7 @@ const QgsFieldMap & QgsDelimitedTextProvider::fields() const
|
|||||||
return attributeFields;
|
return attributeFields;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QgsDelimitedTextProvider::reset()
|
void QgsDelimitedTextProvider::begin()
|
||||||
{
|
{
|
||||||
// Reset feature id to 0
|
// Reset feature id to 0
|
||||||
mFid = 0;
|
mFid = 0;
|
||||||
|
@ -103,7 +103,7 @@ class QgsDelimitedTextProvider : public QgsVectorDataProvider
|
|||||||
virtual const QgsFieldMap & fields() const;
|
virtual const QgsFieldMap & fields() const;
|
||||||
|
|
||||||
/** Restart reading features from previous select operation */
|
/** Restart reading features from previous select operation */
|
||||||
virtual void reset();
|
virtual void begin();
|
||||||
|
|
||||||
/** Returns a bitmask containing the supported capabilities
|
/** Returns a bitmask containing the supported capabilities
|
||||||
Note, some capabilities may change depending on whether
|
Note, some capabilities may change depending on whether
|
||||||
|
@ -381,7 +381,7 @@ void QgsGPXProvider::select( QgsAttributeList fetchAttributes,
|
|||||||
mAttributesToFetch = fetchAttributes;
|
mAttributesToFetch = fetchAttributes;
|
||||||
mFetchGeom = fetchGeometry;
|
mFetchGeom = fetchGeometry;
|
||||||
|
|
||||||
reset();
|
begin();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -438,7 +438,7 @@ const QgsFieldMap& QgsGPXProvider::fields() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void QgsGPXProvider::reset()
|
void QgsGPXProvider::begin()
|
||||||
{
|
{
|
||||||
if ( mFeatureType == WaypointType )
|
if ( mFeatureType == WaypointType )
|
||||||
mWptIter = data->waypointsBegin();
|
mWptIter = data->waypointsBegin();
|
||||||
|
@ -93,7 +93,7 @@ class QgsGPXProvider : public QgsVectorDataProvider
|
|||||||
virtual const QgsFieldMap & fields() const;
|
virtual const QgsFieldMap & fields() const;
|
||||||
|
|
||||||
/** Restart reading features from previous select operation */
|
/** Restart reading features from previous select operation */
|
||||||
virtual void reset();
|
virtual void begin();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds a list of features
|
* Adds a list of features
|
||||||
|
@ -557,7 +557,7 @@ int QgsGrassProvider::keyField()
|
|||||||
return mLayers[mLayerId].keyColumn;
|
return mLayers[mLayerId].keyColumn;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QgsGrassProvider::reset()
|
void QgsGrassProvider::begin()
|
||||||
{
|
{
|
||||||
if ( isEdited() || isFrozen() || !mValid )
|
if ( isEdited() || isFrozen() || !mValid )
|
||||||
return;
|
return;
|
||||||
|
@ -175,7 +175,7 @@ class GRASS_EXPORT QgsGrassProvider : public QgsVectorDataProvider
|
|||||||
int keyField();
|
int keyField();
|
||||||
|
|
||||||
/** Restart reading features from previous select operation */
|
/** Restart reading features from previous select operation */
|
||||||
void reset();
|
void begin();
|
||||||
|
|
||||||
/** Returns the minimum value of an attributs
|
/** Returns the minimum value of an attributs
|
||||||
* @param index the index of the attribute */
|
* @param index the index of the attribute */
|
||||||
|
@ -175,10 +175,10 @@ void QgsMemoryProvider::select( QgsAttributeList fetchAttributes,
|
|||||||
mSelectSI_Features.clear();
|
mSelectSI_Features.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
reset();
|
begin();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QgsMemoryProvider::reset()
|
void QgsMemoryProvider::begin()
|
||||||
{
|
{
|
||||||
if ( mSelectUsingSpatialIndex )
|
if ( mSelectUsingSpatialIndex )
|
||||||
mSelectSI_Iterator = mSelectSI_Features.begin();
|
mSelectSI_Iterator = mSelectSI_Features.begin();
|
||||||
|
@ -93,7 +93,7 @@ class QgsMemoryProvider : public QgsVectorDataProvider
|
|||||||
virtual const QgsFieldMap & fields() const;
|
virtual const QgsFieldMap & fields() const;
|
||||||
|
|
||||||
/** Restart reading features from previous select operation */
|
/** Restart reading features from previous select operation */
|
||||||
virtual void reset();
|
virtual void begin();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -455,7 +455,7 @@ const QgsFieldMap & QgsOgrProvider::fields() const
|
|||||||
return mAttributeFields;
|
return mAttributeFields;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QgsOgrProvider::reset()
|
void QgsOgrProvider::begin()
|
||||||
{
|
{
|
||||||
OGR_L_ResetReading( ogrLayer );
|
OGR_L_ResetReading( ogrLayer );
|
||||||
}
|
}
|
||||||
|
@ -120,7 +120,7 @@ class QgsOgrProvider : public QgsVectorDataProvider
|
|||||||
virtual QgsRect extent();
|
virtual QgsRect extent();
|
||||||
|
|
||||||
/** Restart reading features from previous select operation */
|
/** Restart reading features from previous select operation */
|
||||||
virtual void reset();
|
virtual void begin();
|
||||||
|
|
||||||
/**Writes a list of features to the file*/
|
/**Writes a list of features to the file*/
|
||||||
virtual bool addFeatures( QgsFeatureList & flist );
|
virtual bool addFeatures( QgsFeatureList & flist );
|
||||||
|
@ -720,7 +720,7 @@ QString QgsPostgresProvider::dataComment() const
|
|||||||
return mDataComment;
|
return mDataComment;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QgsPostgresProvider::reset()
|
void QgsPostgresProvider::begin()
|
||||||
{
|
{
|
||||||
if ( mFetching )
|
if ( mFetching )
|
||||||
{
|
{
|
||||||
@ -1876,7 +1876,7 @@ bool QgsPostgresProvider::addFeatures( QgsFeatureList & flist )
|
|||||||
returnvalue = false;
|
returnvalue = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
reset();
|
begin();
|
||||||
return returnvalue;
|
return returnvalue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1914,7 +1914,7 @@ bool QgsPostgresProvider::deleteFeatures( const QgsFeatureIds & id )
|
|||||||
connectionRW->PQexecNR( "ROLLBACK" );
|
connectionRW->PQexecNR( "ROLLBACK" );
|
||||||
returnvalue = false;
|
returnvalue = false;
|
||||||
}
|
}
|
||||||
reset();
|
begin();
|
||||||
return returnvalue;
|
return returnvalue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1953,7 +1953,7 @@ bool QgsPostgresProvider::addAttributes( const QgsNewAttributesMap & name )
|
|||||||
returnvalue = false;
|
returnvalue = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
reset();
|
begin();
|
||||||
return returnvalue;
|
return returnvalue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1998,7 +1998,7 @@ bool QgsPostgresProvider::deleteAttributes( const QgsAttributeIds& ids )
|
|||||||
returnvalue = false;
|
returnvalue = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
reset();
|
begin();
|
||||||
return returnvalue;
|
return returnvalue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2068,7 +2068,7 @@ bool QgsPostgresProvider::changeAttributeValues( const QgsChangedAttributesMap &
|
|||||||
returnvalue = false;
|
returnvalue = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
reset();
|
begin();
|
||||||
|
|
||||||
return returnvalue;
|
return returnvalue;
|
||||||
}
|
}
|
||||||
@ -2148,7 +2148,7 @@ bool QgsPostgresProvider::changeGeometryValues( QgsGeometryMap & geometry_map )
|
|||||||
returnvalue = false;
|
returnvalue = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
reset();
|
begin();
|
||||||
|
|
||||||
QgsDebugMsg( "exiting." );
|
QgsDebugMsg( "exiting." );
|
||||||
|
|
||||||
|
@ -176,7 +176,7 @@ class QgsPostgresProvider : public QgsVectorDataProvider
|
|||||||
/** Reset the layer - for a PostgreSQL layer, this means clearing the PQresult
|
/** Reset the layer - for a PostgreSQL layer, this means clearing the PQresult
|
||||||
* pointer, setting it to 0 and reloading the field list
|
* pointer, setting it to 0 and reloading the field list
|
||||||
*/
|
*/
|
||||||
void reset();
|
void begin();
|
||||||
|
|
||||||
/** Returns the minimum value of an attribute
|
/** Returns the minimum value of an attribute
|
||||||
* @param index the index of the attribute */
|
* @param index the index of the attribute */
|
||||||
|
@ -130,7 +130,7 @@ const QgsFieldMap & QgsWFSProvider::fields() const
|
|||||||
return mFields;
|
return mFields;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QgsWFSProvider::reset()
|
void QgsWFSProvider::begin()
|
||||||
{
|
{
|
||||||
mFeatureIterator = mSelectedFeatures.begin();
|
mFeatureIterator = mSelectedFeatures.begin();
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,7 @@ class QgsWFSProvider: public QgsVectorDataProvider
|
|||||||
long featureCount() const;
|
long featureCount() const;
|
||||||
uint fieldCount() const;
|
uint fieldCount() const;
|
||||||
const QgsFieldMap & fields() const;
|
const QgsFieldMap & fields() const;
|
||||||
void reset();
|
void begin();
|
||||||
|
|
||||||
virtual QgsCoordinateReferenceSystem getCRS();
|
virtual QgsCoordinateReferenceSystem getCRS();
|
||||||
|
|
||||||
@ -114,7 +114,7 @@ class QgsWFSProvider: public QgsVectorDataProvider
|
|||||||
QgsSpatialIndex *mSpatialIndex;
|
QgsSpatialIndex *mSpatialIndex;
|
||||||
/**Vector where the ids of the selected features are inserted*/
|
/**Vector where the ids of the selected features are inserted*/
|
||||||
QList<int> mSelectedFeatures;
|
QList<int> mSelectedFeatures;
|
||||||
/**Iterator on the feature vector for use in reset(), getNextFeature(), etc...*/
|
/**Iterator on the feature vector for use in begin(), getNextFeature(), etc...*/
|
||||||
QList<int>::iterator mFeatureIterator;
|
QList<int>::iterator mFeatureIterator;
|
||||||
/**Vector where the features are inserted*/
|
/**Vector where the features are inserted*/
|
||||||
QList<QgsFeature*> mFeatures;
|
QList<QgsFeature*> mFeatures;
|
||||||
|
@ -1666,7 +1666,7 @@ QgsRect QgsWmsProvider::extent()
|
|||||||
return layerExtent;
|
return layerExtent;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QgsWmsProvider::reset()
|
void QgsWmsProvider::begin()
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
@ -449,7 +449,7 @@ class QgsWmsProvider : public QgsRasterDataProvider
|
|||||||
/** Reset the layer - for a PostgreSQL layer, this means clearing the PQresult
|
/** Reset the layer - for a PostgreSQL layer, this means clearing the PQresult
|
||||||
* pointer and setting it to 0
|
* pointer and setting it to 0
|
||||||
*/
|
*/
|
||||||
void reset();
|
void begin();
|
||||||
|
|
||||||
/**Returns true if layer is valid
|
/**Returns true if layer is valid
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user