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