Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHannah von Reth <hannah.vonreth@owncloud.com>2020-12-16 17:28:55 +0300
committerHannah von Reth <vonreth@kde.org>2021-01-13 12:13:33 +0300
commit1c103a42a9b02f95ec8f8420985a447b587cc5bd (patch)
tree045214e08d974c2a1cb54c38135fc25893270873 /src/gui/accountstate.cpp
parent6f4f259a1fc1777be8b23aa17bc668c2c5bc220f (diff)
Ensure we don't call block multiple times in the same context
Diffstat (limited to 'src/gui/accountstate.cpp')
-rw-r--r--src/gui/accountstate.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/gui/accountstate.cpp b/src/gui/accountstate.cpp
index 9e8ead69a..680fa8655 100644
--- a/src/gui/accountstate.cpp
+++ b/src/gui/accountstate.cpp
@@ -67,6 +67,7 @@ void AccountState::updateUrlDialog(AccountPtr account, const QUrl &newUrl, std::
AccountState::AccountState(AccountPtr account)
: QObject()
, _account(account)
+ , _queueGuard(_account->jobQueue())
, _state(AccountState::Disconnected)
, _connectionStatus(ConnectionValidator::Undefined)
, _waitingForNewCredentials(false)
@@ -134,7 +135,7 @@ void AccountState::setState(State state)
if (_state == SignedOut) {
_connectionStatus = ConnectionValidator::Undefined;
_connectionErrors.clear();
- _account->jobQueue()->clear();
+ _queueGuard.clear();
} else if (oldState == SignedOut && _state == Disconnected) {
// If we stop being voluntarily signed-out, try to connect and
// auth right now!
@@ -148,13 +149,12 @@ void AccountState::setState(State state)
}
if (oldState == Connected || _state == Connected) {
emit isConnectedChanged();
- _account->jobQueue()->setBlocked(false);
}
}
// might not have changed but the underlying _connectionErrors might have
if (_state == Connected) {
- _account->jobQueue()->setBlocked(false);
+ _queueGuard.unblock();
}
// don't anounce a state change from connected to connected
// https://github.com/owncloud/client/commit/2c6c21d7532f0cbba4b768fde47810f6673ed931
@@ -253,9 +253,8 @@ void AccountState::checkConnectivity(bool verifyServerState)
return;
}
-
if (verifyServerState) {
- _account->jobQueue()->setBlocked(true);
+ _queueGuard.block();
}
ConnectionValidator *conValidator = new ConnectionValidator(account());
_connectionValidator = conValidator;