Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
move creation of gdal_pam to createDB (fixes #8613)
  • Loading branch information
jef-n committed Sep 16, 2013
1 parent 30a271c commit 4e2d148
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions src/core/qgsapplication.cpp
Expand Up @@ -178,25 +178,6 @@ void QgsApplication::init( QString customConfigPath )
}
ABISYM( mSystemEnvVars ) = systemEnvVarMap;

// 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
}


#if defined(Q_WS_WIN32) || defined(WIN32)
CPLSetConfigOption( "GDAL_PAM_PROXY_DIR", myPamPath.toUtf8() );
#else
//under other OS's we use an environment var so the user can
//override the path if he likes
int myChangeFlag = 0; //whether we want to force the env var to change
setenv( "GDAL_PAM_PROXY_DIR", myPamPath.toUtf8(), myChangeFlag );
#endif
}

QgsApplication::~QgsApplication()
Expand Down Expand Up @@ -900,8 +881,27 @@ void QgsApplication::applyGdalSkippedDrivers()
GDALAllRegister(); //to update driver list and skip missing ones
}

bool QgsApplication::createDB( QString* errorMessage )
bool QgsApplication::createDB( QString *errorMessage )
{
// 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
}

#if defined(Q_WS_WIN32) || defined(WIN32)
CPLSetConfigOption( "GDAL_PAM_PROXY_DIR", myPamPath.toUtf8() );
#else
//under other OS's we use an environment var so the user can
//override the path if he likes
int myChangeFlag = 0; //whether we want to force the env var to change
setenv( "GDAL_PAM_PROXY_DIR", myPamPath.toUtf8(), myChangeFlag );
#endif

// Check qgis.db and make private copy if necessary
QFile qgisPrivateDbFile( QgsApplication::qgisUserDbFilePath() );

Expand Down

0 comments on commit 4e2d148

Please sign in to comment.