Fix filename prefix is no longer shown when adding layers from

a GPX file to QGIS

Fixes #37551
This commit is contained in:
Nyall Dawson 2020-09-01 16:47:50 +10:00
parent e4a767a39a
commit 43ee92474a

View File

@ -6053,9 +6053,10 @@ QList<QgsMapLayer *> QgisApp::askUserForOGRSublayers( QgsVectorLayer *layer, con
}
QgsDebugMsg( "Creating new vector layer using " + composedURI );
QString name = fileName + " " + def.layerName;
QgsVectorLayer::LayerOptions options { QgsProject::instance()->transformContext() };
options.loadDefaultStyle = false;
QgsVectorLayer *layer = new QgsVectorLayer( composedURI, def.layerName, QStringLiteral( "ogr" ), options );
QgsVectorLayer *layer = new QgsVectorLayer( composedURI, name, QStringLiteral( "ogr" ), options );
if ( layer && layer->isValid() )
{
result << layer;