Skip to content

Commit

Permalink
Use unique_ptr for QgsVectorLayerServerProperties in QgsVectorLayer
Browse files Browse the repository at this point in the history
  • Loading branch information
rldhont committed Sep 13, 2019
1 parent ea0c174 commit b18cbc7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/core/qgsvectorlayer.cpp
Expand Up @@ -145,6 +145,7 @@ QgsVectorLayer::QgsVectorLayer( const QString &vectorLayerPath,
const QString &providerKey,
const QgsVectorLayer::LayerOptions &options )
: QgsMapLayer( QgsMapLayerType::VectorLayer, baseName, vectorLayerPath )
, mServerProperties( new QgsVectorLayerServerProperties( this ) )
, mAuxiliaryLayer( nullptr )
, mAuxiliaryLayerKey( QString() )
, mReadExtentFromXml( options.readExtentFromXml )
Expand All @@ -165,8 +166,6 @@ QgsVectorLayer::QgsVectorLayer( const QString &vectorLayerPath,
mJoinBuffer->setParent( this );
connect( mJoinBuffer, &QgsVectorLayerJoinBuffer::joinedFieldsChanged, this, &QgsVectorLayer::onJoinedFieldsChanged );

mServerProperties = new QgsVectorLayerServerProperties( this );

mExpressionFieldBuffer = new QgsExpressionFieldBuffer();
// if we're given a provider type, try to create and bind one to this layer
if ( !vectorLayerPath.isEmpty() && !mProviderKey.isEmpty() )
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsvectorlayer.h
Expand Up @@ -652,7 +652,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
* Returns QGIS Server Properties of the vector layer
* \since QGIS 3.10
*/
QgsVectorLayerServerProperties *serverProperties() { return mServerProperties; }
QgsVectorLayerServerProperties *serverProperties() { return mServerProperties.get(); }

/**
* Returns the number of features that are selected in this layer.
Expand Down Expand Up @@ -2640,7 +2640,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
QgsVectorLayerJoinBuffer *mJoinBuffer = nullptr;

//!stores information about server properties
QgsVectorLayerServerProperties *mServerProperties = nullptr;
std::unique_ptr< QgsVectorLayerServerProperties > mServerProperties;

//! stores information about expression fields on this layer
QgsExpressionFieldBuffer *mExpressionFieldBuffer = nullptr;
Expand Down

0 comments on commit b18cbc7

Please sign in to comment.