Skip to content
Permalink
Browse files
Preserve feature map on layer clone
Make sure postgres provider internals are preserved across a layer
clone.
This helps to keep feature ids stable for things like extract labels
  • Loading branch information
m-kuhn authored and nyalldawson committed Jan 7, 2022
1 parent 0653d98 commit d78517e08e21bc1f692f3b51d9f635655865ab55
Showing with 7 additions and 0 deletions.
  1. +5 −0 src/providers/postgres/qgspostgresprovider.cpp
  2. +2 −0 src/providers/postgres/qgspostgresprovider.h
@@ -319,6 +319,11 @@ Qgis::VectorLayerTypeFlags QgsPostgresProvider::vectorLayerTypeFlags() const
return flags;
}

void QgsPostgresProvider::handlePostCloneOperations( QgsVectorDataProvider *source )
{
mShared = qobject_cast<QgsPostgresProvider *>( source )->mShared;
}

void QgsPostgresProvider::reloadProviderData()
{
mShared->setFeaturesCounted( -1 );
@@ -247,6 +247,8 @@ class QgsPostgresProvider final: public QgsVectorDataProvider

Qgis::VectorLayerTypeFlags vectorLayerTypeFlags() const override;

void handlePostCloneOperations( QgsVectorDataProvider *source ) override;

private:

/**

0 comments on commit d78517e

Please sign in to comment.