summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
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();