diff options
author | Remko Tronçon <git@el-tramo.be> | 2011-02-15 20:06:54 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2011-02-15 20:06:54 (GMT) |
commit | 7a888846753b7f5059b4bc5f872dac45a92318a6 (patch) | |
tree | feede411f979469eed1c0142a3c12824e387ce40 | |
parent | c754f5bf313f6c6db02703ca5bd9eb5c679f66d4 (diff) | |
download | swift-7a888846753b7f5059b4bc5f872dac45a92318a6.zip swift-7a888846753b7f5059b4bc5f872dac45a92318a6.tar.bz2 |
Removed some uses of P2QSTRING and Q2PSTRING.
-rw-r--r-- | Swift/QtUI/QtSettingsProvider.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/Swift/QtUI/QtSettingsProvider.cpp b/Swift/QtUI/QtSettingsProvider.cpp index 4a8a868..e8479a4 100644 --- a/Swift/QtUI/QtSettingsProvider.cpp +++ b/Swift/QtUI/QtSettingsProvider.cpp @@ -5,7 +5,6 @@ */ #include "QtSettingsProvider.h" -#include "QtSwiftUtil.h" #include <QStringList> @@ -19,30 +18,30 @@ QtSettingsProvider::~QtSettingsProvider() { } std::string QtSettingsProvider::getStringSetting(const std::string &settingPath) { - QVariant setting = settings_.value(P2QSTRING(settingPath)); - return setting.isNull() ? "" : Q2PSTRING(setting.toString()); + QVariant setting = settings_.value(settingPath.c_str()); + return setting.isNull() ? "" : std::string(setting.toString().toUtf8()); } void QtSettingsProvider::storeString(const std::string &settingPath, const std::string &settingValue) { - settings_.setValue(P2QSTRING(settingPath), P2QSTRING(settingValue)); + settings_.setValue(settingPath.c_str(), settingValue.c_str()); } bool QtSettingsProvider::getBoolSetting(const std::string &settingPath, bool defaultValue) { - QVariant setting = settings_.value(P2QSTRING(settingPath)); + QVariant setting = settings_.value(settingPath.c_str()); return setting.isNull() ? defaultValue : setting.toBool(); } void QtSettingsProvider::storeBool(const std::string &settingPath, bool settingValue) { - settings_.setValue(P2QSTRING(settingPath), settingValue); + settings_.setValue(settingPath.c_str(), settingValue); } int QtSettingsProvider::getIntSetting(const std::string &settingPath, int defaultValue) { - QVariant setting = settings_.value(P2QSTRING(settingPath)); + QVariant setting = settings_.value(settingPath.c_str()); return setting.isNull() ? defaultValue : setting.toInt(); } void QtSettingsProvider::storeInt(const std::string &settingPath, int settingValue) { - settings_.setValue(P2QSTRING(settingPath), settingValue); + settings_.setValue(settingPath.c_str(), settingValue); } std::vector<std::string> QtSettingsProvider::getAvailableProfiles() { @@ -56,19 +55,19 @@ std::vector<std::string> QtSettingsProvider::getAvailableProfiles() { void QtSettingsProvider::createProfile(const std::string& profile) { QStringList stringList = settings_.value("profileList").toStringList(); - stringList.append(P2QSTRING(profile)); + stringList.append(profile.c_str()); settings_.setValue("profileList", stringList); } void QtSettingsProvider::removeProfile(const std::string& profile) { - QString profileStart(P2QSTRING(profile) + ":"); + QString profileStart(QString(profile.c_str()) + ":"); foreach (QString key, settings_.allKeys()) { if (key.startsWith(profileStart)) { settings_.remove(key); } } QStringList stringList = settings_.value("profileList").toStringList(); - stringList.removeAll(P2QSTRING(profile)); + stringList.removeAll(profile.c_str()); settings_.setValue("profileList", stringList); } |