diff --git a/apps/launcher/settings/gamesettings.cpp b/apps/launcher/settings/gamesettings.cpp index 6b46a5160..c08179acc 100644 --- a/apps/launcher/settings/gamesettings.cpp +++ b/apps/launcher/settings/gamesettings.cpp @@ -88,7 +88,9 @@ bool GameSettings::readFile(QTextStream &stream) QString key = keyRe.cap(1).simplified(); QString value = keyRe.cap(2).simplified(); - mSettings.remove(key); + // Don't remove existing data entries + if (key != QLatin1String("data")) + mSettings.remove(key); QStringList values = cache.values(key); if (!values.contains(value)) { @@ -103,19 +105,6 @@ bool GameSettings::readFile(QTextStream &stream) return true; } - // Replace values from previous settings - QMapIterator i(cache); - while (i.hasNext()) { - i.next(); - - // Don't remove existing data entries - if (i.key() == QLatin1String("data")) - continue; - - if (mSettings.contains(i.key())) - mSettings.remove(i.key()); - } - // Merge the changed keys with those which didn't mSettings.unite(cache); validatePaths(); @@ -136,7 +125,7 @@ bool GameSettings::writeFile(QTextStream &stream) continue; // Quote paths with spaces - if (i.key() == QLatin1String("data") || i.key() == QLatin1String("data")) { + if (i.key() == QLatin1String("data")) { if (i.value().contains(" ")) { stream << i.key() << "=\"" << i.value() << "\"\n"; continue; diff --git a/apps/launcher/settings/settingsbase.hpp b/apps/launcher/settings/settingsbase.hpp index 321426eed..bbfad1fbb 100644 --- a/apps/launcher/settings/settingsbase.hpp +++ b/apps/launcher/settings/settingsbase.hpp @@ -85,14 +85,6 @@ public: return true; } - // Replace values from previous settings - QMapIterator i(mCache); - while (i.hasNext()) { - i.next(); - if (mSettings.contains(i.key())) - mSettings.remove(i.key()); - } - // Merge the changed keys with those which didn't mSettings.unite(mCache); return true;