diff options
author | Kevin Smith <git@kismith.co.uk> | 2010-08-20 13:42:05 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2010-08-20 13:55:42 (GMT) |
commit | c5b8d80800af29bcab6ba2263033fa0d7dc797ef (patch) | |
tree | c4078ef1e7b8828f35a529ccf566db1af242bf7d /Swift/QtUI | |
parent | ecd62de51a5dbca99481720e274737241236e170 (diff) | |
download | swift-contrib-c5b8d80800af29bcab6ba2263033fa0d7dc797ef.zip swift-contrib-c5b8d80800af29bcab6ba2263033fa0d7dc797ef.tar.bz2 |
Restart with previous (per-accoun) status.
Resolves: #390
Diffstat (limited to 'Swift/QtUI')
-rw-r--r-- | Swift/QtUI/QtSettingsProvider.cpp | 9 | ||||
-rw-r--r-- | Swift/QtUI/QtSettingsProvider.h | 2 |
2 files changed, 11 insertions, 0 deletions
diff --git a/Swift/QtUI/QtSettingsProvider.cpp b/Swift/QtUI/QtSettingsProvider.cpp index 4100c7d..ea0013a 100644 --- a/Swift/QtUI/QtSettingsProvider.cpp +++ b/Swift/QtUI/QtSettingsProvider.cpp @@ -36,6 +36,15 @@ void QtSettingsProvider::storeBool(const String &settingPath, bool settingValue) settings_.setValue(P2QSTRING(settingPath), settingValue); } +int QtSettingsProvider::getIntSetting(const String &settingPath, int defaultValue) { + QVariant setting = settings_.value(P2QSTRING(settingPath)); + return setting.isNull() ? defaultValue : setting.toInt(); +} + +void QtSettingsProvider::storeInt(const String &settingPath, int settingValue) { + settings_.setValue(P2QSTRING(settingPath), settingValue); +} + std::vector<String> QtSettingsProvider::getAvailableProfiles() { std::vector<String> profiles; QVariant profilesVariant = settings_.value("profileList"); diff --git a/Swift/QtUI/QtSettingsProvider.h b/Swift/QtUI/QtSettingsProvider.h index 75c5678..93f9ec1 100644 --- a/Swift/QtUI/QtSettingsProvider.h +++ b/Swift/QtUI/QtSettingsProvider.h @@ -21,6 +21,8 @@ class QtSettingsProvider : public SettingsProvider { virtual void storeString(const String &settingPath, const String &settingValue); virtual bool getBoolSetting(const String &settingPath, bool defaultValue); virtual void storeBool(const String &settingPath, bool settingValue); + virtual int getIntSetting(const String &settingPath, int defaultValue); + virtual void storeInt(const String &settingPath, int settingValue); virtual std::vector<String> getAvailableProfiles(); virtual void createProfile(const String& profile); QSettings* getQSettings(); |