Skip to content
Permalink
Browse files

Fix 'make permanant' action fails when exporting to a geopackage

with existing layers
  • Loading branch information
nyalldawson committed Sep 4, 2018
1 parent 40e4f0f commit 15e58093e6cc3349bdedc3c8c579bd906e51c4b5
Showing with 6 additions and 2 deletions.
  1. +6 −2 src/app/qgisapp.cpp
@@ -7203,7 +7203,7 @@ void QgisApp::makeMemoryLayerPermanent( QgsVectorLayer *layer )

auto onSuccess = [this, layerId]( const QString & newFilename,
bool,
const QString &,
const QString & newLayerName,
const QString &,
const QString & )
{
@@ -7212,7 +7212,11 @@ void QgisApp::makeMemoryLayerPermanent( QgsVectorLayer *layer )
if ( vl )
{
QgsDataProvider::ProviderOptions options;
vl->setDataSource( QStringLiteral( "%1" ).arg( newFilename ), vl->name(), QStringLiteral( "ogr" ), options );
QString source = newFilename;
if ( ! newLayerName.isEmpty() )
source += QStringLiteral( "|layername=%1" ).arg( newLayerName );
vl->setDataSource( source, vl->name(), QStringLiteral( "ogr" ), options );
vl->triggerRepaint();
this->messageBar()->pushMessage( tr( "Layer Saved" ),
tr( "Successfully saved scratch layer to <a href=\"%1\">%2</a>" ).arg( QUrl::fromLocalFile( newFilename ).toString(), QDir::toNativeSeparators( newFilename ) ),
Qgis::Success, messageTimeout() );

0 comments on commit 15e5809

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