From ba620ee07989aff134fec6b5d6f058cab3377ecc Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Thu, 19 Oct 2017 19:36:10 +0900 Subject: 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. --- connectiondata.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'connectiondata.cpp') 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; -- cgit v1.2.3