diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2017-10-19 19:36:10 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2017-10-19 19:40:47 +0900 |
commit | 76438ba95d16c7d007fc16ffc194889f937a19f7 (patch) | |
tree | e0c578596254532310b7f0d8f4a37236bfa0670b /settings.h | |
parent | 756e716886036447915a10992189774991f4dd8d (diff) | |
download | libquotient-76438ba95d16c7d007fc16ffc194889f937a19f7.tar.gz libquotient-76438ba95d16c7d007fc16ffc194889f937a19f7.zip |
Introduce device_id and initial_device_name support; switch to generated LoginJob
This is _almost_ a backwards-compatible change, except that connect*()
and other relevant methods in Connection are no more virtual (that
wasn't much useful anyway). Otherwise it's a matter of passing
initial_device_name to connectToServer(), saving device_id (along with
access_token) from the result of LoginJob and then passing device_id
(along with access_token, again) to connectWithToken() upon the next run.
Diffstat (limited to 'settings.h')
-rw-r--r-- | settings.h | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -36,7 +36,6 @@ namespace QMatrixClient #else
using QSettings::QSettings;
#endif
- virtual ~Settings();
Q_INVOKABLE void setValue(const QString &key,
const QVariant &value);
@@ -52,7 +51,6 @@ namespace QMatrixClient : Settings(qsettingsArgs...)
, groupPath(path)
{ }
- virtual ~SettingsGroup();
Q_INVOKABLE bool contains(const QString& key) const;
Q_INVOKABLE QVariant value(const QString &key,
@@ -72,6 +70,8 @@ namespace QMatrixClient {
Q_OBJECT
Q_PROPERTY(QString userId READ userId)
+ Q_PROPERTY(QString deviceId READ deviceId WRITE setDeviceId)
+ Q_PROPERTY(QString deviceName READ deviceName WRITE setDeviceName)
Q_PROPERTY(QUrl homeserver READ homeserver WRITE setHomeserver)
Q_PROPERTY(bool keepLoggedIn READ keepLoggedIn WRITE setKeepLoggedIn)
Q_PROPERTY(QString accessToken READ accessToken WRITE setAccessToken)
@@ -80,10 +80,15 @@ namespace QMatrixClient explicit AccountSettings(const QString& accountId, ArgTs... qsettingsArgs)
: SettingsGroup("Accounts/" + accountId, qsettingsArgs...)
{ }
- virtual ~AccountSettings();
QString userId() const;
+ QString deviceId() const;
+ void setDeviceId(const QString& deviceId);
+
+ QString deviceName() const;
+ void setDeviceName(const QString& deviceName);
+
QUrl homeserver() const;
void setHomeserver(const QUrl& url);
@@ -94,4 +99,4 @@ namespace QMatrixClient void setAccessToken(const QString& accessToken);
Q_INVOKABLE void clearAccessToken();
};
-}
+} // namespace QMatrixClient
|