[bugfix] Respect multi-single part when importing

Fixes #15875
This commit is contained in:
Alessandro Pasotti 2018-02-25 16:22:16 +00:00
parent faec620436
commit 772adec552

View File

@ -244,7 +244,9 @@ bool QgsPGConnectionItem::handleDrop( const QMimeData *data, const QString &toSc
uri.setSchema( toSchema );
}
std::unique_ptr< QgsVectorLayerExporterTask > exportTask( new QgsVectorLayerExporterTask( srcLayer, uri.uri( false ), QStringLiteral( "postgres" ), srcLayer->crs(), QVariantMap(), owner ) );
QVariantMap options;
options.insert( QStringLiteral( "forceSinglePartGeometryType" ), true );
std::unique_ptr< QgsVectorLayerExporterTask > exportTask( new QgsVectorLayerExporterTask( srcLayer, uri.uri( false ), QStringLiteral( "postgres" ), srcLayer->crs(), options, owner ) );
// when export is successful:
connect( exportTask.get(), &QgsVectorLayerExporterTask::exportComplete, this, [ = ]()