mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -05:00
Initial support for extension-based scan on multiple layers
This commit is contained in:
parent
e19c60beae
commit
030b234c1b
@ -336,9 +336,17 @@ QGISEXTERN QgsDataItem *dataItem( QString path, QgsDataItem *parentItem )
|
||||
OGR_DS_Destroy( hDataSource );
|
||||
}
|
||||
}
|
||||
// add the item
|
||||
// TODO: how to handle collections?
|
||||
QgsLayerItem *item = new QgsOgrLayerItem( parentItem, name, path, path, QgsLayerItem::Vector );
|
||||
// Handle collections
|
||||
// Check if the layer has sublayers by comparing the extension
|
||||
QgsDataItem *item;
|
||||
QStringList multipleLayersExtensions;
|
||||
// TODO: add more formats here!
|
||||
multipleLayersExtensions << QLatin1String( "gpkg" ) << QLatin1String( "sqlite" );
|
||||
if ( ! multipleLayersExtensions.contains( suffix ) )
|
||||
item = new QgsOgrLayerItem( parentItem, name, path, path, QgsLayerItem::Vector );
|
||||
else
|
||||
item = new QgsOgrDataCollectionItem( parentItem, name, path );
|
||||
|
||||
if ( item )
|
||||
return item;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user