From beab6d886504c011af9b973d1d0a81ce8e700e30 Mon Sep 17 00:00:00 2001 From: kh1 Date: Tue, 19 Jan 2010 15:27:13 +0100 Subject: Return some fake data if we can't handle the network request. Since we are the only handler for network request and cannot forward the request to our parent (e.g. unwanted net access), we work arround the case we can't handle it. We do create a reply with dummy data which will prevent some blocking and allows further processing of requested data. Task-number: QTBUG-7427 Reviewed-by: kh --- tools/assistant/tools/assistant/helpviewer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/assistant/tools/assistant/helpviewer.cpp b/tools/assistant/tools/assistant/helpviewer.cpp index a9abda5..1900c7e 100644 --- a/tools/assistant/tools/assistant/helpviewer.cpp +++ b/tools/assistant/tools/assistant/helpviewer.cpp @@ -151,7 +151,8 @@ QNetworkReply *HelpNetworkAccessManager::createRequest(Operation /*op*/, mimeType = QLatin1String("text/html"); } - return new HelpNetworkReply(request, helpEngine->fileData(url), mimeType); + const QByteArray &ba = helpEngine->fileData(url); + return new HelpNetworkReply(request, ba.isEmpty() ? " " : ba, mimeType); } class HelpPage : public QWebPage -- cgit v0.12