diff options
| author | Markus Mittendrein <git@maxmitti.tk> | 2015-10-13 15:33:22 +0200 |
|---|---|---|
| committer | Markus Mittendrein <git@maxmitti.tk> | 2015-10-13 15:33:22 +0200 |
| commit | 1f6b9d308650b702cdfe49b7540bef4b3a4fc9f9 (patch) | |
| tree | ac6775440f54478148397b0c499dd894c49a8c7f /src/crsm.hpp | |
| parent | 2edcec94e9e3f55313d4aa6d784e52ce37f1ba0e (diff) | |
| download | manager-1f6b9d308650b702cdfe49b7540bef4b3a4fc9f9.tar.gz manager-1f6b9d308650b702cdfe49b7540bef4b3a4fc9f9.zip | |
Correctly escape ClientInfo and ScenarioSettings
Diffstat (limited to 'src/crsm.hpp')
| -rw-r--r-- | src/crsm.hpp | 8 |
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 |
