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:
authorKlaas Freitag <freitag@owncloud.com>2015-10-19 12:50:26 +0300
committerMarkus Goetz <markus@woboq.com>2015-11-18 13:40:29 +0300
commit3d7fc711ca0900b0b763b8d45012048b344f8e72 (patch)
tree6e484e4861396abcc174bed917bd36003158f302 /src/gui/accountstate.h
parent46dbca1bf5234e0e65f426d641089e70c9e5bcc2 (diff)
AccountState: Avoid ConnectionCheck if ETag job was just done.
This patch lets a successful etag job check mark a timestamp. If next time a connection check is requested, it is checked if the last ETag happened within the last 30 seconds and if so the connection check can be checked. This way we avoid half of the PROPFINDs if all goes well.
Diffstat (limited to 'src/gui/accountstate.h')
-rw-r--r--src/gui/accountstate.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gui/accountstate.h b/src/gui/accountstate.h
index be1423950..54e0653cc 100644
--- a/src/gui/accountstate.h
+++ b/src/gui/accountstate.h
@@ -95,6 +95,14 @@ public:
*/
QString shortDisplayNameForSettings(int width = 0) const;
+ /** Mark the timestamp when the last successful ETag check happened for
+ * this account.
+ * The checkConnectivity() method uses the timestamp to save a call to
+ * the server to validate the connection if the last successful etag job
+ * is not so lang away.
+ */
+ void tagLastSuccessfullETagRequest();
+
private:
void setState(State state);
@@ -114,6 +122,7 @@ private:
QStringList _connectionErrors;
bool _waitingForNewCredentials;
CredentialFetchMode _credentialsFetchMode;
+ QElapsedTimer _timeSinceLastETagCheck;
QPointer<ConnectionValidator> _connectionValidator;
};