diff options
author | kh1 <qt-info@nokia.com> | 2010-01-19 14:27:13 (GMT) |
---|---|---|
committer | kh1 <qt-info@nokia.com> | 2010-01-19 14:35:07 (GMT) |
commit | beab6d886504c011af9b973d1d0a81ce8e700e30 (patch) | |
tree | 3c134d8a0e6aed77f2a2fa529251e03e2d7ac1ea | |
parent | 7d8c3cb2e531ce6df8d14096b0b3d31f517e767a (diff) | |
download | Qt-beab6d886504c011af9b973d1d0a81ce8e700e30.zip Qt-beab6d886504c011af9b973d1d0a81ce8e700e30.tar.gz Qt-beab6d886504c011af9b973d1d0a81ce8e700e30.tar.bz2 |
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
-rw-r--r-- | tools/assistant/tools/assistant/helpviewer.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
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 |