Skip to content
Permalink
Browse files

Use decodeUri instead of string parsing

  • Loading branch information
m-kuhn committed Oct 30, 2018
1 parent 50cf8b9 commit 08c2002d106ee324eb961295fd301e54ac2886a6
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 08c2002

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