Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix data retrieval in attribute table from geometryless spatialite ta…
…bles
  • Loading branch information
jef-n committed Sep 30, 2013
1 parent 52ac084 commit 814ae4c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/gui/attributetable/qgsattributetablemodel.cpp
Expand Up @@ -646,4 +646,6 @@ void QgsAttributeTableModel::prefetchColumnData( int column )
void QgsAttributeTableModel::setRequest( const QgsFeatureRequest& request )
{
mFeatureRequest = request;
if( layer() && !layer()->hasGeometryType() )
mFeatureRequest.setFlags( mFeatureRequest.flags() | QgsFeatureRequest::NoGeometry );
}
3 changes: 3 additions & 0 deletions src/providers/spatialite/qgsspatialitefeatureiterator.cpp
Expand Up @@ -145,7 +145,10 @@ bool QgsSpatiaLiteFeatureIterator::close()
bool QgsSpatiaLiteFeatureIterator::prepareStatement( QString whereClause )
{
if ( !( mRequest.flags() & QgsFeatureRequest::NoGeometry ) && P->mGeometryColumn.isNull() )
{
QgsMessageLog::logMessage( QObject::tr( "Trying to fetch geometry on a layer without geometry." ), QObject::tr( "SpatiaLite" ) );
return false;
}

try
{
Expand Down

0 comments on commit 814ae4c

Please sign in to comment.