File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -5002,7 +5002,17 @@ QList< QgsMapLayer * > QgisApp::askUserForGDALSublayers( QgsRasterLayer *layer )
5002
5002
// for hdf4 it would be best to get description, because the subdataset_index is not very practical
5003
5003
if ( name.startsWith( QLatin1String( "netcdf" ), Qt::CaseInsensitive ) ||
5004
5004
name.startsWith( QLatin1String( "hdf" ), Qt::CaseInsensitive ) )
5005
+ {
5005
5006
name = name.mid( name.indexOf( path ) + path.length() + 1 );
5007
+ }
5008
+ else if ( name.startsWith( QLatin1String( "GPKG" ), Qt::CaseInsensitive ) )
5009
+ {
5010
+ const auto parts { name.split( ':' ) };
5011
+ if ( parts.count() >= 3 )
5012
+ {
5013
+ name = parts.at( parts.count( ) - 1 );
5014
+ }
5015
+ }
5006
5016
else
5007
5017
{
5008
5018
// remove driver name and file name
@@ -6500,7 +6510,7 @@ bool QgisApp::openLayer( const QString &fileName, bool allowInteractive )
6500
6510
}
6501
6511
6502
6512
// try as a vector
6503
- if ( !ok )
6513
+ if ( !ok || fileName.endsWith( QLatin1String( ".gpkg" ), Qt::CaseInsensitive ) )
6504
6514
{
6505
6515
if ( allowInteractive )
6506
6516
{
You can’t perform that action at this time.
0 commit comments