Skip to content

Commit

Permalink
Address review
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Jan 31, 2021
1 parent 4b84330 commit 7961c92
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions src/gui/providers/gdal/qgsgdalsourceselect.cpp
Expand Up @@ -268,10 +268,7 @@ void QgsGdalSourceSelect::fillOpenOptions()
return;

GDALDriverH hDriver;
if ( STARTS_WITH_CI( mDataSources[0].toUtf8().toStdString().c_str(), "PG:" ) )
hDriver = GDALGetDriverByName( "PostgreSQL" ); // otherwise the PostgisRaster driver gets identified
else
hDriver = GDALIdentifyDriver( mDataSources[0].toUtf8().toStdString().c_str(), nullptr );
hDriver = GDALIdentifyDriver( mDataSources[0].toUtf8().toStdString().c_str(), nullptr );
if ( hDriver == nullptr )
return;

Expand All @@ -289,8 +286,6 @@ void QgsGdalSourceSelect::fillOpenOptions()
return;
}

const bool bIsGPKG = EQUAL( GDALGetDriverShortName( hDriver ), "GPKG" );

for ( auto psItem = psOpenOptionList->psChild; psItem != nullptr; psItem = psItem->psNext )
{
if ( psItem->eType != CXT_Element || !EQUAL( psItem->pszValue, "Option" ) )
Expand All @@ -305,12 +300,6 @@ void QgsGdalSourceSelect::fillOpenOptions()
if ( pszScope != nullptr && strstr( pszScope, "raster" ) == nullptr )
continue;

// The GPKG driver list a lot of options that are only for rasters
if ( bIsGPKG && strstr( pszOpenOptionList, "scope=" ) == nullptr &&
!EQUAL( pszOptionName, "LIST_ALL_TABLES" ) &&
!EQUAL( pszOptionName, "PRELUDE_STATEMENTS" ) )
continue;

const char *pszType = CPLGetXMLValue( psItem, "type", nullptr );
QStringList options;
if ( pszType && EQUAL( pszType, "string-select" ) )
Expand Down

0 comments on commit 7961c92

Please sign in to comment.