aboutsummaryrefslogtreecommitdiff
path: root/lib/settings.cpp
diff options
context:
space:
mode:
authorBlack Hat <bhat@encom.eu.org>2019-09-30 21:38:00 -0700
committerBlack Hat <bhat@encom.eu.org>2019-09-30 21:38:00 -0700
commit3e694fc4c85920d897979f955901cfd93dfba562 (patch)
treed9b2a84259ec6a41b6ecdc4d02d2c87a52794c1a /lib/settings.cpp
parent6870ee0d7a0df3427845de07ddae1e2fd5768bbb (diff)
parentf71d16b56ab90e494d6a41c276210a4ce593987e (diff)
downloadlibquotient-3e694fc4c85920d897979f955901cfd93dfba562.tar.gz
libquotient-3e694fc4c85920d897979f955901cfd93dfba562.zip
Merge branch 'master' of https://github.com/quotient-im/libQuotient into bhat-libqtolm-update
Diffstat (limited to 'lib/settings.cpp')
-rw-r--r--lib/settings.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/settings.cpp b/lib/settings.cpp
index 3bf61605..0349e699 100644
--- a/lib/settings.cpp
+++ b/lib/settings.cpp
@@ -49,7 +49,10 @@ bool Settings::contains(const QString& key) const
QStringList Settings::childGroups() const
{
auto l = QSettings::childGroups();
- return !l.isEmpty() ? l : legacySettings.childGroups();
+ for (const auto& g: legacySettings.childGroups())
+ if (!l.contains(g))
+ l.push_back(g);
+ return l;
}
void SettingsGroup::setValue(const QString& key, const QVariant& value)
@@ -88,11 +91,11 @@ void SettingsGroup::remove(const QString& key)
Settings::remove(fullKey);
}
-QMC_DEFINE_SETTING(AccountSettings, QString, deviceId, "device_id", {},
+QTNT_DEFINE_SETTING(AccountSettings, QString, deviceId, "device_id", {},
setDeviceId)
-QMC_DEFINE_SETTING(AccountSettings, QString, deviceName, "device_name", {},
+QTNT_DEFINE_SETTING(AccountSettings, QString, deviceName, "device_name", {},
setDeviceName)
-QMC_DEFINE_SETTING(AccountSettings, bool, keepLoggedIn, "keep_logged_in", false,
+QTNT_DEFINE_SETTING(AccountSettings, bool, keepLoggedIn, "keep_logged_in", false,
setKeepLoggedIn)
static const auto HomeserverKey = QStringLiteral("homeserver");