Skip to content
Permalink
Browse files
Use QgsSettings to save the connecion
  • Loading branch information
pblottiere committed Sep 8, 2021
1 parent 712b3d5 commit 9a3f6331c4cc41a302c9bae46a3a465ae3ed0113
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/core/providers/ogr/qgsogrproviderutils.cpp
@@ -2531,9 +2531,9 @@ bool QgsOgrProviderUtils::saveConnection( const QString &path, const QString &og
}
if ( ok && ! connName.isEmpty() )
{
QgsOgrDbConnection connection( connName, ogrDriverName );
connection.setPath( path );
connection.save();
const QString connection = QStringLiteral( "providers/ogr/%1/connections" ).arg( ogrDriverName );
QgsSettings settings;
settings.setValue( QStringLiteral( "%1/%2/path" ).arg( connection, connName ), path );

QgsProviderMetadata *providerMetadata = QgsProviderRegistry::instance()->providerMetadata( QStringLiteral( "ogr" ) );
QgsGeoPackageProviderConnection *providerConnection = static_cast<QgsGeoPackageProviderConnection *>( providerMetadata->createConnection( connName ) );

0 comments on commit 9a3f633

Please sign in to comment.