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:
Matthieu Gallien 2022-04-29 12:41:48 +02:00
parent 6798f2ca31
commit 558c6cb1f6
No known key found for this signature in database
GPG key ID: 7D0F74F05C22F553
2 changed files with 9 additions and 10 deletions

View file

@ -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){

View file

@ -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);