Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Further fixes for selective GDAL driver support (in progress)
  • Loading branch information
timlinux committed Sep 12, 2011
1 parent c58576e commit 4a98963
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
5 changes: 3 additions & 2 deletions src/app/main.cpp
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/app/qgisapp.cpp
Expand Up @@ -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 );

Expand Down
11 changes: 10 additions & 1 deletion src/app/qgsoptions.cpp
Expand Up @@ -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();
Expand Down Expand Up @@ -1072,4 +1079,6 @@ void QgsOptions::saveGdalDriverList()
QgsApplication::restoreGdalDriver( mypItem->text() );
}
}
QSettings mySettings;
mySettings.setValue( "gdal/skipList", QgsApplication::skippedGdalDrivers().join(" ") );
}
7 changes: 1 addition & 6 deletions src/core/qgsapplication.cpp
Expand Up @@ -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.