Set loadDefaultStyle to false when loading layers for fields info only

This commit is contained in:
Alessandro Pasotti 2020-09-23 08:57:43 +02:00 committed by Nyall Dawson
parent 83a4c7cde3
commit 03e42892b0
2 changed files with 2 additions and 2 deletions

View File

@ -275,7 +275,7 @@ QList<QgsAbstractDatabaseProviderConnection::TableProperty::GeometryColumnType>
QgsFields QgsAbstractDatabaseProviderConnection::fields( const QString &schema, const QString &tableName ) const
{
QgsVectorLayer::LayerOptions options { true, true };
QgsVectorLayer::LayerOptions options { false, true };
options.skipCrsValidation = true;
QgsVectorLayer vl { tableUri( schema, tableName ), QStringLiteral( "temp_layer" ), mProviderKey, options };
if ( vl.isValid() )

View File

@ -685,7 +685,7 @@ QgsFields QgsPostgresProviderConnection::fields( const QString &schema, const QS
tUri.setKeyColumn( tableInfo.primaryKeyColumns().first() );
}
tUri.setParam( QStringLiteral( "checkPrimaryKeyUnicity" ), QLatin1String( "0" ) );
QgsVectorLayer::LayerOptions options { true, true };
QgsVectorLayer::LayerOptions options { false, true };
options.skipCrsValidation = true;
QgsVectorLayer vl { tUri.uri(), QStringLiteral( "temp_layer" ), mProviderKey, options };
if ( vl.isValid() )