40
40
// QgsOgrProviderResultIterator
41
41
//
42
42
43
- QgsOgrProviderResultIterator::QgsOgrProviderResultIterator ( gdal::ogr_datasource_unique_ptr hDS, OGRLayerH ogrLayer )
43
+ QgsOgrProviderResultIterator::QgsOgrProviderResultIterator ( gdal::dataset_unique_ptr hDS, OGRLayerH ogrLayer )
44
44
: mHDS( std::move( hDS ) )
45
45
, mOgrLayer( ogrLayer )
46
46
{
@@ -450,7 +450,7 @@ void QgsOgrProviderConnection::setDefaultCapabilities()
450
450
mCapabilities |= RenameField;
451
451
#endif
452
452
453
- gdal::ogr_datasource_unique_ptr hDS ( GDALOpenEx ( uri ().toUtf8 ().constData (), GDAL_OF_VECTOR | GDAL_OF_UPDATE, nullptr , nullptr , nullptr ) );
453
+ gdal::dataset_unique_ptr hDS ( GDALOpenEx ( uri ().toUtf8 ().constData (), GDAL_OF_VECTOR | GDAL_OF_UPDATE, nullptr , nullptr , nullptr ) );
454
454
if ( !hDS )
455
455
{
456
456
// fallback to read only otherwise
@@ -459,18 +459,18 @@ void QgsOgrProviderConnection::setDefaultCapabilities()
459
459
460
460
if ( hDS )
461
461
{
462
- if ( OGR_DS_TestCapability ( hDS.get (), ODsCCurveGeometries ) )
462
+ if ( GDALDatasetTestCapability ( hDS.get (), ODsCCurveGeometries ) )
463
463
mGeometryColumnCapabilities |= GeometryColumnCapability::Curves;
464
464
465
- if ( OGR_DS_TestCapability ( hDS.get (), ODsCMeasuredGeometries ) )
465
+ if ( GDALDatasetTestCapability ( hDS.get (), ODsCMeasuredGeometries ) )
466
466
mGeometryColumnCapabilities |= GeometryColumnCapability::M;
467
467
468
468
if ( !mSingleTableDataset )
469
469
{
470
- if ( OGR_DS_TestCapability ( hDS.get (), ODsCCreateLayer ) )
470
+ if ( GDALDatasetTestCapability ( hDS.get (), ODsCCreateLayer ) )
471
471
mCapabilities |= CreateVectorTable;
472
472
473
- if ( OGR_DS_TestCapability ( hDS.get (), ODsCDeleteLayer ) )
473
+ if ( GDALDatasetTestCapability ( hDS.get (), ODsCDeleteLayer ) )
474
474
mCapabilities |= DropVectorTable;
475
475
}
476
476
}
@@ -521,7 +521,7 @@ QgsAbstractDatabaseProviderConnection::QueryResult QgsOgrProviderConnection::exe
521
521
522
522
QString errCause;
523
523
// try first using an editable datasource
524
- gdal::ogr_datasource_unique_ptr hDS ( GDALOpenEx ( uri ().toUtf8 ().constData (), GDAL_OF_VECTOR | GDAL_OF_UPDATE, nullptr , nullptr , nullptr ) );
524
+ gdal::dataset_unique_ptr hDS ( GDALOpenEx ( uri ().toUtf8 ().constData (), GDAL_OF_VECTOR | GDAL_OF_UPDATE, nullptr , nullptr , nullptr ) );
525
525
if ( !hDS )
526
526
{
527
527
// fallback to read only otherwise
@@ -668,7 +668,7 @@ QList<QgsVectorDataProvider::NativeType> QgsOgrProviderConnection::nativeTypes()
668
668
QStringList QgsOgrProviderConnection::fieldDomainNames () const
669
669
{
670
670
#if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(3,5,0)
671
- gdal::ogr_datasource_unique_ptr hDS ( GDALOpenEx ( uri ().toUtf8 ().constData (), GDAL_OF_VECTOR, nullptr , nullptr , nullptr ) );
671
+ gdal::dataset_unique_ptr hDS ( GDALOpenEx ( uri ().toUtf8 ().constData (), GDAL_OF_VECTOR, nullptr , nullptr , nullptr ) );
672
672
if ( !hDS )
673
673
{
674
674
// In some cases (empty geopackage for example), opening in read-only
@@ -730,7 +730,7 @@ QList<Qgis::FieldDomainType> QgsOgrProviderConnection::supportedFieldDomainTypes
730
730
QgsFieldDomain *QgsOgrProviderConnection::fieldDomain ( const QString &name ) const
731
731
{
732
732
#if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(3,3,0)
733
- gdal::ogr_datasource_unique_ptr hDS ( GDALOpenEx ( uri ().toUtf8 ().constData (), GDAL_OF_VECTOR, nullptr , nullptr , nullptr ) );
733
+ gdal::dataset_unique_ptr hDS ( GDALOpenEx ( uri ().toUtf8 ().constData (), GDAL_OF_VECTOR, nullptr , nullptr , nullptr ) );
734
734
if ( !hDS )
735
735
{
736
736
// In some cases (empty geopackage for example), opening in read-only
@@ -808,7 +808,7 @@ void QgsOgrProviderConnection::addFieldDomain( const QgsFieldDomain &domain, con
808
808
QgsMessageLog::logMessage ( QStringLiteral ( " Schema is not supported by OGR, ignoring" ), QStringLiteral ( " OGR" ), Qgis::MessageLevel::Info );
809
809
}
810
810
811
- gdal::ogr_datasource_unique_ptr hDS ( GDALOpenEx ( uri ().toUtf8 ().constData (), GDAL_OF_VECTOR | GDAL_OF_UPDATE, nullptr , nullptr , nullptr ) );
811
+ gdal::dataset_unique_ptr hDS ( GDALOpenEx ( uri ().toUtf8 ().constData (), GDAL_OF_VECTOR | GDAL_OF_UPDATE, nullptr , nullptr , nullptr ) );
812
812
if ( hDS )
813
813
{
814
814
if ( OGRFieldDomainH ogrDomain = QgsOgrUtils::convertFieldDomain ( &domain ) )
@@ -914,7 +914,7 @@ QList<QgsWeakRelation> QgsOgrProviderConnection::relationships( const QString &s
914
914
}
915
915
916
916
#if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(3,6,0)
917
- gdal::ogr_datasource_unique_ptr hDS ( GDALOpenEx ( uri ().toUtf8 ().constData (), GDAL_OF_VECTOR, nullptr , nullptr , nullptr ) );
917
+ gdal::dataset_unique_ptr hDS ( GDALOpenEx ( uri ().toUtf8 ().constData (), GDAL_OF_VECTOR, nullptr , nullptr , nullptr ) );
918
918
if ( !hDS )
919
919
{
920
920
// In some cases (empty geopackage for example), opening in read-only
0 commit comments