summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2010-08-20 13:42:05 (GMT)
committerKevin Smith <git@kismith.co.uk>2010-08-20 13:55:42 (GMT)
commitc5b8d80800af29bcab6ba2263033fa0d7dc797ef (patch)
treec4078ef1e7b8828f35a529ccf566db1af242bf7d /Swift/QtUI
parentecd62de51a5dbca99481720e274737241236e170 (diff)
downloadswift-c5b8d80800af29bcab6ba2263033fa0d7dc797ef.zip
swift-c5b8d80800af29bcab6ba2263033fa0d7dc797ef.tar.bz2
Restart with previous (per-accoun) status.
Resolves: #390
Diffstat (limited to 'Swift/QtUI')
-rw-r--r--Swift/QtUI/QtSettingsProvider.cpp9
-rw-r--r--Swift/QtUI/QtSettingsProvider.h2
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();