Skip to content
Permalink
Browse files

[OGR provider] Add missing calls to QgsCPLHTTPFetchOverrider in publi…

…c methods
  • Loading branch information
rouault committed Nov 9, 2020
1 parent 5f161a8 commit a28eb21636946843eeeb99193d5efff7ec0e145c
Showing with 22 additions and 0 deletions.
  1. +22 −0 src/core/providers/ogr/qgsogrprovider.cpp
@@ -964,6 +964,9 @@ QStringList QgsOgrProvider::subLayersWithoutFeatureCount() const

QStringList QgsOgrProvider::_subLayers( bool withFeatureCount ) const
{
QgsCPLHTTPFetchOverrider oCPLHTTPFetcher( mAuthCfg );
QgsSetCPLHTTPFetchOverriderInitiatorClass( oCPLHTTPFetcher, QStringLiteral( "QgsOgrProvider" ) );

if ( !mValid )
{
return QStringList();
@@ -1009,6 +1012,9 @@ QStringList QgsOgrProvider::_subLayers( bool withFeatureCount ) const

void QgsOgrProvider::setEncoding( const QString &e )
{
QgsCPLHTTPFetchOverrider oCPLHTTPFetcher( mAuthCfg );
QgsSetCPLHTTPFetchOverriderInitiatorClass( oCPLHTTPFetcher, QStringLiteral( "QgsOgrProvider" ) );

QgsSettings settings;

// if the layer has the OLCStringsAsUTF8 capability, we CANNOT override the
@@ -4040,6 +4046,8 @@ QSet<QVariant> QgsOgrProvider::uniqueValues( int index, int limit ) const
return uniqueValues; //not a provider field
}

QgsCPLHTTPFetchOverrider oCPLHTTPFetcher( mAuthCfg );
QgsSetCPLHTTPFetchOverriderInitiatorClass( oCPLHTTPFetcher, QStringLiteral( "QgsOgrProvider" ) );

QByteArray sql = "SELECT DISTINCT " + quotedIdentifier( textEncoding()->fromUnicode( fld.name() ) );

@@ -4098,6 +4106,9 @@ QStringList QgsOgrProvider::uniqueStringsMatching( int index, const QString &sub
return results; //not a provider field
}

QgsCPLHTTPFetchOverrider oCPLHTTPFetcher( mAuthCfg );
QgsSetCPLHTTPFetchOverriderInitiatorClass( oCPLHTTPFetcher, QStringLiteral( "QgsOgrProvider" ) );

QByteArray sql = "SELECT DISTINCT " + quotedIdentifier( textEncoding()->fromUnicode( fld.name() ) );
sql += " FROM " + quotedIdentifier( mOgrLayer->name() );

@@ -4133,6 +4144,9 @@ QStringList QgsOgrProvider::uniqueStringsMatching( int index, const QString &sub

QgsFeatureSource::SpatialIndexPresence QgsOgrProvider::hasSpatialIndex() const
{
QgsCPLHTTPFetchOverrider oCPLHTTPFetcher( mAuthCfg );
QgsSetCPLHTTPFetchOverriderInitiatorClass( oCPLHTTPFetcher, QStringLiteral( "QgsOgrProvider" ) );

if ( mOgrLayer && mOgrLayer->TestCapability( OLCFastSpatialFilter ) )
return QgsFeatureSource::SpatialIndexPresent;
else if ( mOgrLayer )
@@ -4147,6 +4161,10 @@ QVariant QgsOgrProvider::minimumValue( int index ) const
{
return QVariant();
}

QgsCPLHTTPFetchOverrider oCPLHTTPFetcher( mAuthCfg );
QgsSetCPLHTTPFetchOverriderInitiatorClass( oCPLHTTPFetcher, QStringLiteral( "QgsOgrProvider" ) );

const QgsField originalField = mAttributeFields.at( index );
QgsField fld = originalField;

@@ -4203,6 +4221,10 @@ QVariant QgsOgrProvider::maximumValue( int index ) const
{
return QVariant();
}

QgsCPLHTTPFetchOverrider oCPLHTTPFetcher( mAuthCfg );
QgsSetCPLHTTPFetchOverriderInitiatorClass( oCPLHTTPFetcher, QStringLiteral( "QgsOgrProvider" ) );

const QgsField originalField = mAttributeFields.at( index );
QgsField fld = originalField;

0 comments on commit a28eb21

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