DoomseekerConfig Class Reference

This Singleton holds entire Doomseeker configuration in memory. More...

#include <doomseekerconfig.h>

Classes

class  AutoUpdates
 
class  DoomseekerCfg
 
class  ServerFilter
 
class  WadseekerCfg
 

Public Member Functions

Iniini ()
 
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 DoomseekerConfigconfig ()
 Returns the Singleton. More...
 
static void dispose ()
 Disposes of the Singleton. More...
 

Public Attributes

AutoUpdates autoUpdates
 
DoomseekerCfg doomseeker
 
ServerFilter serverFilter
 
WadseekerCfg wadseeker
 

Detailed Description

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 54 of file doomseekerconfig.h.

Member Function Documentation

DoomseekerConfig & DoomseekerConfig::config ( )
static

Returns the Singleton.

Definition at line 55 of file doomseekerconfig.cpp.

void DoomseekerConfig::dispose ( )
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 65 of file doomseekerconfig.cpp.

IniSection DoomseekerConfig::iniSectionForPlugin ( const QString &  pluginName)

This will assume that the .ini file is initialized.

If the pIni pointer is NULL this will call setIniFile() with empty string parameter to prevent crash.

Parameters
pluginNameName 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.
See Also
dummySection

Definition at line 74 of file doomseekerconfig.cpp.

bool DoomseekerConfig::readFromFile ( )

Reads settings from ini file. This file must be previously set by setIniFile() method.

Definition at line 118 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 142 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 177 of file doomseekerconfig.cpp.


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