Manages the domain-wide settings. More...
#include <DomainServerSettingsManager.h>
Inherits QObject.
Public Member Functions | |
void | setupConfigMap (const QString &userConfigFilename) |
Loads the configuration from the specified file. More... | |
QJsonObject | settingsResponseObjectForType (const QString &typeValue, SettingsRequestAuthentication authentication=NotAuthenticated, DomainSettingsInclusion domainSettingsInclusion=IncludeDomainSettings, ContentSettingsInclusion contentSettingsInclusion=IncludeContentSettings, DefaultSettingsInclusion defaultSettingsInclusion=IncludeDefaultSettings, SettingsBackupFlag settingsBackupFlag=NotForBackup) |
Generates a JSON representation of settings. More... | |
Q_INVOKABLE bool | restoreSettingsFromObject (QJsonObject settingsToRestore, SettingsType settingsType) |
thread safe method to restore settings from a JSON object | |
Manages the domain-wide settings.
The domain server doesn't use the interface's QSettings based system, but this one. The domain holds all the settings and distributes it to the connected assignment clients.
Assignment clients request their settings by making a DomainSettingsRequest. The request is specific to the client's type.
The response is generated in settingsResponseObjectForType and filtered according to what the client is allowed to see.
To add a new setting, add it in resources/describe-settings.json
To make a setting be sent to assignment clients, set the assignment-types value to an array of the desired assignment clients. The type is defined numerically.
The canonical list of assignment types is in the Assignment::Type enum.
QJsonObject DomainServerSettingsManager::settingsResponseObjectForType | ( | const QString & | typeValue, |
SettingsRequestAuthentication | authentication = NotAuthenticated , |
||
DomainSettingsInclusion | domainSettingsInclusion = IncludeDomainSettings , |
||
ContentSettingsInclusion | contentSettingsInclusion = IncludeContentSettings , |
||
DefaultSettingsInclusion | defaultSettingsInclusion = IncludeDefaultSettings , |
||
SettingsBackupFlag | settingsBackupFlag = NotForBackup |
||
) |
Generates a JSON representation of settings.
This is what answers an assignment client's request for domain settings.
typeValue | Type of assignment client |
authentication | |
domainSettingsInclusion | |
contentSettingsInclusion | |
defaultSettingsInclusion | |
settingsBackupFlag |
void DomainServerSettingsManager::setupConfigMap | ( | const QString & | userConfigFilename | ) |
Loads the configuration from the specified file.
Performs version upgrades when we're loading an older version of the config.
userConfigFilename |