Skip to content
Permalink
Browse files

Merge pull request #9568 from qgis/backport-9558-on-release-3_6

Backport #9558 on release-3_6
  • Loading branch information
m-kuhn committed Mar 20, 2019
2 parents 4e8c94f + 1858610 commit 24ccb08ee21ebe96c9f4ea5c928e2d82b0c99dfa
Showing with 3 additions and 0 deletions.
  1. +1 −0 src/core/qgsofflineediting.cpp
  2. +2 −0 tests/src/core/testqgsofflineediting.cpp
@@ -851,6 +851,7 @@ QgsVectorLayer *QgsOfflineEditing::copyVectorLayer( QgsVectorLayer *layer, sqlit
QgsLayerTreeNode *newLayerTreeLayerClone = newLayerTreeLayer->clone();
//copy the showFeatureCount property to the new node
newLayerTreeLayerClone->setCustomProperty( CUSTOM_SHOW_FEATURE_COUNT, layerTreeLayer->customProperty( CUSTOM_SHOW_FEATURE_COUNT ) );
newLayerTreeLayerClone->setItemVisibilityChecked( layerTreeLayer->isVisible() );
QgsLayerTreeGroup *grp = qobject_cast<QgsLayerTreeGroup *>( newLayerTreeLayer->parent() );
parentTreeGroup->insertChildNode( index, newLayerTreeLayerClone );
if ( grp )
@@ -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 24ccb08

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