OpenMW
|
#include <usersettings.hpp>
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 * > §ions) |
Writes settings to the last loaded settings file. | |
void | updateSettings (const QString §ionName, const QString &settingName="") |
void | loadSettings (const QString &fileName) |
Retrieves the settings file at all three levels (global, local and user). | |
const SectionMap & | getSectionMap () const |
Returns the entire map of settings across all sections. | |
const SettingMap * | getSettings (const QString §ionName) const |
QString | getSetting (const QString §ion, const QString &setting) const |
Retrieves the value as a QString of the specified setting in the specified section. | |
Static Public Member Functions | |
static UserSettings & | instance () |
Singleton implementation. | |
Public Attributes | |
SectionMap | mSectionSettings |
SectionMap | mEditorSettingDefaults |
QString | mUserFilePath |
Files::ConfigurationManager | mCfgMgr |
QString | mReadOnlyMessage |
QString | mReadWriteMessage |
Static Public Attributes | |
static UserSettings * | mUserSettingsInstance = 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 () |
SettingMap * | getValidSettings (const QString §ionName) const |
CSMSettings::UserSettings::UserSettings | ( | UserSettings const & | ) |
void CSMSettings::UserSettings::buildEditorSettingDefaults | ( | ) | [private] |
void CSMSettings::UserSettings::displayFileErrorMessage | ( | const QString & | message, |
bool | isReadOnly | ||
) | [private] |
const CSMSettings::SectionMap & CSMSettings::UserSettings::getSectionMap | ( | ) | const |
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] |
CSMSettings::UserSettings & CSMSettings::UserSettings::instance | ( | ) | [static] |
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).
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.