From cf19c87f6561afee7aba5591d3c81b7a158449ea Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Mon, 12 Aug 2019 15:37:52 +0900 Subject: Make Settings::remove() to clear the legacy; more doc-comments --- lib/settings.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib/settings.cpp') diff --git a/lib/settings.cpp b/lib/settings.cpp index 9c61ab5e..3bf61605 100644 --- a/lib/settings.cpp +++ b/lib/settings.cpp @@ -18,12 +18,18 @@ void Settings::setLegacyNames(const QString& organizationName, void Settings::setValue(const QString& key, const QVariant& value) { - // qCDebug() << "Setting" << key << "to" << value; QSettings::setValue(key, value); if (legacySettings.contains(key)) legacySettings.remove(key); } +void Settings::remove(const QString& key) +{ + QSettings::remove(key); + if (legacySettings.contains(key)) + legacySettings.remove(key); +} + QVariant Settings::value(const QString& key, const QVariant& defaultValue) const { auto value = QSettings::value(key, legacySettings.value(key, defaultValue)); -- cgit v1.2.3