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 /connectiondata.cpp | |
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 'connectiondata.cpp')
-rw-r--r-- | connectiondata.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/connectiondata.cpp b/connectiondata.cpp index 6f15577e..9b9b6e04 100644 --- a/connectiondata.cpp +++ b/connectiondata.cpp @@ -35,6 +35,7 @@ struct ConnectionData::Private QUrl baseUrl; QString accessToken; QString lastEvent; + QString deviceId; mutable unsigned int txnCounter = 0; const qint64 id = QDateTime::currentMSecsSinceEpoch(); @@ -83,6 +84,17 @@ void ConnectionData::setPort(int port) qCDebug(MAIN) << "updated baseUrl to" << d->baseUrl; } +const QString& ConnectionData::deviceId() const +{ + return d->deviceId; +} + +void ConnectionData::setDeviceId(const QString& deviceId) +{ + d->deviceId = deviceId; + qCDebug(MAIN) << "updated deviceId to" << d->deviceId; +} + QString ConnectionData::lastEvent() const { return d->lastEvent; |