Skip to content

Commit

Permalink
Set gdal PAM env dir on application init
Browse files Browse the repository at this point in the history
  • Loading branch information
timlinux committed Aug 10, 2011
1 parent 7196dfc commit 89ddd03
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/core/qgsapplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,18 @@ void QgsApplication::init( QString customConfigPath )
}

mDefaultSvgPaths << qgisSettingsDirPath() + QString( "svg/" );

// set a working directory up for gdal to write .aux.xml files into
// for cases where the raster dir is read only to the user
// if the env var is already set it will be used preferentially
QString myPamPath = qgisSettingsDirPath() + QString( "gdal_pam/" );
QDir myDir( myPamPath );
if ( !myDir.exists() )
{
myDir.mkpath( myPamPath ); //fail silently
}
int myChangeFlag = 0; //whether we want to force the env var to change
setenv( "GDAL_PAM_PROXY_DIR", myPamPath.toUtf8(), myChangeFlag );
}

QgsApplication::~QgsApplication()
Expand Down

0 comments on commit 89ddd03

Please sign in to comment.