Skip to content
Permalink
Browse files

Further fixes for selective GDAL driver support (in progress)

  • Loading branch information
timlinux committed Sep 12, 2011
1 parent c58576e commit 4a9896319ef6b26d78e0547bd3a11a48b4266f0a
Showing with 15 additions and 9 deletions.
  1. +3 −2 src/app/main.cpp
  2. +1 −0 src/app/qgisapp.cpp
  3. +10 −1 src/app/qgsoptions.cpp
  4. +1 −6 src/core/qgsapplication.cpp
@@ -479,11 +479,12 @@ int main( int argc, char *argv[] )
QApplication::setStyle( new QPlastiqueStyle );
#endif

QString i18nPath = QgsApplication::i18nPath();
QSettings mySettings;


/* Translation file for QGIS.
*/
QSettings mySettings;
QString i18nPath = QgsApplication::i18nPath();
QString myUserLocale = mySettings.value( "locale/userLocale", "" ).toString();
bool myLocaleOverrideFlag = mySettings.value( "locale/overrideFlag", false ).toBool();
QString myLocale;
@@ -531,6 +531,7 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
qApp->processEvents();
// now build vector file filter
mVectorFileFilter = QgsProviderRegistry::instance()->fileVectorFilters();

// now build raster file filter
QgsRasterLayer::buildSupportedRasterFileFilter( mRasterFileFilter );

@@ -1040,8 +1040,15 @@ void QgsOptions::loadGdalDriverList()
myGdalDriverDescription = GDALGetDescription( myGdalDriver );
myDrivers << myGdalDriverDescription;
}
QStringListIterator myIterator( myDrivers );
// add the skipped drivers to the list too in case their drivers are
// already unloaded...may result in false positive if underlying
// sys config has changed and that driver no longer exists...
myDrivers.append( mySkippedDrivers );
myDrivers.removeDuplicates();
myDrivers.sort();

QStringListIterator myIterator( myDrivers );

while (myIterator.hasNext())
{
QString myName = myIterator.next();
@@ -1072,4 +1079,6 @@ void QgsOptions::saveGdalDriverList()
QgsApplication::restoreGdalDriver( mypItem->text() );
}
}
QSettings mySettings;
mySettings.setValue( "gdal/skipList", QgsApplication::skippedGdalDrivers().join(" ") );
}
@@ -744,12 +744,7 @@ void QgsApplication::applyGdalSkippedDrivers()
QString myDriverList = mGdalSkipList.join(" ");
QgsDebugMsg( "Gdal Skipped driver list set to:" );
QgsDebugMsg( myDriverList );
#if defined(Q_WS_WIN32) || defined(WIN32)
CPLSetConfigOption("GDAL_SKIP", myDriverList.toUtf8());
#else
int myChangeFlag = 1; //whether we want to force the env var to change
setenv( "GDAL_SKIP", myDriverList.toUtf8(), myChangeFlag );
#endif
GDALDriverManager myDriverManager;
myDriverManager.AutoLoadDrivers();
myDriverManager.AutoSkipDrivers();
}

0 comments on commit 4a98963

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