aboutsummaryrefslogtreecommitdiff
path: root/jobs
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2018-03-23 10:43:39 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2018-03-23 10:47:59 +0900
commitbac178f488299ec37ebe86aa91053cf1133d1c12 (patch)
treea47b2e7d69609a7db5385c6935f291a57f1e9b73 /jobs
parent791d6b2a86e81cdaf610913140ca94989ca1e41d (diff)
downloadlibquotient-bac178f488299ec37ebe86aa91053cf1133d1c12.tar.gz
libquotient-bac178f488299ec37ebe86aa91053cf1133d1c12.zip
BaseJob::start(): self-destruct if not succesfully started
Closes #193.
Diffstat (limited to 'jobs')
-rw-r--r--jobs/basejob.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/jobs/basejob.cpp b/jobs/basejob.cpp
index 981b75b1..eb250723 100644
--- a/jobs/basejob.cpp
+++ b/jobs/basejob.cpp
@@ -235,8 +235,12 @@ void BaseJob::start(const ConnectionData* connData)
{
d->connection = connData;
beforeStart(connData);
- sendRequest();
- afterStart(connData, d->reply.data());
+ if (status().good())
+ sendRequest();
+ if (status().good())
+ afterStart(connData, d->reply.data());
+ if (!status().good())
+ QTimer::singleShot(0, this, &BaseJob::finishJob);
}
void BaseJob::sendRequest()