Skip to content

Commit

Permalink
Changed begin() to rewind() on provider interface
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@9582 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Nov 8, 2008
1 parent eee62d8 commit 67fdbb5
Show file tree
Hide file tree
Showing 17 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 begin() = 0;
virtual void rewind() = 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 begin() = 0;
virtual void rewind() = 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;
}
begin();
rewind();
}


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

void QgsDelimitedTextProvider::begin()
void QgsDelimitedTextProvider::rewind()
{
// 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 begin();
virtual void rewind();

/** 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 @@ -425,7 +425,7 @@ void QgsGPXProvider::select( QgsAttributeList fetchAttributes,
mAttributesToFetch = fetchAttributes;
mFetchGeom = fetchGeometry;

begin();
rewind();
}


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


void QgsGPXProvider::begin()
void QgsGPXProvider::rewind()
{
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 begin();
virtual void rewind();

/**
* 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::begin()
void QgsGrassProvider::rewind()
{
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 begin();
void rewind();

/** Returns the minimum value of an attributs
* @param index the index of the attribute */
Expand Down
2 changes: 1 addition & 1 deletion src/providers/memory/CMakeLists.txt
@@ -1,5 +1,5 @@

SET (MEMORY_SRCS memoryprovider.cpp)
SET (MEMORY_SRCS qgsmemoryprovider.cpp)

INCLUDE_DIRECTORIES(
.
Expand Down
Expand Up @@ -13,7 +13,7 @@
* *
***************************************************************************/

#include "memoryprovider.h"
#include "qgsmemoryprovider.h"

#include "qgsfeature.h"
#include "qgsfield.h"
Expand Down Expand Up @@ -175,10 +175,10 @@ void QgsMemoryProvider::select( QgsAttributeList fetchAttributes,
mSelectSI_Features.clear();
}

begin();
rewind();
}

void QgsMemoryProvider::begin()
void QgsMemoryProvider::rewind()
{
if ( mSelectUsingSpatialIndex )
mSelectSI_Iterator = mSelectSI_Features.begin();
Expand Down
Expand Up @@ -93,7 +93,7 @@ class QgsMemoryProvider : public QgsVectorDataProvider
virtual const QgsFieldMap & fields() const;

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


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

void QgsOgrProvider::begin()
void QgsOgrProvider::rewind()
{
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 begin();
virtual void rewind();

/**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::begin()
void QgsPostgresProvider::rewind()
{
if ( mFetching )
{
Expand Down Expand Up @@ -1876,7 +1876,7 @@ bool QgsPostgresProvider::addFeatures( QgsFeatureList & flist )
returnvalue = false;
}

begin();
rewind();
return returnvalue;
}

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

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

begin();
rewind();
return returnvalue;
}

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

begin();
rewind();
return returnvalue;
}

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

begin();
rewind();

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

begin();
rewind();

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 begin();
void rewind();

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

void QgsWFSProvider::begin()
void QgsWFSProvider::rewind()
{
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 begin();
void rewind();

virtual QgsCoordinateReferenceSystem crs();

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 begin(), nextFeature(), etc...*/
/**Iterator on the feature vector for use in rewind(), nextFeature(), etc...*/
QList<int>::iterator mFeatureIterator;
/**Vector where the features are inserted*/
QList<QgsFeature*> mFeatures;
Expand Down

0 comments on commit 67fdbb5

Please sign in to comment.