aboutsummaryrefslogtreecommitdiff
path: root/lib/connection.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/connection.cpp')
-rw-r--r--lib/connection.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/connection.cpp b/lib/connection.cpp
index 8107393d..2881f7f4 100644
--- a/lib/connection.cpp
+++ b/lib/connection.cpp
@@ -243,10 +243,12 @@ void Connection::Private::connectWithToken(const QString& user,
const QString& deviceId)
{
userId = user;
+ q->user(); // Creates a User object for the local user
data->setToken(accessToken.toLatin1());
data->setDeviceId(deviceId);
qCDebug(MAIN) << "Using server" << data->baseUrl().toDisplayString()
<< "by user" << userId << "from device" << deviceId;
+ emit q->stateChanged();
emit q->connected();
}
@@ -281,6 +283,8 @@ void Connection::logout()
auto job = callApi<LogoutJob>();
connect( job, &LogoutJob::success, this, [this] {
stopSync();
+ d->data->setToken({});
+ emit stateChanged();
emit loggedOut();
});
}