Skip to content
Permalink
Browse files

Set loadDefaultStyle to false when loading layers for fields info only

  • Loading branch information
elpaso authored and nyalldawson committed Sep 24, 2020
1 parent 83a4c7c commit 03e42892b0153fcb2683f2b8b237179a94c21935
@@ -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() )
@@ -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() )

0 comments on commit 03e4289

Please sign in to comment.
You can’t perform that action at this time.