aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael BrĂ¼ning <michael.bruning@digia.com>2012-11-08 12:17:39 +0100
committerEike Ziller <eike.ziller@digia.com>2012-12-10 15:16:10 +0100
commit3271af9292060d60af32d8364287dabd73e02a35 (patch)
tree2376f41cc4ca1391538cf8e82c74608dee642b72 /src
parent96b70ac611e96c9eafc8b8eea136ef174c7297ce (diff)
Correct the setup of HelpNetworkReply.
Resources addressed as urls in offline css files were not loaded (e.g. breadcrumb icons) due to the base url not being setup and therefore defaulting to the main page, when it should have been set to the url of the corresponding style sheet to make relative urls work correctly. This also eliminates the need for the workaround introduced earlier. Task-number: QTCREATORBUG-8211 Change-Id: Icf365781544255e322259262ea6a19a0b1dc7a25 modified: src/plugins/help/helpviewer_qwv.cpp Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com> (cherry picked from commit b5bfb81508a75f48caa64d4d6ba91d2298035e82) Reviewed-by: Michael Bruning <michael.bruning@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/help/helpviewer_qwv.cpp19
1 files changed, 1 insertions, 18 deletions
diff --git a/src/plugins/help/helpviewer_qwv.cpp b/src/plugins/help/helpviewer_qwv.cpp
index a19ac2e52e..bf986a4922 100644
--- a/src/plugins/help/helpviewer_qwv.cpp
+++ b/src/plugins/help/helpviewer_qwv.cpp
@@ -131,6 +131,7 @@ HelpNetworkReply::HelpNetworkReply(const QNetworkRequest &request,
, dataLength(fileData.length())
{
setRequest(request);
+ setUrl(request.url());
setOpenMode(QIODevice::ReadOnly);
setHeader(QNetworkRequest::ContentTypeHeader, mimeType);
@@ -175,24 +176,6 @@ QNetworkReply *HelpNetworkAccessManager::createRequest(Operation op,
QString url = request.url().toString();
const QHelpEngineCore &engine = LocalHelpManager::helpEngine();
- // TODO: For some reason the url to load is already wrong (passed from webkit)
- // though the css file and the references inside should work that way. One
- // possible problem might be that the css is loaded at the same level as the
- // html, thus a path inside the css like (../images/foo.png) might cd out of
- // the virtual folder
- if (!engine.findFile(url).isValid()) {
- if (url.startsWith(HelpViewer::NsNokia) || url.startsWith(HelpViewer::NsTrolltech)) {
- QUrl newUrl = request.url();
- if (!newUrl.path().startsWith(QLatin1String("/qdoc/")) ||
- !newUrl.path().startsWith(QLatin1String("/doc/"))) {
- QString path = newUrl.path();
- newUrl.setPath(QLatin1String("/qdoc/") + path);
- if (!engine.findFile(newUrl).isValid())
- newUrl.setPath(QLatin1String("/doc/") + path);
- url = newUrl.toString();
- }
- }
- }
const QString &mimeType = HelpViewer::mimeFromUrl(url);
const QByteArray &data = engine.findFile(url).isValid() ? engine.fileData(url)