Loading static settings from file. More...
#include <staticsettings.h>
Public Member Functions | |
| QStringList | entryList (const QString &prefix) |
| bool | tryLoad (const QString &dirName, const QString &fileName) |
| bool | tryLoad (const QString &fileName) |
| QString | readEntry (const QString &key, const QString &defValue=QString::null) |
| StaticSettings () | |
| ~StaticSettings () | |
Private Attributes | |
| QMap< QString, QString > | set |
Loading static settings from file.
Class managing static settings, loading them from file
| gui::StaticSettings::StaticSettings | ( | ) |
Default constructor
| gui::StaticSettings::~StaticSettings | ( | ) |
Default destructor
| QStringList gui::StaticSettings::entryList | ( | const QString & | prefix | ) |
Return list of all keys starting with given prefix followed by "/" Warning: this function is not efficient, as it traverse all the settings to find the result
| prefix | Prefix of items |
| QString gui::StaticSettings::readEntry | ( | const QString & | key, | |
| const QString & | defValue = QString::null | |||
| ) |
Read settings with given key from configuration file and return as QString
| key | Key to read from settings | |
| defValue | default value to use if key not found in settings. |
Referenced by gui::Settings::read().
| bool gui::StaticSettings::tryLoad | ( | const QString & | fileName | ) |
Try to load settings from given file in given directory. If succesful, return true and any settings loaded so far are reset and replaced by settings from given file If unsuccessful, return false
| fileName | file name |
| bool gui::StaticSettings::tryLoad | ( | const QString & | dirName, | |
| const QString & | fileName | |||
| ) |
Convenience overloaded function providing file parameter separated to file and directory name
| dirName | directory name | |
| fileName | file name |
Referenced by gui::Settings::initSettings().
QMap<QString,QString> gui::StaticSettings::set [private] |
Map containing all settings