Skip to content
Permalink
Browse files

Merge pull request #39344 from elpaso/server-landing-page-rename-env-…

…vars

Server landing page: rename vars, no functional changes
  • Loading branch information
elpaso committed Oct 13, 2020
2 parents 8d3e028 + 6145f3a commit ff7641df61172d5ef7d9893ad35e94a515480cd1
@@ -39,8 +39,8 @@ std::once_flag initDirWatcher;
QMap<QString, QString> QgsLandingPageUtils::projects( const QgsServerSettings &settings )
{

static QString QGIS_SERVER_PROJECTS_DIRECTORIES;
static QString QGIS_SERVER_PROJECTS_PG_CONNECTIONS;
static QString QGIS_SERVER_LANDING_PAGE_PROJECTS_DIRECTORIES;
static QString QGIS_SERVER_LANDING_PAGE_PROJECTS_PG_CONNECTIONS;

// Init directory watcher
static QFileSystemWatcher dirWatcher;
@@ -56,25 +56,25 @@ QMap<QString, QString> QgsLandingPageUtils::projects( const QgsServerSettings &s

const QString projectDir { settings.landingPageProjectsDirectories() };

// Clear cache if QGIS_SERVER_PROJECTS_DIRECTORIES has changed
if ( projectDir != QGIS_SERVER_PROJECTS_DIRECTORIES )
// Clear cache if QGIS_SERVER_LANDING_PAGE_PROJECTS_DIRECTORIES has changed
if ( projectDir != QGIS_SERVER_LANDING_PAGE_PROJECTS_DIRECTORIES )
{
QGIS_SERVER_PROJECTS_DIRECTORIES = projectDir;
QGIS_SERVER_LANDING_PAGE_PROJECTS_DIRECTORIES = projectDir;
AVAILABLE_PROJECTS.clear();
const QStringList cWatchedDirs { dirWatcher.directories() };
dirWatcher.removePaths( cWatchedDirs );
}

const QString pgConnections { settings.landingPageProjectsPgConnections() };

// Clear cache if QGIS_SERVER_PROJECTS_PG_CONNECTIONS has changed
if ( pgConnections != QGIS_SERVER_PROJECTS_PG_CONNECTIONS )
// Clear cache if QGIS_SERVER_LANDING_PAGE_PROJECTS_PG_CONNECTIONS has changed
if ( pgConnections != QGIS_SERVER_LANDING_PAGE_PROJECTS_PG_CONNECTIONS )
{
QGIS_SERVER_PROJECTS_PG_CONNECTIONS = pgConnections;
QGIS_SERVER_LANDING_PAGE_PROJECTS_PG_CONNECTIONS = pgConnections;
AVAILABLE_PROJECTS.clear();
}

// Scan QGIS_SERVER_PROJECTS_DIRECTORIES
// Scan QGIS_SERVER_LANDING_PAGE_PROJECTS_DIRECTORIES
const QString envDirName = QgsServerSettings::name( QgsServerSettingsEnv::QGIS_SERVER_LANDING_PAGE_PROJECTS_DIRECTORIES );
if ( AVAILABLE_PROJECTS.isEmpty() )
{
@@ -39,8 +39,8 @@ struct QgsLandingPageUtils
/**
* Returns a list of available projects from various sources:
*
* - QGIS_SERVER_PROJECTS_DIRECTORIES directories
* - QGIS_SERVER_PROJECTS_PG_CONNECTIONS postgres connections
* - QGIS_SERVER_LANDING_PAGE_PROJECTS_DIRECTORIES directories
* - QGIS_SERVER_LANDING_PAGE_PROJECTS_PG_CONNECTIONS postgres connections
*
* Multiple paths and connections may be separated by two pipe chars: '||'
*

0 comments on commit ff7641d

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