Skip to content
Permalink
Browse files

use layer type enum instead of bool flags

fix use of QStringLiteral
  • Loading branch information
alexbruy committed Aug 27, 2020
1 parent 5b86753 commit 7be25fb9be0147e3e8a17b5f964595036f4e8fad
Showing with 6 additions and 6 deletions.
  1. +5 −5 src/app/qgsoptions.cpp
  2. +1 −1 src/core/qgsapplication.cpp
@@ -2259,7 +2259,7 @@ void QgsOptions::loadGdalDriverList()
QStringList myDrivers;
QStringList myGdalWriteDrivers;
QMap<QString, QString> myDriversFlags, myDriversExt, myDriversLongName;
QMap<QString, bool> driversType; // true for raster, false for vector
QMap<QString, QgsMapLayerType> driversType;

// make sure we save list when accept()
mLoadedGdalDriverList = true;
@@ -2284,11 +2284,11 @@ void QgsOptions::loadGdalDriverList()
// in GDAL 2.0 both vector and raster drivers are returned by GDALGetDriver
if ( QString( GDALGetMetadataItem( myGdalDriver, GDAL_DCAP_RASTER, nullptr ) ) != QLatin1String( "YES" ) )
{
driversType[myGdalDriverDescription] = false;
driversType[myGdalDriverDescription] = QgsMapLayerType::VectorLayer;
}
else
{
driversType[myGdalDriverDescription] = true;
driversType[myGdalDriverDescription] = QgsMapLayerType::RasterLayer;
}

myGdalDriverDescription = GDALGetDescription( myGdalDriver );
@@ -2298,7 +2298,7 @@ void QgsOptions::loadGdalDriverList()

// get driver R/W flags, adopted from GDALGeneralCmdLineProcessor()
QString driverFlags = "";
if ( driversType[myGdalDriverDescription] )
if ( driversType[myGdalDriverDescription] == QgsMapLayerType::RasterLayer )
{
if ( QgsGdalUtils::supportsRasterCreate( myGdalDriver ) )
{
@@ -2365,7 +2365,7 @@ void QgsOptions::loadGdalDriverList()
QString myFlags = myDriversFlags[myName];
mypItem->setText( 2, myFlags );
mypItem->setText( 3, myDriversLongName[myName] );
if ( driversType[myName] )
if ( driversType[myName] == QgsMapLayerType::RasterLayer )
{
lstRasterDrivers->addTopLevelItem( mypItem );
}
@@ -1707,7 +1707,7 @@ void QgsApplication::applyGdalSkippedDrivers()
if ( !sDeferredSkippedGdalDrivers()->contains( driverName ) )
realDisabledDriverList << driverName;
}
QString myDriverList = realDisabledDriverList.join( QStringLiteral( "," ) );
QString myDriverList = realDisabledDriverList.join( ',' );
QgsDebugMsgLevel( QStringLiteral( "Gdal Skipped driver list set to:" ), 2 );
QgsDebugMsgLevel( myDriverList, 2 );
CPLSetConfigOption( "GDAL_SKIP", myDriverList.toUtf8() );

0 comments on commit 7be25fb

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