aboutsummaryrefslogtreecommitdiff
path: root/lib/settings.cpp
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2019-08-12 15:37:52 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2019-08-12 15:37:52 +0900
commitcf19c87f6561afee7aba5591d3c81b7a158449ea (patch)
tree68c9ff1e22fe6a8ef9aac093f072b517adcffe49 /lib/settings.cpp
parentac2b6ddae48a15e57ef3c72caf33711ae01a9fbd (diff)
downloadlibquotient-cf19c87f6561afee7aba5591d3c81b7a158449ea.tar.gz
libquotient-cf19c87f6561afee7aba5591d3c81b7a158449ea.zip
Make Settings::remove() to clear the legacy; more doc-comments
Diffstat (limited to 'lib/settings.cpp')
-rw-r--r--lib/settings.cpp8
1 files changed, 7 insertions, 1 deletions
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));