hyperion.ng
Signals | Public Member Functions | List of all members
SettingsManager Class Reference

Manage the settings read write from/to config file, on settings changed will emit a signal to update components accordingly. More...

#include <SettingsManager.h>

Inheritance diagram for SettingsManager:

Signals

void settingsChanged (const settings::type &type, const QJsonDocument &data)
 Emits whenever a config part changed. More...
 

Public Member Functions

 SettingsManager (Hyperion *hyperion, const quint8 &instance, const QString &configFile)
 Construct a settings manager and assign a hyperion instance hyperion The parent hyperion instance instance Instance number of Hyperion.
 
 SettingsManager (const quint8 &instance, const QString &configFile)
 Construct a settings manager for HyperionDaemon.
 
bool saveSettings (QJsonObject config, const bool &correct=false)
 Save a complete json config. More...
 
const QJsonDocument getSetting (const settings::type &type)
 get a single setting json from config More...
 
const QJsonObject & getSettings ()
 get the full settings object of this instance (with global settings) More...
 

Detailed Description

Manage the settings read write from/to config file, on settings changed will emit a signal to update components accordingly.

Member Function Documentation

§ getSetting()

const QJsonDocument SettingsManager::getSetting ( const settings::type &  type)

get a single setting json from config

Parameters
typeThe settings::type from enum
Returns
The requested json data as QJsonDocument

§ getSettings()

const QJsonObject& SettingsManager::getSettings ( )
inline

get the full settings object of this instance (with global settings)

Returns
The requested json

§ saveSettings()

bool SettingsManager::saveSettings ( QJsonObject  config,
const bool &  correct = false 
)

Save a complete json config.

Parameters
configThe entire config object
correctIf true will correct json against schema before save
Returns
True on success else false

§ settingsChanged

void SettingsManager::settingsChanged ( const settings::type &  type,
const QJsonDocument &  data 
)
signal

Emits whenever a config part changed.

Parameters
typeThe settings type from enum
dataThe data as QJsonDocument

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