Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
another try to fix #38919
  • Loading branch information
PeterPetrik committed Sep 23, 2020
1 parent 8e9bf8b commit 59ac6a7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
10 changes: 0 additions & 10 deletions src/app/main.cpp
Expand Up @@ -1227,16 +1227,6 @@ int main( int argc, char *argv[] )
}
}

// Point PROJ_LIB at any PROJ_LIB share directory embedded in the app bundle
if ( !getenv( "PROJ_LIB" ) )
{
QString projLib( QDir::cleanPath( QgsApplication::pkgDataPath().append( "/proj" ) ) );
if ( QFile::exists( projLib ) )
{
setenv( "PROJ_LIB", projLib.toUtf8().constData(), 1 );
}
}

// Point PYTHONHOME to embedded interpreter if present in the bundle
if ( !getenv( "PYTHONHOME" ) )
{
Expand Down
12 changes: 10 additions & 2 deletions src/core/qgsapplication.cpp
Expand Up @@ -335,6 +335,15 @@ void QgsApplication::init( QString profileFolder )
// append local user-writable folder as a proj search path
QStringList currentProjSearchPaths = QgsProjUtils::searchPaths();
currentProjSearchPaths.append( qgisSettingsDirPath() + QStringLiteral( "proj" ) );
#ifdef Q_OS_MACX
// append bundled proj lib for MacOS
QString projLib( QDir::cleanPath( pkgDataPath().append( "/proj" ) ) );
if ( QFile::exists( projLib ) )
{
currentProjSearchPaths.append(projLib);
}
#endif // Q_OS_MACX

char **newPaths = new char *[currentProjSearchPaths.length()];
for ( int i = 0; i < currentProjSearchPaths.count(); ++i )
{
Expand All @@ -346,8 +355,7 @@ void QgsApplication::init( QString profileFolder )
CPLFree( newPaths[i] );
}
delete [] newPaths;
#endif

#endif // PROJ_VERSION_MAJOR>=6

// allow Qt to search for Qt plugins (e.g. sqldrivers) in our plugin directory
QCoreApplication::addLibraryPath( pluginPath() );
Expand Down

0 comments on commit 59ac6a7

Please sign in to comment.