tst_qnetworkreply: linearise a succession of checks

Restructure an if { if/else} else chain so that it reads more logically.

Change-Id: I0d9a68451147d2b7e6a6d01cf7bee1a64b9902a7
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
bb10
Edward Welbourne 2016-08-24 14:53:43 +02:00
parent 32fbcf71ee
commit 06c7d67e13
1 changed files with 5 additions and 7 deletions

View File

@ -1422,14 +1422,12 @@ static QByteArray msgWaitForFinished(QNetworkReplyPtr &reply)
QString result;
QDebug debug(&result);
debug << reply->url();
if (reply->isFinished()) {
if (reply->error() == QNetworkReply::NoError)
debug << "finished.";
else
debug << "failed: #" << reply->error() << reply->errorString();
} else {
if (!reply->isFinished())
debug << "timed out.";
}
else if (reply->error() == QNetworkReply::NoError)
debug << "finished.";
else
debug << "failed: #" << reply->error() << reply->errorString();
return result.toLocal8Bit();
}