Skip to content
Permalink
Browse files

Add test for preserving layer visibility on offline editing

  • Loading branch information
m-kuhn authored and nyalldawson committed Mar 4, 2019
1 parent 66a7fff commit 0546228a3cfcdbb672dfa27acdbdb2d10c89014b
Showing with 2 additions and 0 deletions.
  1. +2 −0 tests/src/core/testqgsofflineediting.cpp
@@ -152,6 +152,7 @@ void TestQgsOfflineEditing::createGeopackageAndSynchronizeBack()
//set on LayerTreeNode showFeatureCount property
QgsLayerTreeLayer *layerTreelayer = QgsProject::instance()->layerTreeRoot()->findLayer( mpLayer->id() );
layerTreelayer->setCustomProperty( QStringLiteral( "showFeatureCount" ), 1 );
layerTreelayer->setItemVisibilityChecked( false );

//convert
mOfflineEditing->convertToOfflineProject( offlineDataPath, offlineDbFile, layerIds, false, QgsOfflineEditing::GPKG );
@@ -164,6 +165,7 @@ void TestQgsOfflineEditing::createGeopackageAndSynchronizeBack()
//check LayerTreeNode showFeatureCount property
layerTreelayer = QgsProject::instance()->layerTreeRoot()->findLayer( mpLayer->id() );
QCOMPARE( layerTreelayer->customProperty( QStringLiteral( "showFeatureCount" ), 0 ).toInt(), 1 );
QCOMPARE( layerTreelayer->isVisible(), false );

QgsFeature firstFeatureInAction;
it = mpLayer->getFeatures();

0 comments on commit 0546228

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