Skip to content

Commit

Permalink
[WFS provider] [fix] losing WFS DCP endpoints upon cloning WFS URI (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
andreassteffens authored and nyalldawson committed Apr 21, 2023
1 parent 7c3c084 commit 5c5bb2d
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/providers/wfs/qgswfsdatasourceuri.cpp
Expand Up @@ -149,6 +149,25 @@ QgsWFSDataSourceURI::QgsWFSDataSourceURI( const QString &uri )
}
}

QgsWFSDataSourceURI::QgsWFSDataSourceURI( const QgsWFSDataSourceURI &other )
: mURI( other.mURI )
, mAuth( other.mAuth )
, mGetEndpoints( other.mGetEndpoints )
, mPostEndpoints( other.mPostEndpoints )
, mDeprecatedURI( other.mDeprecatedURI )
{
}

QgsWFSDataSourceURI &QgsWFSDataSourceURI::operator=( const QgsWFSDataSourceURI &other )
{
mURI = other.mURI;
mAuth = other.mAuth;
mGetEndpoints = other.mGetEndpoints;
mPostEndpoints = other.mPostEndpoints;
mDeprecatedURI = other.mDeprecatedURI;
return *this;
}

QSet<QString> QgsWFSDataSourceURI::unknownParamKeys() const
{
static const QSet<QString> knownKeys
Expand Down
6 changes: 6 additions & 0 deletions src/providers/wfs/qgswfsdatasourceuri.h
Expand Up @@ -42,6 +42,9 @@ class QgsWFSDataSourceURI

explicit QgsWFSDataSourceURI( const QString &uri );

//! Copy constructor
QgsWFSDataSourceURI( const QgsWFSDataSourceURI &other );

//! Returns the URI, optionally with the authentication configuration expanded
QString uri( bool expandAuthConfig = false ) const;

Expand Down Expand Up @@ -140,6 +143,9 @@ class QgsWFSDataSourceURI
//! Whether the initial GetFeature request, used to determine if gml:description/name/identifiers are used, should be skipped
bool skipInitialGetFeature() const;

//! Assignment operator
QgsWFSDataSourceURI &operator=( const QgsWFSDataSourceURI &other );

private:
QgsDataSourceUri mURI;
QgsAuthorizationSettings mAuth;
Expand Down
1 change: 1 addition & 0 deletions src/providers/wfs/qgswfsshareddata.cpp
Expand Up @@ -50,6 +50,7 @@ bool QgsWFSSharedData::isRestrictedToRequestBBOX() const
QgsWFSSharedData *QgsWFSSharedData::clone() const
{
QgsWFSSharedData *copy = new QgsWFSSharedData( mURI.uri( true ) );
copy->mURI = mURI;
copy->mWFSVersion = mWFSVersion;
copy->mGeometryAttribute = mGeometryAttribute;
copy->mLayerPropertiesList = mLayerPropertiesList;
Expand Down

0 comments on commit 5c5bb2d

Please sign in to comment.