QGIS API Documentation 3.41.0-Master (45a0abf3bec)
Loading...
Searching...
No Matches
Public Slots | Signals | Public Member Functions | Static Public Member Functions | List of all members
QgsConfigCache Class Reference

Cache for server configuration. More...

#include <qgsconfigcache.h>

Inheritance diagram for QgsConfigCache:
Inheritance graph
[legend]

Public Slots

void removeChangedEntries ()
 Remove all changed cache entries.
 
void removeChangedEntry (const QString &path)
 Remove cache entry.
 

Signals

void projectRemovedFromCache (const QString &path)
 Emitted whenever a project is removed from the cache.
 

Public Member Functions

 QgsConfigCache (QgsAbstractCacheStrategy *strategy)
 Initialize with a strategy implementation.
 
 QgsConfigCache (QgsServerSettings *settings)
 Initialize from settings.
 
const QgsProjectproject (const QString &path, const QgsServerSettings *settings=nullptr)
 If the project is not cached yet, then the project is read from the path.
 
QList< QgsProject * > projects () const
 Returns projects currently in cache.
 
void removeEntry (const QString &path)
 Removes an entry from cache.
 
QString strategyName () const
 Returns the name of the current strategy.
 

Static Public Member Functions

static void initialize (QgsServerSettings *settings)
 Initialize from settings.
 
static QgsConfigCacheinstance ()
 Returns the current instance.
 

Detailed Description

Cache for server configuration.

Definition at line 76 of file qgsconfigcache.h.

Constructor & Destructor Documentation

◆ QgsConfigCache() [1/2]

QgsConfigCache::QgsConfigCache ( QgsServerSettings settings)

Initialize from settings.

Definition at line 81 of file qgsconfigcache.cpp.

◆ QgsConfigCache() [2/2]

QgsConfigCache::QgsConfigCache ( QgsAbstractCacheStrategy strategy)

Initialize with a strategy implementation.

Definition at line 87 of file qgsconfigcache.cpp.

Member Function Documentation

◆ initialize()

void QgsConfigCache::initialize ( QgsServerSettings settings)
static

Initialize from settings.

This method must be called prior any call to QgsConfigCache::instance

Definition at line 58 of file qgsconfigcache.cpp.

◆ instance()

QgsConfigCache * QgsConfigCache::instance ( )
static

Returns the current instance.

Definition at line 71 of file qgsconfigcache.cpp.

◆ project()

const QgsProject * QgsConfigCache::project ( const QString &  path,
const QgsServerSettings settings = nullptr 
)

If the project is not cached yet, then the project is read from the path.

If the project is not available, then nullptr is returned. If the project contains any bad layer it is considered unavailable unless the server configuration variable QGIS_SERVER_IGNORE_BAD_LAYERS passed in the optional settings argument is set to true (the default value is false).

Parameters
paththe filename of the QGIS project
settingsQGIS server settings
Returns
the project or nullptr if an error happened

Definition at line 98 of file qgsconfigcache.cpp.

◆ projectRemovedFromCache

void QgsConfigCache::projectRemovedFromCache ( const QString &  path)
signal

Emitted whenever a project is removed from the cache.

Since
QGIS 3.38

◆ projects()

QList< QgsProject * > QgsConfigCache::projects ( ) const

Returns projects currently in cache.

Since
QGIS 3.30

Definition at line 187 of file qgsconfigcache.cpp.

◆ removeChangedEntries

void QgsConfigCache::removeChangedEntries ( )
slot

Remove all changed cache entries.

Definition at line 266 of file qgsconfigcache.cpp.

◆ removeChangedEntry

void QgsConfigCache::removeChangedEntry ( const QString &  path)
slot

Remove cache entry.

Definition at line 260 of file qgsconfigcache.cpp.

◆ removeEntry()

void QgsConfigCache::removeEntry ( const QString &  path)

Removes an entry from cache.

Parameters
pathThe path of the project

Definition at line 246 of file qgsconfigcache.cpp.

◆ strategyName()

QString QgsConfigCache::strategyName ( ) const
inline

Returns the name of the current strategy.

Since
QGIS 3.26

Definition at line 116 of file qgsconfigcache.h.


The documentation for this class was generated from the following files: