aboutsummaryrefslogtreecommitdiff
path: root/settings.h
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2017-10-19 19:36:10 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2017-10-19 19:40:47 +0900
commit76438ba95d16c7d007fc16ffc194889f937a19f7 (patch)
treee0c578596254532310b7f0d8f4a37236bfa0670b /settings.h
parent756e716886036447915a10992189774991f4dd8d (diff)
downloadlibquotient-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.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/settings.h b/settings.h
index eab0679a..a6c0420e 100644
--- a/settings.h
+++ b/settings.h
@@ -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