Skip to content
Permalink
Browse files

Use decodeUri instead of string parsing

  • Loading branch information
m-kuhn committed Oct 30, 2018
1 parent e42b9f7 commit 3b2bac222acef43e70c26a8deb9643097decc293
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/core/qgsvectorlayerexporter.cpp
@@ -126,7 +126,8 @@ QgsVectorLayerExporter::QgsVectorLayerExporter( const QString &uri,
// that will be filled by ogr with unique values.

// HACK sorry
if ( sinkFlags.testFlag( QgsFeatureSink::SinkFlag::RegeneratePrimaryKey ) && uri.endsWith( QLatin1String( ".gpkg" ) ) )
const QString path = QgsProviderRegistry::instance()->decodeUri( QStringLiteral( "ogr" ), uri ).value( QStringLiteral( "path" ) );
if ( sinkFlags.testFlag( QgsFeatureSink::SinkFlag::RegeneratePrimaryKey ) && path.endsWith( QLatin1String( ".gpkg" ) ) )
{
QString fidName = options.value( QStringLiteral( "FID" ), QStringLiteral( "FID" ) ).toString();
int fidIdx = vectorProvider->fields().lookupField( fidName );

0 comments on commit 3b2bac2

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