diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2017-12-25 14:46:18 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2017-12-25 14:46:18 +0900 |
commit | cbfe29b3435fbe47fee268facbe6a82000fce0ad (patch) | |
tree | e922f1a1505ff1d0a3cdaca56ed5fd151c3aa410 /settings.cpp | |
parent | b1dd0e7ea87842fb5ff9deb14beb3474136b06f3 (diff) | |
parent | a4a1129385731c3999a6d5986a24fc069938245c (diff) | |
download | libquotient-cbfe29b3435fbe47fee268facbe6a82000fce0ad.tar.gz libquotient-cbfe29b3435fbe47fee268facbe6a82000fce0ad.zip |
Merge branch 'master' into kitsune-gtad
Diffstat (limited to 'settings.cpp')
-rw-r--r-- | settings.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/settings.cpp b/settings.cpp index 68914642..ac9c091c 100644 --- a/settings.cpp +++ b/settings.cpp @@ -1,7 +1,8 @@ #include "settings.h"
+#include "logging.h"
+
#include <QtCore/QUrl>
-#include <QtCore/QDebug>
using namespace QMatrixClient;
@@ -19,6 +20,8 @@ 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);
}
QVariant Settings::value(const QString& key, const QVariant& defaultValue) const
@@ -133,10 +136,14 @@ QString AccountSettings::accessToken() const void AccountSettings::setAccessToken(const QString& accessToken)
{
+ qCWarning(MAIN) << "Saving access_token to QSettings is insecure."
+ " Developers, please save access_token separately.";
setValue("access_token", accessToken);
}
void AccountSettings::clearAccessToken()
{
+ legacySettings.remove("access_token");
+ legacySettings.remove("device_id"); // Force the server to re-issue it
remove("access_token");
}
|