Skip to content

Commit

Permalink
set feature validity in QgsPostgresProvider::featureAtIt
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@13376 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Apr 25, 2010
1 parent c6879e0 commit 9b1f6ff
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/providers/postgres/qgspostgresprovider.cpp
Expand Up @@ -581,7 +581,6 @@ void QgsPostgresProvider::select( QgsAttributeList fetchAttributes, QgsRectangle
bool QgsPostgresProvider::nextFeature( QgsFeature& feature )
{
feature.setValid( false );

if ( !valid )
{
QgsDebugMsg( "Read attempt on an invalid postgresql data source" );
Expand Down Expand Up @@ -678,6 +677,7 @@ QString QgsPostgresProvider::whereClause( int featureId ) const

bool QgsPostgresProvider::featureAtId( int featureId, QgsFeature& feature, bool fetchGeometry, QgsAttributeList fetchAttributes )
{
feature.setValid( false );
QString cursorName = QString( "qgisfid%1" ).arg( providerId );

if ( !declareCursor( cursorName, fetchAttributes, fetchGeometry, whereClause( featureId ) ) )
Expand All @@ -703,6 +703,7 @@ bool QgsPostgresProvider::featureAtId( int featureId, QgsFeature& feature, bool

connectionRO->closeCursor( cursorName );

feature.setValid( gotit );
return gotit;
}

Expand Down

0 comments on commit 9b1f6ff

Please sign in to comment.