Skip to content

Commit

Permalink
[offlineediting] Fix only synchronize selected features option
Browse files Browse the repository at this point in the history
Fix #15830
  • Loading branch information
m-kuhn committed Dec 7, 2016
1 parent 2ad0876 commit ddaf68e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/qgsofflineediting.cpp
Expand Up @@ -630,9 +630,6 @@ QgsVectorLayer* QgsOfflineEditing::copyVectorLayer( QgsVectorLayer* layer, sqlit
newLayer->startEditing();
QgsFeature f;

// NOTE: force feature recount for PostGIS layer, else only visible features are counted, before iterating over all features (WORKAROUND)
layer->setSubsetString( layer->subsetString() );

QgsFeatureRequest req;

if ( onlySelected )
Expand All @@ -642,6 +639,9 @@ QgsVectorLayer* QgsOfflineEditing::copyVectorLayer( QgsVectorLayer* layer, sqlit
req.setFilterFids( selectedFids );
}

// NOTE: force feature recount for PostGIS layer, else only visible features are counted, before iterating over all features (WORKAROUND)
layer->setSubsetString( layer->subsetString() );

QgsFeatureIterator fit = layer->dataProvider()->getFeatures( req );

if ( req.filterType() == QgsFeatureRequest::FilterFids )
Expand Down

0 comments on commit ddaf68e

Please sign in to comment.