aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2017-09-20 14:05:16 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2017-09-20 14:05:16 +0900
commitb01591bddbcc4bcf3957feeb6b4b2875a9a2d978 (patch)
tree13375893b653c1cfba9bc0cf98bc5f0fa3da9330
parent7e8c2ee1d00e43aab90030493c31aef0b4467f71 (diff)
downloadlibquotient-b01591bddbcc4bcf3957feeb6b4b2875a9a2d978.tar.gz
libquotient-b01591bddbcc4bcf3957feeb6b4b2875a9a2d978.zip
BaseJob: track the outcome of sendRequest() in the logs
Also: no reason to start the job timer if the request is not running, so don't even bother.
-rw-r--r--jobs/basejob.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/jobs/basejob.cpp b/jobs/basejob.cpp
index 3057ed75..6b2ebc58 100644
--- a/jobs/basejob.cpp
+++ b/jobs/basejob.cpp
@@ -164,8 +164,14 @@ void BaseJob::start()
d->sendRequest();
connect( d->reply.data(), &QNetworkReply::sslErrors, this, &BaseJob::sslErrors );
connect( d->reply.data(), &QNetworkReply::finished, this, &BaseJob::gotReply );
- d->timer.start(getCurrentTimeout());
- emit started();
+ if (d->reply->isRunning())
+ {
+ d->timer.start(getCurrentTimeout());
+ qCDebug(d->logCat) << this << "request has been sent";
+ emit started();
+ }
+ else
+ qCWarning(d->logCat) << this << "request could not start";
}
void BaseJob::gotReply()