Skip to content

Commit

Permalink
API Cleanup: Use begin() instead of reset() to move to start of selec…
Browse files Browse the repository at this point in the history
…ted features

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@9447 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Oct 6, 2008
1 parent 8e087f5 commit 23566c3
Show file tree
Hide file tree
Showing 18 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion python/core/qgsvectordataprovider.sip
Expand Up @@ -112,7 +112,7 @@ class QgsVectorDataProvider : QgsDataProvider
virtual QString dataComment() const;

/** Restart reading features from previous select operation */
virtual void reset() = 0;
virtual void begin() = 0;

/**
* Returns the minimum value of an attributs
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsvectordataprovider.h
Expand Up @@ -155,7 +155,7 @@ class CORE_EXPORT QgsVectorDataProvider : public QgsDataProvider
virtual QString dataComment() const;

/** Restart reading features from previous select operation */
virtual void reset() = 0;
virtual void begin() = 0;

/**
* Returns the minimum value of an attribute
Expand Down
4 changes: 2 additions & 2 deletions src/providers/delimitedtext/qgsdelimitedtextprovider.cpp
Expand Up @@ -434,7 +434,7 @@ void QgsDelimitedTextProvider::select( QgsAttributeList fetchAttributes,
{
mSelectionRectangle = rect;
}
reset();
begin();
}


Expand Down Expand Up @@ -476,7 +476,7 @@ const QgsFieldMap & QgsDelimitedTextProvider::fields() const
return attributeFields;
}

void QgsDelimitedTextProvider::reset()
void QgsDelimitedTextProvider::begin()
{
// Reset feature id to 0
mFid = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/providers/delimitedtext/qgsdelimitedtextprovider.h
Expand Up @@ -103,7 +103,7 @@ class QgsDelimitedTextProvider : public QgsVectorDataProvider
virtual const QgsFieldMap & fields() const;

/** Restart reading features from previous select operation */
virtual void reset();
virtual void begin();

/** Returns a bitmask containing the supported capabilities
Note, some capabilities may change depending on whether
Expand Down
4 changes: 2 additions & 2 deletions src/providers/gpx/qgsgpxprovider.cpp
Expand Up @@ -381,7 +381,7 @@ void QgsGPXProvider::select( QgsAttributeList fetchAttributes,
mAttributesToFetch = fetchAttributes;
mFetchGeom = fetchGeometry;

reset();
begin();
}


Expand Down Expand Up @@ -438,7 +438,7 @@ const QgsFieldMap& QgsGPXProvider::fields() const
}


void QgsGPXProvider::reset()
void QgsGPXProvider::begin()
{
if ( mFeatureType == WaypointType )
mWptIter = data->waypointsBegin();
Expand Down
2 changes: 1 addition & 1 deletion src/providers/gpx/qgsgpxprovider.h
Expand Up @@ -93,7 +93,7 @@ class QgsGPXProvider : public QgsVectorDataProvider
virtual const QgsFieldMap & fields() const;

/** Restart reading features from previous select operation */
virtual void reset();
virtual void begin();

/**
* Adds a list of features
Expand Down
2 changes: 1 addition & 1 deletion src/providers/grass/qgsgrassprovider.cpp
Expand Up @@ -557,7 +557,7 @@ int QgsGrassProvider::keyField()
return mLayers[mLayerId].keyColumn;
}

void QgsGrassProvider::reset()
void QgsGrassProvider::begin()
{
if ( isEdited() || isFrozen() || !mValid )
return;
Expand Down
2 changes: 1 addition & 1 deletion src/providers/grass/qgsgrassprovider.h
Expand Up @@ -175,7 +175,7 @@ class GRASS_EXPORT QgsGrassProvider : public QgsVectorDataProvider
int keyField();

/** Restart reading features from previous select operation */
void reset();
void begin();

/** Returns the minimum value of an attributs
* @param index the index of the attribute */
Expand Down
4 changes: 2 additions & 2 deletions src/providers/memory/memoryprovider.cpp
Expand Up @@ -175,10 +175,10 @@ void QgsMemoryProvider::select( QgsAttributeList fetchAttributes,
mSelectSI_Features.clear();
}

reset();
begin();
}

