aboutsummaryrefslogtreecommitdiff
path: root/jobs/basejob.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'jobs/basejob.cpp')
-rw-r--r--jobs/basejob.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/jobs/basejob.cpp b/jobs/basejob.cpp
index e24db012..bcfd5875 100644
--- a/jobs/basejob.cpp
+++ b/jobs/basejob.cpp
@@ -54,7 +54,11 @@ BaseJob::BaseJob(ConnectionData* connection, JobHttpType type, bool needsToken)
BaseJob::~BaseJob()
{
if( d->reply )
+ {
+ if( d->reply->isRunning() )
+ d->reply->abort();
d->reply->deleteLater();
+ }
delete d;
}
@@ -115,6 +119,8 @@ void BaseJob::fail(int errorCode, QString errorString)
{
setError( errorCode );
setErrorText( errorString );
+ if( d->reply->isRunning() )
+ d->reply->abort();
emitResult();
}
@@ -149,8 +155,7 @@ void BaseJob::gotReply()
void BaseJob::timeout()
{
qDebug() << "Timeout!";
- if( d->reply->isRunning() )
- d->reply->abort();
+ fail( TimeoutError, "The job has timed out" );
}
void BaseJob::sslErrors(const QList<QSslError>& errors)