Skip to content
Permalink
Browse files

set feature validity in QgsPostgresProvider::featureAtIt

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@13376 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Apr 25, 2010
1 parent 509d247 commit 5c02949ea71f19107ebe875deaa3afd0a977df30
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/providers/postgres/qgspostgresprovider.cpp
@@ -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" );
@@ -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 ) ) )
@@ -703,6 +703,7 @@ bool QgsPostgresProvider::featureAtId( int featureId, QgsFeature& feature, bool

connectionRO->closeCursor( cursorName );

feature.setValid( gotit );
return gotit;
}

0 comments on commit 5c02949

Please sign in to comment.
You can’t perform that action at this time.