Skip to content

Commit

Permalink
GPKG layer data items: add path prexix (for searches)
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso committed Mar 11, 2020
1 parent ff12081 commit bc68bab
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/providers/ogr/qgsgeopackagedataitems.cpp
Expand Up @@ -81,7 +81,7 @@ QVector<QgsDataItem *> QgsGeoPackageRootItem::createChildren()
for ( const QString &connName : connList )
{
QgsOgrDbConnection connection( connName, QStringLiteral( "GPKG" ) );
QgsDataItem *conn = new QgsGeoPackageConnectionItem( this, connection.name(), connection.path() );
QgsDataItem *conn = new QgsGeoPackageConnectionItem( this, connection.name(), mPath + '/' + connection.path() );

connections.append( conn );
}
Expand All @@ -104,15 +104,15 @@ void QgsGeoPackageRootItem::newConnection()
QgsGeoPackageCollectionItem::QgsGeoPackageCollectionItem( QgsDataItem *parent, const QString &name, const QString &path )
: QgsDataCollectionItem( parent, name, path, QStringLiteral( "GPKG" ) )
{
mToolTip = path;
mToolTip = QString( path ).remove( QLatin1String( "gpkg:/" ) );
mCapabilities |= Collapse;
}


QVector<QgsDataItem *> QgsGeoPackageCollectionItem::createChildren()
{
QVector<QgsDataItem *> children;
const auto layers = QgsOgrLayerItem::subLayers( mPath, QStringLiteral( "GPKG" ) );
const auto layers = QgsOgrLayerItem::subLayers( mPath.remove( QLatin1String( "gpkg:/" ) ), QStringLiteral( "GPKG" ) );
for ( const QgsOgrDbLayerInfo *info : layers )
{
if ( info->layerType() == QgsLayerItem::LayerType::Raster )
Expand Down

0 comments on commit bc68bab

Please sign in to comment.