OpenMW
Signals | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions
CSMSettings::UserSettings Struct Reference

#include <usersettings.hpp>

List of all members.

Signals

void signalUpdateEditorSetting (const QString &settingName, const QString &settingValue)

Public Member Functions

 UserSettings ()
 ~UserSettings ()
 UserSettings (UserSettings const &)
void operator= (UserSettings const &)
bool writeSettings (QMap< QString, SettingList * > &sections)
 Writes settings to the last loaded settings file.
void updateSettings (const QString &sectionName, const QString &settingName="")
void loadSettings (const QString &fileName)
 Retrieves the settings file at all three levels (global, local and user).
const SectionMapgetSectionMap () const
 Returns the entire map of settings across all sections.
const SettingMapgetSettings (const QString &sectionName) const
QString getSetting (const QString &section, const QString &setting) const
 Retrieves the value as a QString of the specified setting in the specified section.

Static Public Member Functions

static UserSettingsinstance ()
 Singleton implementation.

Public Attributes

SectionMap mSectionSettings
SectionMap mEditorSettingDefaults
QString mUserFilePath
Files::ConfigurationManager mCfgMgr
QString mReadOnlyMessage
QString mReadWriteMessage

Static Public Attributes

static UserSettingsmUserSettingsInstance = 0

Private Member Functions

QTextStream * openFileStream (const QString &filePath, bool isReadOnly=false) const
 Opens a QTextStream from the provided path as read-only or read-write.
bool loadFromFile (const QString &filePath="")
 Parses a setting file specified in filePath from the provided text stream.
void mergeMap (const SectionMap &)
 merge the passed map into mSectionSettings
void displayFileErrorMessage (const QString &message, bool isReadOnly)
void buildEditorSettingDefaults ()
SettingMapgetValidSettings (const QString &sectionName) const

Constructor & Destructor Documentation


Member Function Documentation

void CSMSettings::UserSettings::displayFileErrorMessage ( const QString &  message,
bool  isReadOnly 
) [private]

Returns the entire map of settings across all sections.

QString CSMSettings::UserSettings::getSetting ( const QString &  section,
const QString &  setting 
) const

Retrieves the value as a QString of the specified setting in the specified section.

const CSMSettings::SettingMap * CSMSettings::UserSettings::getSettings ( const QString &  sectionName) const
CSMSettings::SettingMap * CSMSettings::UserSettings::getValidSettings ( const QString &  sectionName) const [private]

Singleton implementation.

bool CSMSettings::UserSettings::loadFromFile ( const QString &  filePath = "") [private]

Parses a setting file specified in filePath from the provided text stream.

void CSMSettings::UserSettings::loadSettings ( const QString &  fileName)

Retrieves the settings file at all three levels (global, local and user).

Todo:

Multi-valued settings are not fully implemented. Setting values

loaded in later files will always overwrite previously loaded values.

void CSMSettings::UserSettings::mergeMap ( const SectionMap sectionSettings) [private]

merge the passed map into mSectionSettings

QTextStream * CSMSettings::UserSettings::openFileStream ( const QString &  filePath,
bool  isReadOnly = false 
) const [private]

Opens a QTextStream from the provided path as read-only or read-write.

void CSMSettings::UserSettings::operator= ( UserSettings const &  )
void CSMSettings::UserSettings::signalUpdateEditorSetting ( const QString &  settingName,
const QString &  settingValue 
) [signal]
void CSMSettings::UserSettings::updateSettings ( const QString &  sectionName,
const QString &  settingName = "" 
)

Called from editor to trigger signal to update the specified setting. If no setting name is specified, all settings found in the specified section are updated.

bool CSMSettings::UserSettings::writeSettings ( QMap< QString, SettingList * > &  sections)

Writes settings to the last loaded settings file.


Member Data Documentation


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