diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-02-09 22:40:42 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-02-09 22:40:42 (GMT) |
commit | bd145e708d97ffb5a68bf53bbdf04b8df8ea4a9b (patch) | |
tree | 57fea5e3724c841344924d74d451a26ded978e71 /demos/browser/webview.cpp | |
parent | ecf66e5825d186f57468c6bf682dce32c0cd96d7 (diff) | |
parent | 6f329da7066de32455ad8ad08a4b617a4a090dd3 (diff) | |
download | Qt-bd145e708d97ffb5a68bf53bbdf04b8df8ea4a9b.zip Qt-bd145e708d97ffb5a68bf53bbdf04b8df8ea4a9b.tar.gz Qt-bd145e708d97ffb5a68bf53bbdf04b8df8ea4a9b.tar.bz2 |
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1:
Tidy the changes file.
Skip the transparent pixels when doing the sourceOver
Refactor comp_func_solid_Clear() and comp_func_solid_Source()
Add mingw-specific expected failures for JS test suite
QNAM HTTP: Forgot to remove a qDebug()
QNAM HTTP: Reserve bytes for HTTP parsing
Add platform-specific expected failures for JS test suite
Skip test that crashes on win32-g++
QNetworkCookie(Jar): fix includes
QNAM HTTP: Improve readHeader() of the HTTP reply
Add QSKIP to functionEntryAndExit_builtin.
QNAM HTTP: Improve parseStatus() of HTTP reply
Demo browser: Better handleUnsupportedContent implementation
demo browser: Fix the way warnings were (not) displayed
doc: Updated deployment OS X requirements for 4.6
Diffstat (limited to 'demos/browser/webview.cpp')
-rw-r--r-- | demos/browser/webview.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/demos/browser/webview.cpp b/demos/browser/webview.cpp index 1a7e38a..2f9b3e6 100644 --- a/demos/browser/webview.cpp +++ b/demos/browser/webview.cpp @@ -143,11 +143,19 @@ QObject *WebPage::createPlugin(const QString &classId, const QUrl &url, const QS void WebPage::handleUnsupportedContent(QNetworkReply *reply) { - if (reply->error() == QNetworkReply::NoError) { - BrowserApplication::downloadManager()->handleUnsupportedContent(reply); + QString errorString = reply->errorString(); + + if (m_loadingUrl != reply->url()) { + // sub resource of this page + qWarning() << "Resource" << reply->url().toEncoded() << "has unknown Content-Type, will be ignored."; + reply->deleteLater(); return; } + if (reply->error() == QNetworkReply::NoError && !reply->header(QNetworkRequest::ContentTypeHeader).isValid()) { + errorString = "Unknown Content-Type"; + } + QFile file(QLatin1String(":/notfound.html")); bool isOpened = file.open(QIODevice::ReadOnly); Q_ASSERT(isOpened); @@ -156,7 +164,7 @@ void WebPage::handleUnsupportedContent(QNetworkReply *reply) QString title = tr("Error loading page: %1").arg(reply->url().toString()); QString html = QString(QLatin1String(file.readAll())) .arg(title) - .arg(reply->errorString()) + .arg(errorString) .arg(reply->url().toString()); QBuffer imageBuffer; |