Skip to content
Permalink
Browse files
Use setDataSource instead of setDataSourcePrivate
  • Loading branch information
rldhont committed May 21, 2021
1 parent 65761a1 commit 716011008a9d9b8302df84a257a625ed047f368e
@@ -49,7 +49,7 @@ QgsPointCloudLayer::QgsPointCloudLayer( const QString &uri,
{
providerFlags |= QgsDataProvider::FlagLoadDefaultStyle;
}
setDataSourcePrivate( uri, baseName, providerLib, providerOptions, providerFlags );
setDataSource( uri, baseName, providerLib, providerOptions, providerFlags );

if ( !options.skipIndexGeneration && mDataProvider && mDataProvider->isValid() )
mDataProvider.get()->generateIndex();
@@ -129,7 +129,7 @@ bool QgsPointCloudLayer::readXml( const QDomNode &layerNode, QgsReadWriteContext
{
flags |= QgsDataProvider::FlagTrustDataSource;
}
setDataSourcePrivate( mDataSource, mLayerName, mProviderKey, providerOptions, flags );
setDataSource( mDataSource, mLayerName, mProviderKey, providerOptions, flags );
}

if ( !isValid() )
@@ -132,7 +132,7 @@ QgsRasterLayer::QgsRasterLayer( const QString &uri,
{
providerFlags |= QgsDataProvider::FlagLoadDefaultStyle;
}
setDataSourcePrivate( uri, baseName, providerKey, providerOptions, providerFlags );
setDataSource( uri, baseName, providerKey, providerOptions, providerFlags );

if ( isValid() )
{
@@ -188,8 +188,7 @@ QgsVectorLayer::QgsVectorLayer( const QString &vectorLayerPath,
{
providerFlags |= QgsDataProvider::FlagLoadDefaultStyle;
}
setDataSourcePrivate( vectorLayerPath, baseName, providerKey, providerOptions, providerFlags );
emit dataSourceChanged();
setDataSource( vectorLayerPath, baseName, providerKey, providerOptions, providerFlags );
}

for ( const QgsField &field : std::as_const( mFields ) )

0 comments on commit 7160110

Please sign in to comment.