summaryrefslogtreecommitdiffstats
path: root/core/checkcloudconnection.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2016-07-23 12:54:30 +0900
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-07-23 12:54:30 +0900
commit177e21076b9813eefca7939cda8c3eb559a4d145 (patch)
tree7f2a56656967dda0d8f71e3db9534c980b6285ef /core/checkcloudconnection.cpp
parent9815eaf1ed039d7831c1de64c4f083ebcc90abe7 (diff)
downloadsubsurface-177e21076b9813eefca7939cda8c3eb559a4d145.tar.gz
Allow the user to give longer cloud timeout on the command line
When stuck in areas with really bad internet 5 seconds may not be enough, but making the timeout longer in general seems the wrong way to go. So keep the default 5 seconds but allow the user to override that with subsurface --cloud-timeout=NN Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/checkcloudconnection.cpp')
-rw-r--r--core/checkcloudconnection.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/checkcloudconnection.cpp b/core/checkcloudconnection.cpp
index b0addc0ac..a0117d4f6 100644
--- a/core/checkcloudconnection.cpp
+++ b/core/checkcloudconnection.cpp
@@ -39,8 +39,8 @@ bool CheckCloudConnection::checkServer()
connect(&timer, &QTimer::timeout, &loop, &QEventLoop::quit);
connect(reply, &QNetworkReply::finished, &loop, &QEventLoop::quit);
connect(reply, &QNetworkReply::sslErrors, this, &CheckCloudConnection::sslErrors);
- for (int seconds = 1; seconds <= 5; seconds++) {
- timer.start(1000); // wait five seconds
+ for (int seconds = 1; seconds <= prefs.cloud_timeout; seconds++) {
+ timer.start(1000); // wait the given number of seconds (default 5)
loop.exec();
if (timer.isActive()) {
// didn't time out, did we get the right response?
@@ -54,7 +54,7 @@ bool CheckCloudConnection::checkServer()
git_storage_update_progress(false, "successfully checked cloud connection");
return true;
}
- } else if (seconds < 5) {
+ } else if (seconds < prefs.cloud_timeout) {
QString text = QString("waited %1 sec for cloud connetion").arg(seconds);
git_storage_update_progress(false, qPrintable(text));
} else {