diff options
author | Aaron McCarthy <aaron.mccarthy@nokia.com> | 2010-02-10 22:52:32 (GMT) |
---|---|---|
committer | Aaron McCarthy <aaron.mccarthy@nokia.com> | 2010-02-10 22:53:49 (GMT) |
commit | 5f885bc5a294cd831f79b5570cb41f3cae2b8b19 (patch) | |
tree | 60240311725d449f33350f0f1012adcb54f45333 /src/network/access/qnetworkreplyimpl.cpp | |
parent | d792ec16f29a7cb34bada871127f701ba9480100 (diff) | |
download | Qt-5f885bc5a294cd831f79b5570cb41f3cae2b8b19.zip Qt-5f885bc5a294cd831f79b5570cb41f3cae2b8b19.tar.gz Qt-5f885bc5a294cd831f79b5570cb41f3cae2b8b19.tar.bz2 |
Fix networkAccessEnabled implementation.
Move QDisabledNetworkReply to more appropriate source files.
Return -1 from QDisabledNetworkReply::readData().
Always allow local access (via QNetworkAccessFileBackend).
Diffstat (limited to 'src/network/access/qnetworkreplyimpl.cpp')
-rw-r--r-- | src/network/access/qnetworkreplyimpl.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/network/access/qnetworkreplyimpl.cpp b/src/network/access/qnetworkreplyimpl.cpp index 9721e32..3cf21f0 100644 --- a/src/network/access/qnetworkreplyimpl.cpp +++ b/src/network/access/qnetworkreplyimpl.cpp @@ -856,6 +856,30 @@ bool QNetworkReplyImplPrivate::migrateBackend() return true; } +QDisabledNetworkReply::QDisabledNetworkReply(QObject *parent, + const QNetworkRequest &req, + QNetworkAccessManager::Operation op) +: QNetworkReply(parent) +{ + setRequest(req); + setUrl(req.url()); + setOperation(op); + + qRegisterMetaType<QNetworkReply::NetworkError>("QNetworkReply::NetworkError"); + + QString msg = QCoreApplication::translate("QNetworkAccessManager", + "Network access is disabled."); + setError(UnknownNetworkError, msg); + + QMetaObject::invokeMethod(this, "error", Qt::QueuedConnection, + Q_ARG(QNetworkReply::NetworkError, UnknownNetworkError)); + QMetaObject::invokeMethod(this, "finished", Qt::QueuedConnection); +} + +QDisabledNetworkReply::~QDisabledNetworkReply() +{ +} + QT_END_NAMESPACE #include "moc_qnetworkreplyimpl_p.cpp" |