From 772adec552a374e380048dcd72cd35884e42e63f Mon Sep 17 00:00:00 2001 From: Alessandro Pasotti Date: Sun, 25 Feb 2018 16:22:16 +0000 Subject: [PATCH] [bugfix] Respect multi-single part when importing Fixes #15875 --- src/providers/postgres/qgspostgresdataitems.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/providers/postgres/qgspostgresdataitems.cpp b/src/providers/postgres/qgspostgresdataitems.cpp index 62217ef3150..643b5d5de88 100644 --- a/src/providers/postgres/qgspostgresdataitems.cpp +++ b/src/providers/postgres/qgspostgresdataitems.cpp @@ -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, [ = ]()