From: Matthieu Gallien Date: Fri, 29 Apr 2022 10:41:48 +0000 (+0200) Subject: adjust API of retry count to have everything private and simpler X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~17^2~47^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=558c6cb1f6720b2d57c04205745b8606f61ea04b;p=nextcloud-desktop.git adjust API of retry count to have everything private and simpler Signed-off-by: Matthieu Gallien --- diff --git a/src/gui/accountstate.cpp b/src/gui/accountstate.cpp index a5bacfa2a..eacfec718 100644 --- a/src/gui/accountstate.cpp +++ b/src/gui/accountstate.cpp @@ -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){ diff --git a/src/gui/accountstate.h b/src/gui/accountstate.h index c9d9acbea..0a489c149 100644 --- a/src/gui/accountstate.h +++ b/src/gui/accountstate.h @@ -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);