Skip to content
Permalink
Browse files

GPKG layer data items: add path prexix (for searches)

  • Loading branch information
elpaso committed Mar 11, 2020
1 parent ff12081 commit bc68bab33c2ba1f596d41f6736207508e3435185
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/core/providers/ogr/qgsgeopackagedataitems.cpp
@@ -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 );
}
@@ -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 )

0 comments on commit bc68bab

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