Skip to content

Commit

Permalink
Fix unreported QGIS_OPTIONS_PATH not really working for proj
Browse files Browse the repository at this point in the history
Symptom: PROJ search path not including QGIS_OPTIONS_PATH because
initialization of QgsApplication happens before QgsServer loads
the settings.

TODO for the future:
remove QGIS_OPTIONS_PATH from settings and rely on QgsApplication's
env var QGIS_CUSTOM_CONFIG_PATH

Note that QGIS_CUSTOM_CONFIG_PATH gives /tmp/qt_temp-rUpsId/profiles/default/QGIS/QGIS3.ini
     while      QGIS_OPTIONS_PATH gives /tmp/qt_temp-rUpsId/QGIS/QGIS3.ini
  • Loading branch information
elpaso committed May 24, 2021
1 parent ffc500d commit 6f99e26
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/server/qgsserver.cpp
Expand Up @@ -192,7 +192,10 @@ bool QgsServer::init()
QCoreApplication::setOrganizationDomain( QgsApplication::QGIS_ORGANIZATION_DOMAIN );
QCoreApplication::setApplicationName( QgsApplication::QGIS_APPLICATION_NAME );

QgsApplication::init();
// TODO: remove QGIS_OPTIONS_PATH from settings and rely on QgsApplication's env var QGIS_CUSTOM_CONFIG_PATH
// Note that QGIS_CUSTOM_CONFIG_PATH gives /tmp/qt_temp-rUpsId/profiles/default/QGIS/QGIS3.ini
// while QGIS_OPTIONS_PATH gives /tmp/qt_temp-rUpsId/QGIS/QGIS3.ini
QgsApplication::init( qgetenv( "QGIS_OPTIONS_PATH" ) );

#if defined(SERVER_SKIP_ECW)
QgsMessageLog::logMessage( "Skipping GDAL ECW drivers in server.", "Server", Qgis::Info );
Expand Down

0 comments on commit 6f99e26

Please sign in to comment.