This Singleton holds entire Doomseeker configuration in memory. More...
#include <doomseekerconfig.h>
Classes | |
class | AutoUpdates |
class | DoomseekerCfg |
class | ServerFilter |
class | WadseekerCfg |
Public Member Functions | |
QList< FileSearchPath > | combinedWadseekPaths () const |
Ini * | ini () |
IniSection | iniSectionForPlugin (const QString &pluginName) |
This will assume that the .ini file is initialized. More... | |
IniSection | iniSectionForPlugin (const EnginePlugin *plugin) |
bool | readFromFile () |
Reads settings from ini file. This file must be previously set by setIniFile() method. More... | |
bool | saveToFile () |
Saves current settings to ini file. This file must be previously set by setIniFile() method. More... | |
bool | setIniFile (const QString &filePath) |
Initializes the Ini class instance to point to a file. More... | |
Static Public Member Functions | |
static DoomseekerConfig & | config () |
Returns the Singleton. More... | |
static void | dispose () |
Disposes of the Singleton. More... | |
Public Attributes | |
AutoUpdates | autoUpdates |
DoomseekerCfg | doomseeker |
ServerFilter | serverFilter |
WadseekerCfg | wadseeker |
This Singleton holds entire Doomseeker configuration in memory.
The first time it is instantiated the cfg variables are set to default values. Then they can be either read from or saved to a .ini file. The save is handled internally and external access to the .ini file should remain minimal.
Definition at line 53 of file doomseekerconfig.h.
|
static |
Returns the Singleton.
Definition at line 90 of file doomseekerconfig.cpp.
|
static |
Disposes of the Singleton.
This will NOT save the current config to a file. It is safe to call even if the config was not initialized first.
Definition at line 98 of file doomseekerconfig.cpp.
IniSection DoomseekerConfig::iniSectionForPlugin | ( | const QString & | pluginName | ) |
This will assume that the .ini file is initialized.
If the pIni pointer is nullptr this will call setIniFile() with empty string parameter to prevent crash.
pluginName | Name of the plugin, equals name of the Ini section stripped of all spacebars. Cannot be equal to "wadseeker" or "doomseeker". If invalid pluginName is specified a dummy trashcan IniSection is returned and a proper log message is generated. |
Definition at line 107 of file doomseekerconfig.cpp.
bool DoomseekerConfig::readFromFile | ( | ) |
Reads settings from ini file. This file must be previously set by setIniFile() method.
Definition at line 147 of file doomseekerconfig.cpp.
bool DoomseekerConfig::saveToFile | ( | ) |
Saves current settings to ini file. This file must be previously set by setIniFile() method.
Definition at line 169 of file doomseekerconfig.cpp.
bool DoomseekerConfig::setIniFile | ( | const QString & | filePath | ) |
Initializes the Ini class instance to point to a file.
This method will properly dispose of the previous ini file. However it will neither save the old ini file or read the new one.
Definition at line 203 of file doomseekerconfig.cpp.