Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Offline editing: preserve tree structure fix
The offline layers were duplicated, now the automatically inserted one is
removed and only the one at the restored place is preserved.

Followup 46490d4
  • Loading branch information
m-kuhn committed Jan 22, 2015
1 parent eea6eff commit 65a3bed
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/qgsofflineediting.cpp
Expand Up @@ -579,8 +579,10 @@ QgsVectorLayer* QgsOfflineEditing::copyVectorLayer( QgsVectorLayer* layer, sqlit
// Move the new layer from the root group to the new group
QgsLayerTreeLayer* newLayerTreeLayer = layerTreeRoot->findLayer( newLayer->id() );
QgsLayerTreeNode* newLayerTreeLayerClone = newLayerTreeLayer->clone();
QgsLayerTreeGroup* grp = qobject_cast<QgsLayerTreeGroup*>( newLayerTreeLayer->parent() );
parentTreeGroup->insertChildNode( index, newLayerTreeLayerClone );
layerTreeRoot->removeChildNode( newLayerTreeLayer );
if ( grp )
grp->removeChildNode( newLayerTreeLayer );
}

if ( hasLabels )
Expand Down

0 comments on commit 65a3bed

Please sign in to comment.