Avoid emitting finished() before user can connect the signal

QNetworkSession::open can synchronously emit an error, therefore
we need to queue this.
Otherwise QNetworkReply::finished is emitted before the user has
had a chance to connect the signals.

Task-number: QTBUG-18824
Change-Id: I703d5e31d2934afafabdf0a77ea3aaf5336e8dec
Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
This commit is contained in:
Shane Kearns 2012-05-04 13:55:45 +01:00 committed by Qt by Nokia
parent 4a1a13a81b
commit 9793dbcc4a

View File

@ -1569,7 +1569,7 @@ void QNetworkReplyHttpImplPrivate::_q_startOperation()
if (session) {
QObject::connect(session, SIGNAL(error(QNetworkSession::SessionError)),
q, SLOT(_q_networkSessionFailed()));
q, SLOT(_q_networkSessionFailed()), Qt::QueuedConnection);
if (!session->isOpen()) {
session->setSessionProperty(QStringLiteral("ConnectInBackground"), isBackground);