From 7b438f3e9c7d56658254412e85ae0cd20ba1e6e6 Mon Sep 17 00:00:00 2001 From: Hannah von Reth Date: Fri, 4 Aug 2023 16:19:48 +0200 Subject: [PATCH] fix --- src/gui/accountstate.cpp | 12 +++++++----- test/testoauth.cpp | 2 +- test/testutils/syncenginetestutils.h | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/gui/accountstate.cpp b/src/gui/accountstate.cpp index a7e4dfb8720..9b710344856 100644 --- a/src/gui/accountstate.cpp +++ b/src/gui/accountstate.cpp @@ -292,13 +292,13 @@ void AccountState::tagLastSuccessfullETagRequest(const QDateTime &tp) void AccountState::checkConnectivity(bool blockJobs) { - if (_state != Connected) { - setState(Connecting); - } - qCWarning(lcAccountState) << "checkConnectivity blocking:" << blockJobs; if (isSignedOut()) { return; } + qCWarning(lcAccountState) << "checkConnectivity blocking:" << blockJobs; + if (_state != Connected) { + setState(Connecting); + } if (_tlsDialog) { qCDebug(lcAccountState) << "Skip checkConnectivity, waiting for tls dialog"; return; @@ -512,7 +512,9 @@ void AccountState::slotCredentialsFetched() qCInfo(lcAccountState) << "Fetched credentials for" << _account->url().toString() << "attempting to connect"; _waitingForNewCredentials = false; - checkConnectivity(); + if (!isSignedOut()) { + checkConnectivity(); + } } void AccountState::slotCredentialsAsked() diff --git a/test/testoauth.cpp b/test/testoauth.cpp index 82a4cdfb633..9cd590a9169 100644 --- a/test/testoauth.cpp +++ b/test/testoauth.cpp @@ -127,7 +127,7 @@ class OAuthTestCase : public QObject account->setUrl(sOAuthTestServer); // the account seizes ownership over the qnam in account->setCredentials(...) by keeping a shared pointer on it // therefore, we should never call fakeAm->setThis(...) - account->setCredentials(new FakeCredentials {account.get(), fakeAm }); + account->setCredentials(new FakeCredentials{account.get(), fakeAm}); fakeAm->setOverride([this](QNetworkAccessManager::Operation op, const QNetworkRequest &req, QIODevice *device) { if (req.url().path().endsWith(QLatin1String(".well-known/openid-configuration"))) { return this->wellKnownReply(op, req); diff --git a/test/testutils/syncenginetestutils.h b/test/testutils/syncenginetestutils.h index a71466d7e47..cbb65f98f9d 100644 --- a/test/testutils/syncenginetestutils.h +++ b/test/testutils/syncenginetestutils.h @@ -543,7 +543,7 @@ class FakeCredentials : public OCC::AbstractCredentials public: FakeCredentials(OCC::Account *account, OCC::AccessManager *am) : OCC::AbstractCredentials(account) - ,_am { am } + , _am{am} { }