Skip to content
Permalink
Browse files

Browser: fix GPKG sublayers and empty DBs

Fixes #37519
  • Loading branch information
elpaso authored and nyalldawson committed Jul 1, 2020
1 parent 9360515 commit 9b13534c5d3625686f9e58d181d0ab3740a44154
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/core/providers/ogr/qgsogrdataitems.cpp
@@ -237,14 +237,14 @@ QList<QgsOgrDbLayerInfo *> QgsOgrLayerItem::subLayers( const QString &path, cons
}

// There were problems in reading the file: throw
if ( ! layer.isValid() && ! rlayer.isValid() )
if ( ! layer.isValid() && ! rlayer.isValid() && children.isEmpty() )
{
QString errorMessage;
// If it is file based and the file exists, there might be a permission error, let's change
// the message to give the user a hint about this possiblity.
if ( QFile::exists( path ) )
{
errorMessage = tr( "Error opening file, check file and directory permissions on\n%1" ).arg( QDir::toNativeSeparators( path ) );
errorMessage = tr( "The file does not contain any layer or there was an error opening the file.\nCheck file and directory permissions on\n%1" ).arg( QDir::toNativeSeparators( path ) );
}
else
{

0 comments on commit 9b13534

Please sign in to comment.
You can’t perform that action at this time.