Skip to content
Permalink
Browse files

Initial support for extension-based scan on multiple layers

  • Loading branch information
elpaso committed Aug 7, 2017
1 parent e19c60b commit 030b234c1bd4d8534512e5ad93407cf35e09e34b
Showing with 11 additions and 3 deletions.
  1. +11 −3 src/providers/ogr/qgsogrdataitems.cpp
@@ -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;
}

0 comments on commit 030b234

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