Skip to content
Permalink
Browse files

Dynamic landing page settings

  • Loading branch information
pblottiere committed Aug 27, 2020
1 parent c7fa78a commit f1e9c7eec1bc5e154b50cea4c674e74ccf4679c0
Showing with 13 additions and 4 deletions.
  1. +12 −3 src/server/qgsserversettings.cpp
  2. +1 −1 src/server/qgsserversettings.h
@@ -312,8 +312,17 @@ QMap<QgsServerSettingsEnv::EnvVar, QString> QgsServerSettings::getEnv() const
return env;
}

QVariant QgsServerSettings::value( QgsServerSettingsEnv::EnvVar envVar ) const
QVariant QgsServerSettings::value( QgsServerSettingsEnv::EnvVar envVar, bool actual ) const
{
if ( actual )
{
const QMetaEnum metaEnum( QMetaEnum::fromType<QgsServerSettingsEnv::EnvVar>() );
const QString envValue( getenv( metaEnum.valueToKey( envVar ) ) );

if ( ! envValue.isEmpty() )
return envValue;
}

if ( mSettings[ envVar ].src == QgsServerSettingsEnv::DEFAULT_VALUE )
{
return mSettings[ envVar ].defaultVal;
@@ -468,12 +477,12 @@ int QgsServerSettings::wmsMaxWidth() const

QString QgsServerSettings::projectsDirectories() const
{
return value( QgsServerSettingsEnv::QGIS_SERVER_PROJECTS_DIRECTORIES ).toString();
return value( QgsServerSettingsEnv::QGIS_SERVER_PROJECTS_DIRECTORIES, true ).toString();
}

QString QgsServerSettings::projectsPgConnections() const
{
return value( QgsServerSettingsEnv::QGIS_SERVER_PROJECTS_PG_CONNECTIONS ).toString();
return value( QgsServerSettingsEnv::QGIS_SERVER_PROJECTS_PG_CONNECTIONS, true ).toString();
}

QString QgsServerSettings::apiResourcesDirectory() const
@@ -275,7 +275,7 @@ class SERVER_EXPORT QgsServerSettings

private:
void initSettings();
QVariant value( QgsServerSettingsEnv::EnvVar envVar ) const;
QVariant value( QgsServerSettingsEnv::EnvVar envVar, bool actual = false ) const;
QMap<QgsServerSettingsEnv::EnvVar, QString> getEnv() const;
void loadQSettings( const QString &envOptPath ) const;
void prioritize( const QMap<QgsServerSettingsEnv::EnvVar, QString> &env );

0 comments on commit f1e9c7e

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