1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-22 20:53:53 +00:00
openmw/apps/opencs/model/settings/usersettings.hpp

67 lines
1.5 KiB
C++
Raw Normal View History

2013-05-08 01:33:42 +00:00
#ifndef USERSETTINGS_HPP
#define USERSETTINGS_HPP
#include <QTextStream>
#include <QStringList>
#include <QString>
#include <QMap>
#include <boost/filesystem/path.hpp>
#include "settingmanager.hpp"
2013-05-08 01:33:42 +00:00
#ifndef Q_MOC_RUN
#include <components/files/configurationmanager.hpp>
#endif
2013-05-08 01:33:42 +00:00
namespace Files { typedef std::vector<boost::filesystem::path> PathContainer;
struct ConfigurationManager;}
class QFile;
class QSettings;
2013-05-08 01:33:42 +00:00
namespace CSMSettings {
2013-05-08 01:33:42 +00:00
class UserSettings: public SettingManager
2013-05-08 01:33:42 +00:00
{
Q_OBJECT
static UserSettings *mUserSettingsInstance;
QString mUserFilePath;
Files::ConfigurationManager mCfgMgr;
QString mReadOnlyMessage;
QString mReadWriteMessage;
QSettings *mSettings;
2013-05-08 01:33:42 +00:00
public:
/// Singleton implementation
static UserSettings& instance();
2013-06-12 10:36:35 +00:00
UserSettings();
~UserSettings();
UserSettings (UserSettings const &); //not implemented
void operator= (UserSettings const &); //not implemented
2013-05-08 01:33:42 +00:00
/// Writes settings to the last loaded settings file
bool writeSettings();
/// Retrieves the settings file at all three levels (global, local and user).
void loadSettings (const QString &fileName);
2013-05-08 01:33:42 +00:00
/// Writes settings to the user's config file path
void saveSettings (const QMap <QString, QStringList > &settingMap);
QString settingValue (const QString &settingKey);
2013-05-08 01:33:42 +00:00
private:
void buildSettingModelDefaults();
2013-05-08 01:33:42 +00:00
};
}
#endif // USERSETTINGS_HPP