void QgsMemoryProvider::reset()
void QgsMemoryProvider::begin()
{
if ( mSelectUsingSpatialIndex )
mSelectSI_Iterator = mSelectSI_Features.begin();
Expand Down
2 changes: 1 addition & 1 deletion src/providers/memory/memoryprovider.h
Expand Up @@ -93,7 +93,7 @@ class QgsMemoryProvider : public QgsVectorDataProvider
virtual const QgsFieldMap & fields() const;

/** Restart reading features from previous select operation */
virtual void reset();
virtual void begin();


/**
Expand Down
2 changes: 1 addition & 1 deletion src/providers/ogr/qgsogrprovider.cpp
Expand Up @@ -455,7 +455,7 @@ const QgsFieldMap & QgsOgrProvider::fields() const
return mAttributeFields;
}

void QgsOgrProvider::reset()
void QgsOgrProvider::begin()
{
OGR_L_ResetReading( ogrLayer );
}
Expand Down
2 changes: 1 addition & 1 deletion src/providers/ogr/qgsogrprovider.h
Expand Up @@ -120,7 +120,7 @@ class QgsOgrProvider : public QgsVectorDataProvider
virtual QgsRect extent();

/** Restart reading features from previous select operation */
virtual void reset();
virtual void begin();

/**Writes a list of features to the file*/
virtual bool addFeatures( QgsFeatureList & flist );
Expand Down
14 changes: 7 additions & 7 deletions src/providers/postgres/qgspostgresprovider.cpp
Expand Up @@ -720,7 +720,7 @@ QString QgsPostgresProvider::dataComment() const
return mDataComment;
}

void QgsPostgresProvider::reset()
void QgsPostgresProvider::begin()
{
if ( mFetching )
{
Expand Down Expand Up @@ -1876,7 +1876,7 @@ bool QgsPostgresProvider::addFeatures( QgsFeatureList & flist )
returnvalue = false;
}

reset();
begin();
return returnvalue;
}

Expand Down Expand Up @@ -1914,7 +1914,7 @@ bool QgsPostgresProvider::deleteFeatures( const QgsFeatureIds & id )
connectionRW->PQexecNR( "ROLLBACK" );
returnvalue = false;
}
reset();
begin();
return returnvalue;
}

Expand Down Expand Up @@ -1953,7 +1953,7 @@ bool QgsPostgresProvider::addAttributes( const QgsNewAttributesMap & name )
returnvalue = false;
}

reset();
begin();
return returnvalue;
}

Expand Down Expand Up @@ -1998,7 +1998,7 @@ bool QgsPostgresProvider::deleteAttributes( const QgsAttributeIds& ids )
returnvalue = false;
}

reset();
begin();
return returnvalue;
}

Expand Down Expand Up @@ -2068,7 +2068,7 @@ bool QgsPostgresProvider::changeAttributeValues( const QgsChangedAttributesMap &
returnvalue = false;
}

reset();
begin();

return returnvalue;
}
Expand Down Expand Up @@ -2148,7 +2148,7 @@ bool QgsPostgresProvider::changeGeometryValues( QgsGeometryMap & geometry_map )
returnvalue = false;
}

reset();
begin();

QgsDebugMsg( "exiting." );

Expand Down
2 changes: 1 addition & 1 deletion src/providers/postgres/qgspostgresprovider.h
Expand Up @@ -176,7 +176,7 @@ class QgsPostgresProvider : public QgsVectorDataProvider
/** Reset the layer - for a PostgreSQL layer, this means clearing the PQresult
* pointer, setting it to 0 and reloading the field list
*/
void reset();
void begin();

/** Returns the minimum value of an attribute
* @param index the index of the attribute */
Expand Down
2 changes: 1 addition & 1 deletion src/providers/wfs/qgswfsprovider.cpp
Expand Up @@ -130,7 +130,7 @@ const QgsFieldMap & QgsWFSProvider::fields() const
return mFields;
}

void QgsWFSProvider::reset()
void QgsWFSProvider::begin()
{
mFeatureIterator = mSelectedFeatures.begin();
}
Expand Down
4 changes: 2 additions & 2 deletions src/providers/wfs/qgswfsprovider.h
Expand Up @@ -69,7 +69,7 @@ class QgsWFSProvider: public QgsVectorDataProvider
long featureCount() const;
uint fieldCount() const;
const QgsFieldMap & fields() const;
void reset();
void begin();

virtual QgsCoordinateReferenceSystem getCRS();

Expand Down Expand Up @@ -114,7 +114,7 @@ class QgsWFSProvider: public QgsVectorDataProvider
QgsSpatialIndex *mSpatialIndex;
/**Vector where the ids of the selected features are inserted*/
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;
/**Vector where the features are inserted*/
QList<QgsFeature*> mFeatures;
Expand Down
2 changes: 1 addition & 1 deletion src/providers/wms/qgswmsprovider.cpp
Expand Up @@ -1666,7 +1666,7 @@ QgsRect QgsWmsProvider::extent()
return layerExtent;
}

void QgsWmsProvider::reset()
void QgsWmsProvider::begin()
{
// TODO
}
Expand Down
2 changes: 1 addition & 1 deletion src/providers/wms/qgswmsprovider.h
Expand Up @@ -449,7 +449,7 @@ class QgsWmsProvider : public QgsRasterDataProvider
/** Reset the layer - for a PostgreSQL layer, this means clearing the PQresult
* pointer and setting it to 0
*/
void reset();
void begin();

/**Returns true if layer is valid
*/
Expand Down

0 comments on commit 23566c3

Please sign in to comment.