diff options
| author | Markus Mittendrein <git@maxmitti.tk> | 2015-09-22 19:22:37 +0200 |
|---|---|---|
| committer | Markus Mittendrein <git@maxmitti.tk> | 2015-09-22 19:22:37 +0200 |
| commit | b9816896abacac108d54ccdc1286b2542465287b (patch) | |
| tree | 1239ebd5369af44a45c0ef4555128ff199af891d /src | |
| parent | b9a818bebcfc6e261959c4df95330594e9cbcffc (diff) | |
| download | manager-b9816896abacac108d54ccdc1286b2542465287b.tar.gz manager-b9816896abacac108d54ccdc1286b2542465287b.zip | |
Only add value to list if its not already there.
Diffstat (limited to 'src')
| -rw-r--r-- | src/CRSMConfig.cpp | 9 | ||||
| -rw-r--r-- | src/CRSMConfig.hpp | 7 |
2 files changed, 6 insertions, 10 deletions
diff --git a/src/CRSMConfig.cpp b/src/CRSMConfig.cpp index 25f8bd1..8fe5995 100644 --- a/src/CRSMConfig.cpp +++ b/src/CRSMConfig.cpp @@ -142,14 +142,9 @@ bool CRSMConfig::write(const QString &fileName) } } -void CRSMConfig::operator()(CRSMConfig &&other) +void CRSMConfig::clear() { auto curConfigValues(configValues); - *this = other; + (*this) = CRSMConfig(); configValues = curConfigValues; } - -void CRSMConfig::clear() -{ - (*this)(CRSMConfig()); -} diff --git a/src/CRSMConfig.hpp b/src/CRSMConfig.hpp index ef77716..2d0c2e4 100644 --- a/src/CRSMConfig.hpp +++ b/src/CRSMConfig.hpp @@ -128,7 +128,10 @@ public: Type val; CRSMConfigValue<Type> configValue(val); configValue.setValue(entry); - config.append(val); + if(!config.contains(val)) + { + config.append(val); + } } virtual QStringList getValues() @@ -268,8 +271,6 @@ public: explicit CRSMConfig(); - void operator()(CRSMConfig&& other); - void setConfigValue(const QString& name, const QString& value); void addConfigListEntry(const QString& name, const QString& value); void setConfigMapValue(const QString& name, const QString& key, const QString& value); |
