Skip to content
Permalink
Browse files
Copy shared data post-layer-clone
  • Loading branch information
m-kuhn authored and nyalldawson committed Jan 9, 2022
1 parent 215b368 commit 3511158887cd331aa11af96a2385af87c4881bf7
@@ -358,6 +358,11 @@ QString QgsAfsProvider::providerKey()
return AFS_PROVIDER_KEY;
}

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

QString QgsAfsProvider::description() const
{
return AFS_PROVIDER_DESCRIPTION;
@@ -81,6 +81,8 @@ class QgsAfsProvider : public QgsVectorDataProvider

static QString providerKey();

void handlePostCloneOperations( QgsVectorDataProvider *source ) override;

private:
bool mValid = false;
std::shared_ptr<QgsAfsSharedData> mSharedData;
@@ -1899,6 +1899,11 @@ std::shared_ptr<QgsMssqlDatabase> QgsMssqlProvider::connection() const
return mTransaction ? mTransaction->conn() : QgsMssqlDatabase::connectDb( uri().connectionInfo(), false );
}

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

QString QgsMssqlProvider::subsetString() const
{
return mSqlWhereClause;
@@ -166,6 +166,8 @@ class QgsMssqlProvider final: public QgsVectorDataProvider

std::shared_ptr<QgsMssqlDatabase> connection() const;

void handlePostCloneOperations( QgsVectorDataProvider *source ) override;

protected:
//! Loads fields from input file to member attributeFields
QVariant::Type DecodeSqlType( const QString &sqlTypeName );
@@ -229,6 +229,11 @@ Qgis::VectorLayerTypeFlags QgsOracleProvider::vectorLayerTypeFlags() const
return flags;
}

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

void QgsOracleProvider::setWorkspace( const QString &workspace )
{
QgsDataSourceUri prevUri( mUri );
@@ -191,6 +191,8 @@ class QgsOracleProvider final: public QgsVectorDataProvider

Qgis::VectorLayerTypeFlags vectorLayerTypeFlags() const override;

void handlePostCloneOperations( QgsVectorDataProvider *source ) override;

private:
QString whereClause( QgsFeatureId featureId, QVariantList &args ) const;
QString pkParamWhereClause() const;
@@ -335,6 +335,11 @@ const QString &QgsOapifProvider::clientSideFilterExpression() const
return mShared->mClientSideFilterExpression;
}

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

QString QgsOapifProvider::name() const
{
return OAPIF_PROVIDER_KEY;
@@ -89,6 +89,8 @@ class QgsOapifProvider final: public QgsVectorDataProvider
//! For QgsWFSSourceSelect::buildQuery()
const QString &clientSideFilterExpression() const;

void handlePostCloneOperations( QgsVectorDataProvider *source ) override;

private slots:

void pushErrorSlot( const QString &errorMsg );
@@ -1312,6 +1312,11 @@ bool QgsWFSProvider::empty() const
#endif
return !getFeatures( request ).nextFeature( f );

}

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

bool QgsWFSProvider::describeFeatureType( QString &geometryAttribute, QgsFields &fields, QgsWkbTypes::Type &geomType )
@@ -126,6 +126,8 @@ class QgsWFSProvider final: public QgsVectorDataProvider

std::shared_ptr<QgsWFSSharedData> sharedData() const { return mShared; }

void handlePostCloneOperations( QgsVectorDataProvider *source ) override;

private slots:

void featureReceivedAnalyzeOneFeature( QVector<QgsFeatureUniqueIdPair> );

0 comments on commit 3511158

Please sign in to comment.