Skip to content

Commit 4a98963

Browse files
committed
Further fixes for selective GDAL driver support (in progress)
1 parent c58576e commit 4a98963

File tree

4 files changed

+15
-9
lines changed

4 files changed

+15
-9
lines changed

src/app/main.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -479,11 +479,12 @@ int main( int argc, char *argv[] )
479479
QApplication::setStyle( new QPlastiqueStyle );
480480
#endif
481481

482-
QString i18nPath = QgsApplication::i18nPath();
482+
QSettings mySettings;
483+
483484

484485
/* Translation file for QGIS.
485486
*/
486-
QSettings mySettings;
487+
QString i18nPath = QgsApplication::i18nPath();
487488
QString myUserLocale = mySettings.value( "locale/userLocale", "" ).toString();
488489
bool myLocaleOverrideFlag = mySettings.value( "locale/overrideFlag", false ).toBool();
489490
QString myLocale;

src/app/qgisapp.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,7 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
531531
qApp->processEvents();
532532
// now build vector file filter
533533
mVectorFileFilter = QgsProviderRegistry::instance()->fileVectorFilters();
534+
534535
// now build raster file filter
535536
QgsRasterLayer::buildSupportedRasterFileFilter( mRasterFileFilter );
536537

src/app/qgsoptions.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1040,8 +1040,15 @@ void QgsOptions::loadGdalDriverList()
10401040
myGdalDriverDescription = GDALGetDescription( myGdalDriver );
10411041
myDrivers << myGdalDriverDescription;
10421042
}
1043-
QStringListIterator myIterator( myDrivers );
1043+
// add the skipped drivers to the list too in case their drivers are
1044+
// already unloaded...may result in false positive if underlying
1045+
// sys config has changed and that driver no longer exists...
1046+
myDrivers.append( mySkippedDrivers );
1047+
myDrivers.removeDuplicates();
10441048
myDrivers.sort();
1049+
1050+
QStringListIterator myIterator( myDrivers );
1051+
10451052
while (myIterator.hasNext())
10461053
{
10471054
QString myName = myIterator.next();
@@ -1072,4 +1079,6 @@ void QgsOptions::saveGdalDriverList()
10721079
QgsApplication::restoreGdalDriver( mypItem->text() );
10731080
}
10741081
}
1082+
QSettings mySettings;
1083+
mySettings.setValue( "gdal/skipList", QgsApplication::skippedGdalDrivers().join(" ") );
10751084
}

src/core/qgsapplication.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -744,12 +744,7 @@ void QgsApplication::applyGdalSkippedDrivers()
744744
QString myDriverList = mGdalSkipList.join(" ");
745745
QgsDebugMsg( "Gdal Skipped driver list set to:" );
746746
QgsDebugMsg( myDriverList );
747-
#if defined(Q_WS_WIN32) || defined(WIN32)
748747
CPLSetConfigOption("GDAL_SKIP", myDriverList.toUtf8());
749-
#else
750-
int myChangeFlag = 1; //whether we want to force the env var to change
751-
setenv( "GDAL_SKIP", myDriverList.toUtf8(), myChangeFlag );
752-
#endif
753748
GDALDriverManager myDriverManager;
754-
myDriverManager.AutoLoadDrivers();
749+
myDriverManager.AutoSkipDrivers();
755750
}

0 commit comments

Comments
 (0)