Skip to content
Permalink
Browse files

[offlineediting] Fix only synchronize selected features option

Fix #15830
  • Loading branch information
m-kuhn committed Dec 7, 2016
1 parent 2ad0876 commit ddaf68efba2fa8b35d312da48b3eb2ea41f5405c
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/core/qgsofflineediting.cpp
@@ -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 )
@@ -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 )

0 comments on commit ddaf68e

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