summaryrefslogtreecommitdiffstats
path: root/src/crsm.hpp
diff options
context:
space:
mode:
authorMarkus Mittendrein <git@maxmitti.tk>2015-10-13 15:33:22 +0200
committerMarkus Mittendrein <git@maxmitti.tk>2015-10-13 15:33:22 +0200
commit1f6b9d308650b702cdfe49b7540bef4b3a4fc9f9 (patch)
treeac6775440f54478148397b0c499dd894c49a8c7f /src/crsm.hpp
parent2edcec94e9e3f55313d4aa6d784e52ce37f1ba0e (diff)
downloadmanager-1f6b9d308650b702cdfe49b7540bef4b3a4fc9f9.tar.gz
manager-1f6b9d308650b702cdfe49b7540bef4b3a4fc9f9.zip
Correctly escape ClientInfo and ScenarioSettings
Diffstat (limited to 'src/crsm.hpp')
-rw-r--r--src/crsm.hpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/crsm.hpp b/src/crsm.hpp
index cdce0d1..3e11054 100644
--- a/src/crsm.hpp
+++ b/src/crsm.hpp
@@ -65,8 +65,8 @@ public:
void setValue(const QString& val)
{
- QStringList parts = val.split(':', QString::KeepEmptyParts);
- if(parts.length() < 3)
+ QStringList parts = Util::splitEscaped(val, ':', '|');
+ if(parts.length() != 3)
{
throw ConfigException("Cannot read corrupt ScenarioSettings");
}
@@ -77,11 +77,11 @@ public:
config.league = ConfigValueBase::getValue<bool>(parts.first());
parts.removeFirst();
config.randomLeague = false;
- config.wishClient = ConfigValueBase::getValue<ClientInfo>(parts.join(':'));
+ config.wishClient = ConfigValueBase::getValue<ClientInfo>(parts.first());
}
}
- QString value() { return ConfigValueBase::getStringValue(config.name) + ":" + ConfigValueBase::getStringValue(config.league) + ":" + ConfigValueBase::getStringValue(config.wishClient); }
+ QString value() { return Util::joinEscape({ConfigValueBase::getStringValue(config.name), ConfigValueBase::getStringValue(config.league), ConfigValueBase::getStringValue(config.wishClient)}, ':', '|'); }
};
class CRSM : public QObject