Skip to content
Permalink
Browse files

Browser: fix GPKG sublayers and empty DBs

  • Loading branch information
github-actions authored and nyalldawson committed Jul 2, 2020
1 parent c84ecac commit 9175d95cb29958c7dce7e8e0783131209ef3a62b
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 9175d95

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