summaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authoraxis <qt-info@nokia.com>2010-02-16 09:00:23 (GMT)
committeraxis <qt-info@nokia.com>2010-02-16 09:00:23 (GMT)
commit9d174f13e48730ac06aa429e0f011a02b333025e (patch)
tree6075fa3c24880dd6fc548f03395a5809739f67de /demos
parent4790ab735f96a13027e7292ff5b49195224f0af9 (diff)
parente024cc10a97b9518b2dd577175feb66258d7ac05 (diff)
downloadQt-9d174f13e48730ac06aa429e0f011a02b333025e.zip
Qt-9d174f13e48730ac06aa429e0f011a02b333025e.tar.gz
Qt-9d174f13e48730ac06aa429e0f011a02b333025e.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt-s60-public into master-s60
Conflicts: qmake/generators/symbian/symmake.cpp tests/auto/qlineedit/tst_qlineedit.cpp tests/benchmarks/benchmarks.pro
Diffstat (limited to 'demos')
-rw-r--r--demos/browser/browser.pro2
-rw-r--r--demos/browser/networkaccessmanager.cpp3
-rw-r--r--demos/browser/webview.cpp14
3 files changed, 13 insertions, 6 deletions
diff --git a/demos/browser/browser.pro b/demos/browser/browser.pro
index a42aa60..f038c61 100644
--- a/demos/browser/browser.pro
+++ b/demos/browser/browser.pro
@@ -6,8 +6,6 @@ CONFIG += qt warn_on
contains(QT_BUILD_PARTS, tools):!embedded: CONFIG += uitools
else: DEFINES += QT_NO_UITOOLS
-release:DEFINES+=QT_NO_DEBUG_OUTPUT QT_NO_WARNING_OUTPUT
-
FORMS += \
addbookmarkdialog.ui \
bookmarks.ui \
diff --git a/demos/browser/networkaccessmanager.cpp b/demos/browser/networkaccessmanager.cpp
index b0b00a2..70a9305 100644
--- a/demos/browser/networkaccessmanager.cpp
+++ b/demos/browser/networkaccessmanager.cpp
@@ -112,8 +112,9 @@ void NetworkAccessManager::requestFinished(QNetworkReply *reply)
double pctCached = (double(requestFinishedFromCacheCount) * 100.0/ double(requestFinishedCount));
double pctPipelined = (double(requestFinishedPipelinedCount) * 100.0/ double(requestFinishedCount));
double pctSecure = (double(requestFinishedSecureCount) * 100.0/ double(requestFinishedCount));
+#ifdef QT_DEBUG
qDebug("STATS [%lli requests total] [%3.2f%% from cache] [%3.2f%% pipelined] [%3.2f%% SSL/TLS]", requestFinishedCount, pctCached, pctPipelined, pctSecure);
-
+#endif
}
void NetworkAccessManager::loadSettings()
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;