Skip to content
Permalink
Browse files
[ui][spatialite] Fix the browser panel's new connection action
  • Loading branch information
nirvn authored and github-actions committed Nov 5, 2021
1 parent e858c9f commit 90ae07f8b8f2a0907ec8e844e036fd09a8578da5
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/providers/spatialite/qgsspatialitesourceselect.cpp
@@ -311,11 +311,14 @@ bool QgsSpatiaLiteSourceSelect::newConnection( QWidget *parent )

// Persist last used SpatiaLite dir
settings.setValue( QStringLiteral( "UI/lastSpatiaLiteDir" ), myPath );

QgsDataSourceUri dsUri;
dsUri.setDatabase( myFile );

// inserting this SQLite DB path
QgsProviderMetadata *providerMetadata = QgsProviderRegistry::instance()->providerMetadata( QStringLiteral( "spatialite" ) );
QgsSpatiaLiteProviderConnection *providerConnection = static_cast<QgsSpatiaLiteProviderConnection *>( providerMetadata->createConnection( savedName ) );
QgsSpatiaLiteProviderConnection *providerConnection = static_cast<QgsSpatiaLiteProviderConnection *>( providerMetadata->createConnection( dsUri.uri(), QVariantMap() ) );
providerMetadata->saveConnection( providerConnection, savedName );

return true;
}

0 comments on commit 90ae07f

Please sign in to comment.