mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-22 13:05:51 +03:00
adjust API of retry count to have everything private and simpler
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
This commit is contained in:
parent
6798f2ca31
commit
558c6cb1f6
2 changed files with 9 additions and 10 deletions
|
@ -131,7 +131,7 @@ void AccountState::setState(State state)
|
|||
emit isConnectedChanged();
|
||||
}
|
||||
if (_state == Connected) {
|
||||
setRetryCount(0);
|
||||
resetRetryCount();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -330,9 +330,9 @@ void AccountState::slotConnectionValidatorResult(ConnectionValidator::Status sta
|
|||
_lastCheckConnectionTimer.start();
|
||||
};
|
||||
|
||||
const auto resetRetryCount = [this]() {
|
||||
const auto resetRetryConnection = [this]() {
|
||||
qCInfo(lcAccountState) << "reset retry count";
|
||||
setRetryCount(0);
|
||||
resetRetryCount();
|
||||
_lastCheckConnectionTimer.invalidate();
|
||||
_lastCheckConnectionTimer.start();
|
||||
};
|
||||
|
@ -373,7 +373,7 @@ void AccountState::slotConnectionValidatorResult(ConnectionValidator::Status sta
|
|||
case ConnectionValidator::Connected:
|
||||
if (_state != Connected) {
|
||||
setState(Connected);
|
||||
resetRetryCount();
|
||||
resetRetryConnection();
|
||||
|
||||
// Get the Apps available on the server.
|
||||
fetchNavigationApps();
|
||||
|
@ -504,9 +504,9 @@ void AccountState::fetchNavigationApps(){
|
|||
job->getNavigationApps();
|
||||
}
|
||||
|
||||
void AccountState::setRetryCount(int count)
|
||||
void AccountState::resetRetryCount()
|
||||
{
|
||||
_retryCount = count;
|
||||
_retryCount = 0;
|
||||
}
|
||||
|
||||
void AccountState::slotEtagResponseHeaderReceived(const QByteArray &value, int statusCode){
|
||||
|
|
|
@ -106,9 +106,6 @@ public:
|
|||
State state() const;
|
||||
static QString stateString(State state);
|
||||
|
||||
int retryCount() const;
|
||||
void increaseRetryCount();
|
||||
|
||||
bool isSignedOut() const;
|
||||
|
||||
AccountAppList appList() const;
|
||||
|
@ -191,7 +188,9 @@ private:
|
|||
void setState(State state);
|
||||
void fetchNavigationApps();
|
||||
|
||||
void setRetryCount(int count);
|
||||
int retryCount() const;
|
||||
void increaseRetryCount();
|
||||
void resetRetryCount();
|
||||
|
||||
signals:
|
||||
void stateChanged(State state);
|
||||
|
|
Loading…
Reference in a new issue