From 39d44789d0f378b29d2c15994e8fa630edcdb408 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Wed, 27 Feb 2019 11:21:08 +0900 Subject: BaseJob::abandon() fixes 1. It should work with non-started jobs now (Closes #289). 2. It should allow clients to still handle `finished()` instead of cutting them off right before emitting the signal. --- lib/jobs/basejob.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/jobs/basejob.cpp b/lib/jobs/basejob.cpp index 628d10ec..8c3381ae 100644 --- a/lib/jobs/basejob.cpp +++ b/lib/jobs/basejob.cpp @@ -603,7 +603,7 @@ void BaseJob::setStatus(Status s) if (d->status == s) return; - if (!d->connection->accessToken().isEmpty()) + if (d->connection && !d->connection->accessToken().isEmpty()) s.message.replace(d->connection->accessToken(), "(REDACTED)"); if (!s.good()) qCWarning(d->logCat) << this << "status" << s; @@ -618,9 +618,8 @@ void BaseJob::setStatus(int code, QString message) void BaseJob::abandon() { - beforeAbandon(d->reply.data()); + beforeAbandon(d->reply ? d->reply.data() : nullptr); setStatus(Abandoned); - this->disconnect(); if (d->reply) d->reply->disconnect(this); emit finished(this); -- cgit v1.2.3