Skip to content

Commit 5bea05f

Browse files
committed
[gdal] ifdef out some workarounds not required in gdal >= 2.3
(cherry-picked from 6f01d30)
1 parent 8ba3988 commit 5bea05f

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/providers/gdal/qgsgdalprovider.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2269,22 +2269,25 @@ void buildSupportedRasterFileFilterAndExtensions( QString &fileFiltersString, QS
22692269
// DMD_EXTENSION; so let's check for them here and handle
22702270
// them appropriately
22712271

2272-
if ( myGdalDriverDescription.startsWith( QLatin1String( "EHdr" ) ) )
2272+
if ( myGdalDriverDescription.startsWith( QLatin1String( "AIG" ) ) )
2273+
{
2274+
fileFiltersString += createFileFilter_( myGdalDriverLongName, QStringLiteral( "hdr.adf" ) );
2275+
wildcards << QStringLiteral( "hdr.adf" );
2276+
}
2277+
#if !(GDAL_VERSION_MAJOR > 2 || (GDAL_VERSION_MAJOR == 2 && GDAL_VERSION_MINOR >= 3))
2278+
else if ( myGdalDriverDescription.startsWith( QLatin1String( "EHdr" ) ) )
22732279
{
22742280
// Fixed in GDAL 2.3
22752281
fileFiltersString += createFileFilter_( myGdalDriverLongName, QStringLiteral( "*.bil" ) );
22762282
extensions << QStringLiteral( "bil" );
22772283
}
22782284
else if ( myGdalDriverDescription == QLatin1String( "ERS" ) )
22792285
{
2286+
// Fixed in GDAL 2.3
22802287
fileFiltersString += createFileFilter_( myGdalDriverLongName, QStringLiteral( "*.ers" ) );
22812288
extensions << QStringLiteral( "ers" );
22822289
}
2283-
else if ( myGdalDriverDescription.startsWith( QLatin1String( "AIG" ) ) )
2284-
{
2285-
fileFiltersString += createFileFilter_( myGdalDriverLongName, QStringLiteral( "hdr.adf" ) );
2286-
wildcards << QStringLiteral( "hdr.adf" );
2287-
}
2290+
#endif
22882291
else
22892292
{
22902293
catchallFilter << QString( GDALGetDescription( myGdalDriver ) );

0 commit comments

Comments
 (0)