summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/QtUI/QtSettingsProvider.cpp')
-rw-r--r--Swift/QtUI/QtSettingsProvider.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/Swift/QtUI/QtSettingsProvider.cpp b/Swift/QtUI/QtSettingsProvider.cpp
index cf02d83..7012288 100644
--- a/Swift/QtUI/QtSettingsProvider.cpp
+++ b/Swift/QtUI/QtSettingsProvider.cpp
@@ -1,6 +1,8 @@
#include "QtSettingsProvider.h"
#include "QtSwiftUtil.h"
+#include <QStringList>
+
namespace Swift {
QtSettingsProvider::QtSettingsProvider() {
@@ -28,5 +30,20 @@ void QtSettingsProvider::storeBool(const String &settingPath, bool settingValue)
settings_.setValue(P2QSTRING(settingPath), settingValue);
}
+std::vector<String> QtSettingsProvider::getAvailableProfiles() {
+ std::vector<String> profiles;
+ QVariant profilesVariant = settings_.value("profileList");
+ foreach(QString profileQString, profilesVariant.toStringList()) {
+ profiles.push_back(Q2PSTRING(profileQString));
+ }
+ return profiles;
+}
+
+void QtSettingsProvider::createProfile(const String& profile) {
+ QStringList stringList = settings_.value("profileList").toStringList();
+ stringList.append(P2QSTRING(profile));
+ settings_.setValue("profileList", stringList);
+}
+
}