Skip to content
Permalink
Browse files
API Cleanup: Use begin() instead of reset() to move to start of selec…
…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 23566c301ab09ce298a89c545fabcb9ec7bce0ab
@@ -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
@@ -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
@@ -434,7 +434,7 @@ void QgsDelimitedTextProvider::select( QgsAttributeList fetchAttributes,
{
mSelectionRectangle = rect;
}
reset();
begin();
}


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

void QgsDelimitedTextProvider::reset()
void QgsDelimitedTextProvider::begin()
{
// Reset feature id to 0
mFid = 0;
@@ -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
@@ -381,7 +381,7 @@ void QgsGPXProvider::select( QgsAttributeList fetchAttributes,
mAttributesToFetch = fetchAttributes;
mFetchGeom = fetchGeometry;

reset();
begin();
}


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


void QgsGPXProvider::reset()
void QgsGPXProvider::begin()
{
if ( mFeatureType == WaypointType )
mWptIter = data->waypointsBegin();
@@ -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
@@ -557,7 +557,7 @@ int QgsGrassProvider::keyField()
return mLayers[mLayerId].keyColumn;
}

void QgsGrassProvider::reset()
void QgsGrassProvider::begin()
{
if ( isEdited() || isFrozen() || !mValid )
return;
@@ -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 */
@@ -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();
@@ -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();


/**
@@ -455,7 +455,7 @@ const QgsFieldMap & QgsOgrProvider::fields() const
return mAttributeFields;
}

void QgsOgrProvider::reset()
void QgsOgrProvider::begin()
{
OGR_L_ResetReading( ogrLayer );
}
@@ -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 );
@@ -720,7 +720,7 @@ QString QgsPostgresProvider::dataComment() const
return mDataComment;
}

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

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

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

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

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

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

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

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

reset();
begin();

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

reset();
begin();

QgsDebugMsg( "exiting." );

@@ -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 */
@@ -130,7 +130,7 @@ const QgsFieldMap & QgsWFSProvider::fields() const
return mFields;
}

void QgsWFSProvider::reset()
void QgsWFSProvider::begin()
{
mFeatureIterator = mSelectedFeatures.begin();
}
@@ -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();

@@ -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;
@@ -1666,7 +1666,7 @@ QgsRect QgsWmsProvider::extent()
return layerExtent;
}

void QgsWmsProvider::reset()
void QgsWmsProvider::begin()
{
// TODO
}
@@ -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
*/

0 comments on commit 23566c3

Please sign in to comment.