adjust API of retry count to have everything private and simpler
authorMatthieu Gallien <matthieu.gallien@nextcloud.com>
Fri, 29 Apr 2022 10:41:48 +0000 (12:41 +0200)
committerMatthieu Gallien <matthieu.gallien@nextcloud.com>
Fri, 29 Apr 2022 10:53:38 +0000 (12:53 +0200)
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
src/gui/accountstate.cpp
src/gui/accountstate.h

index a5bacfa2a75203488eeb79a46f0785714710c586..eacfec7181f9d725a382d2170a64bb78e5d7e99f 100644 (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){
index c9d9acbea15e4b60a4fc9e6afd341f659fb801bd..0a489c14975b66e61621fc98faeae232aa1f0001 100644 (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);