summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2009-09-12 18:55:01 (GMT)
committerKevin Smith <git@kismith.co.uk>2009-09-12 18:55:01 (GMT)
commit7dafb815ca404f1e15c9cdf6b26817c941dae4ec (patch)
tree5f1a523042bd4b9ccb84efce74ab2441dacef8ea /Swift/QtUI
parent7e157ace6678dd4af7a091ea5cc5fbc3baabe7f7 (diff)
downloadswift-7dafb815ca404f1e15c9cdf6b26817c941dae4ec.zip
swift-7dafb815ca404f1e15c9cdf6b26817c941dae4ec.tar.bz2
Getting ready for sounds to be turned off.
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 42540c1..cf02d83 100644
--- a/Swift/QtUI/QtSettingsProvider.cpp
+++ b/Swift/QtUI/QtSettingsProvider.cpp
@@ -19,5 +19,14 @@ void QtSettingsProvider::storeString(const String &settingPath, const String &se
settings_.setValue(P2QSTRING(settingPath), P2QSTRING(settingValue));
}
+bool QtSettingsProvider::getBoolSetting(const String &settingPath, bool defaultValue) {
+ QVariant setting = settings_.value(P2QSTRING(settingPath));
+ return setting.isNull() ? defaultValue : setting.toBool();
+}
+
+void QtSettingsProvider::storeBool(const String &settingPath, bool settingValue) {
+ settings_.setValue(P2QSTRING(settingPath), settingValue);
+}
+
}
diff --git a/Swift/QtUI/QtSettingsProvider.h b/Swift/QtUI/QtSettingsProvider.h
index 4739f60..fec4101 100644
--- a/Swift/QtUI/QtSettingsProvider.h
+++ b/Swift/QtUI/QtSettingsProvider.h
@@ -13,6 +13,8 @@ class QtSettingsProvider : public SettingsProvider {
virtual ~QtSettingsProvider();
virtual String getStringSetting(const String &settingPath);
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);
private:
QSettings settings_;
};