Skip to content
Permalink
Browse files

another try to fix #38919

  • Loading branch information
PeterPetrik authored and nyalldawson committed Sep 23, 2020
1 parent aa1d199 commit 85938ae1fea694bcc098403c7ea82ee50cbf2746
Showing with 10 additions and 12 deletions.
  1. +0 −10 src/app/main.cpp
  2. +10 −2 src/core/qgsapplication.cpp
@@ -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" ) )
{
@@ -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 )
{
@@ -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() );

0 comments on commit 85938ae

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