42
42
// QgsOgrProviderResultIterator
43
43
//
44
44
45
- QgsOgrProviderResultIterator::QgsOgrProviderResultIterator ( gdal::ogr_datasource_unique_ptr hDS, OGRLayerH ogrLayer )
45
+ QgsOgrProviderResultIterator::QgsOgrProviderResultIterator ( gdal::dataset_unique_ptr hDS, OGRLayerH ogrLayer )
46
46
: mHDS( std::move( hDS ) )
47
47
, mOgrLayer( ogrLayer )
48
48
{
@@ -455,7 +455,7 @@ void QgsOgrProviderConnection::setDefaultCapabilities()
455
455
mCapabilities |= RenameField;
456
456
#endif
457
457
458
- gdal::ogr_datasource_unique_ptr hDS ( GDALOpenEx ( uri ().toUtf8 ().constData (), GDAL_OF_VECTOR | GDAL_OF_UPDATE, nullptr , nullptr , nullptr ) );
458
+ gdal::dataset_unique_ptr hDS ( GDALOpenEx ( uri ().toUtf8 ().constData (), GDAL_OF_VECTOR | GDAL_OF_UPDATE, nullptr , nullptr , nullptr ) );
459
459
if ( !hDS )
460
460
{
461
461
// fallback to read only otherwise
@@ -464,18 +464,18 @@ void QgsOgrProviderConnection::setDefaultCapabilities()
464
464
465
465
if ( hDS )
466
466
{
467
- if ( OGR_DS_TestCapability ( hDS.get (), ODsCCurveGeometries ) )
467
+ if ( GDALDatasetTestCapability ( hDS.get (), ODsCCurveGeometries ) )
468
468
mGeometryColumnCapabilities |= GeometryColumnCapability::Curves;
469
469
470
- if ( OGR_DS_TestCapability ( hDS.get (), ODsCMeasuredGeometries ) )
470
+ if ( GDALDatasetTestCapability ( hDS.get (), ODsCMeasuredGeometries ) )
471
471
mGeometryColumnCapabilities |= GeometryColumnCapability::M;
472
472
473
473
if ( !mSingleTableDataset )
474
474
{
475
- if ( OGR_DS_TestCapability ( hDS.get (), ODsCCreateLayer ) )
475
+ if ( GDALDatasetTestCapability ( hDS.get (), ODsCCreateLayer ) )
476
476
mCapabilities |= CreateVectorTable;
477
477
478
- if ( OGR_DS_TestCapability ( hDS.get (), ODsCDeleteLayer ) )
478
+ if ( GDALDatasetTestCapability ( hDS.get (), ODsCDeleteLayer ) )
479
479
mCapabilities |= DropVectorTable;
480
480
}
481
481
}
@@ -646,7 +646,7 @@ QgsAbstractDatabaseProviderConnection::QueryResult QgsOgrProviderConnection::exe
646
646
647
647
QString errCause;
648
648
// try first using an editable datasource
649
- gdal::ogr_datasource_unique_ptr hDS ( GDALOpenEx ( uri ().toUtf8 ().constData (), GDAL_OF_VECTOR | GDAL_OF_UPDATE, nullptr , nullptr , nullptr ) );
649
+ gdal::dataset_unique_ptr hDS ( GDALOpenEx ( uri ().toUtf8 ().constData (), GDAL_OF_VECTOR | GDAL_OF_UPDATE, nullptr , nullptr , nullptr ) );
650
650
if ( !hDS )
651
651
{
652
652
// fallback to read only otherwise
@@ -793,7 +793,7 @@ QList<QgsVectorDataProvider::NativeType> QgsOgrProviderConnection::nativeTypes()
793
793
QStringList QgsOgrProviderConnection::fieldDomainNames () const
794
794
{
795
795
#if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(3,5,0)
796
- gdal::ogr_datasource_unique_ptr hDS ( GDALOpenEx ( uri ().toUtf8 ().constData (), GDAL_OF_VECTOR, nullptr , nullptr , nullptr ) );
796
+ gdal::dataset_unique_ptr hDS ( GDALOpenEx ( uri ().toUtf8 ().constData (), GDAL_OF_VECTOR, nullptr , nullptr , nullptr ) );
797
797
if ( !hDS )
798
798
{
799
799
// In some cases (empty geopackage for example), opening in read-only
@@ -855,7 +855,7 @@ QList<Qgis::FieldDomainType> QgsOgrProviderConnection::supportedFieldDomainTypes
855
855
QgsFieldDomain *QgsOgrProviderConnection::fieldDomain ( const QString &name ) const
856
856
{
857
857
#if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(3,3,0)
858
- gdal::ogr_datasource_unique_ptr hDS ( GDALOpenEx ( uri ().toUtf8 ().constData (), GDAL_OF_VECTOR, nullptr , nullptr , nullptr ) );
858
+ gdal::dataset_unique_ptr hDS ( GDALOpenEx ( uri ().toUtf8 ().constData (), GDAL_OF_VECTOR, nullptr , nullptr , nullptr ) );
859
859
if ( !hDS )
860
860
{
861
861
// In some cases (empty geopackage for example), opening in read-only
@@ -933,7 +933,7 @@ void QgsOgrProviderConnection::addFieldDomain( const QgsFieldDomain &domain, con
933
933
QgsMessageLog::logMessage ( QStringLiteral ( " Schema is not supported by OGR, ignoring" ), QStringLiteral ( " OGR" ), Qgis::MessageLevel::Info );
934
934
}
935
935
936
- gdal::ogr_datasource_unique_ptr hDS ( GDALOpenEx ( uri ().toUtf8 ().constData (), GDAL_OF_VECTOR | GDAL_OF_UPDATE, nullptr , nullptr , nullptr ) );
936
+ gdal::dataset_unique_ptr hDS ( GDALOpenEx ( uri ().toUtf8 ().constData (), GDAL_OF_VECTOR | GDAL_OF_UPDATE, nullptr , nullptr , nullptr ) );
937
937
if ( hDS )
938
938
{
939
939
if ( OGRFieldDomainH ogrDomain = QgsOgrUtils::convertFieldDomain ( &domain ) )
@@ -1059,7 +1059,7 @@ QList<QgsWeakRelation> QgsOgrProviderConnection::relationships( const QString &s
1059
1059
}
1060
1060
1061
1061
#if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(3,6,0)
1062
- gdal::ogr_datasource_unique_ptr hDS ( GDALOpenEx ( uri ().toUtf8 ().constData (), GDAL_OF_VECTOR, nullptr , nullptr , nullptr ) );
1062
+ gdal::dataset_unique_ptr hDS ( GDALOpenEx ( uri ().toUtf8 ().constData (), GDAL_OF_VECTOR, nullptr , nullptr , nullptr ) );
1063
1063
if ( !hDS )
1064
1064
{
1065
1065
// In some cases (empty geopackage for example), opening in read-only
@@ -1111,7 +1111,7 @@ void QgsOgrProviderConnection::addRelationship( const QgsWeakRelation &relations
1111
1111
checkCapability ( Capability::AddRelationship );
1112
1112
1113
1113
#if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(3,6,0)
1114
- gdal::ogr_datasource_unique_ptr hDS ( GDALOpenEx ( uri ().toUtf8 ().constData (), GDAL_OF_UPDATE | GDAL_OF_VECTOR, nullptr , nullptr , nullptr ) );
1114
+ gdal::dataset_unique_ptr hDS ( GDALOpenEx ( uri ().toUtf8 ().constData (), GDAL_OF_UPDATE | GDAL_OF_VECTOR, nullptr , nullptr , nullptr ) );
1115
1115
if ( hDS )
1116
1116
{
1117
1117
const QVariantMap leftParts = QgsProviderRegistry::instance ()->providerMetadata ( QStringLiteral ( " ogr" ) )->decodeUri ( relationship.referencedLayerSource () );
@@ -1156,7 +1156,7 @@ void QgsOgrProviderConnection::updateRelationship( const QgsWeakRelation &relati
1156
1156
checkCapability ( Capability::UpdateRelationship );
1157
1157
1158
1158
#if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(3,6,0)
1159
- gdal::ogr_datasource_unique_ptr hDS ( GDALOpenEx ( uri ().toUtf8 ().constData (), GDAL_OF_UPDATE | GDAL_OF_VECTOR, nullptr , nullptr , nullptr ) );
1159
+ gdal::dataset_unique_ptr hDS ( GDALOpenEx ( uri ().toUtf8 ().constData (), GDAL_OF_UPDATE | GDAL_OF_VECTOR, nullptr , nullptr , nullptr ) );
1160
1160
if ( hDS )
1161
1161
{
1162
1162
const QVariantMap leftParts = QgsProviderRegistry::instance ()->providerMetadata ( QStringLiteral ( " ogr" ) )->decodeUri ( relationship.referencedLayerSource () );
@@ -1201,7 +1201,7 @@ void QgsOgrProviderConnection::deleteRelationship( const QgsWeakRelation &relati
1201
1201
checkCapability ( Capability::DeleteRelationship );
1202
1202
1203
1203
#if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(3,6,0)
1204
- gdal::ogr_datasource_unique_ptr hDS ( GDALOpenEx ( uri ().toUtf8 ().constData (), GDAL_OF_UPDATE | GDAL_OF_VECTOR, nullptr , nullptr , nullptr ) );
1204
+ gdal::dataset_unique_ptr hDS ( GDALOpenEx ( uri ().toUtf8 ().constData (), GDAL_OF_UPDATE | GDAL_OF_VECTOR, nullptr , nullptr , nullptr ) );
1205
1205
if ( hDS )
1206
1206
{
1207
1207
const QString relationshipName = relationship.name ();
0 commit comments