Skip to content
Permalink
Browse files
Save connection with path
  • Loading branch information
pblottiere committed Sep 7, 2021
1 parent 1532c05 commit 712b3d57e86e2d5cfe9fffe433e3df8efa2f3aae
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/core/providers/ogr/qgsogrproviderutils.cpp
@@ -2531,6 +2531,10 @@ bool QgsOgrProviderUtils::saveConnection( const QString &path, const QString &og
}
if ( ok && ! connName.isEmpty() )
{
QgsOgrDbConnection connection( connName, ogrDriverName );
connection.setPath( path );
connection.save();

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

0 comments on commit 712b3d5

Please sign in to comment.