Remove unneeded check in QNetworkReplyImpl::abort.

QNetworkReplyImpl::abort immediately returns at the beginning of the function
when the state is already finished, and the state does not get changed by the
code in between - so this condition will always be true.

Change-Id: Ia98df7cbecf471c7236b5e17caddd1301b647d2b
Reviewed-by: Peter Hartmann <peter-qt@hartmann.tk>
bb10
Florian Bruhin 2015-03-04 07:38:24 +01:00 committed by Florian Bruhin
parent 983bdc0713
commit c4c895d2dd
1 changed files with 5 additions and 7 deletions

View File

@ -923,13 +923,11 @@ void QNetworkReplyImpl::abort()
QNetworkReply::close();
if (d->state != QNetworkReplyPrivate::Finished) {
// call finished which will emit signals
d->error(OperationCanceledError, tr("Operation canceled"));
if (d->state == QNetworkReplyPrivate::WaitingForSession)
d->state = QNetworkReplyPrivate::Working;
d->finished();
}
// call finished which will emit signals
d->error(OperationCanceledError, tr("Operation canceled"));
if (d->state == QNetworkReplyPrivate::WaitingForSession)
d->state = QNetworkReplyPrivate::Working;
d->finished();
d->state = QNetworkReplyPrivate::Aborted;
// finished may access the backend