Skip to content
Permalink
Browse files
Fix D&D GPKG from browser
Fixes #43129
  • Loading branch information
elpaso authored and nyalldawson committed May 28, 2021
1 parent 3b612b0 commit 32af68f2065987015c0872a564e846bf8a227ece
Showing with 9 additions and 2 deletions.
  1. +8 −1 src/app/qgisapp.cpp
  2. +1 −1 src/core/providers/ogr/qgsgeopackagedataitems.cpp
@@ -5412,7 +5412,14 @@ static void setupVectorLayer( const QString &vectorLayerPath,
if ( elements.size() >= 4 && layer->name().compare( rawLayerName, Qt::CaseInsensitive ) != 0
&& layer->name().compare( subLayerNameFormatted, Qt::CaseInsensitive ) != 0 )
{
layer->setName( QStringLiteral( "%1 %2" ).arg( layer->name(), rawLayerName ) );
if ( layer->name().isEmpty( ) )
{
layer->setName( rawLayerName );
}
else
{
layer->setName( QStringLiteral( "%1 %2" ).arg( layer->name(), rawLayerName ) );
}
}

// Systematically add a layername= option to OGR datasets in case
@@ -400,7 +400,7 @@ QgsMimeDataUtils::UriList QgsGeoPackageCollectionItem::mimeUris() const
{
QgsMimeDataUtils::Uri vectorUri;
vectorUri.providerKey = QStringLiteral( "ogr" );
vectorUri.uri = path();
vectorUri.uri = path().replace( QStringLiteral( "gpkg:/" ), QString() );
vectorUri.layerType = QStringLiteral( "vector" );
QgsMimeDataUtils::Uri rasterUri { vectorUri };
rasterUri.layerType = QStringLiteral( "raster" );

0 comments on commit 32af68f

Please sign in to comment.