From 0e3200866d90c579a8951e4ef843c6fe54c2c7bd Mon Sep 17 00:00:00 2001 From: David Boddie Date: Fri, 23 Apr 2010 14:12:08 +0200 Subject: Ensure that all qthelp URLs have paths that start with /qdoc/. Reviewed-by: kh --- tools/assistant/tools/assistant/helpviewer.cpp | 4 +--- tools/assistant/tools/assistant/helpviewer_qwv.cpp | 7 ++++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/tools/assistant/tools/assistant/helpviewer.cpp b/tools/assistant/tools/assistant/helpviewer.cpp index 22b3f30..25214e2 100644 --- a/tools/assistant/tools/assistant/helpviewer.cpp +++ b/tools/assistant/tools/assistant/helpviewer.cpp @@ -52,9 +52,7 @@ QT_BEGIN_NAMESPACE -QString AbstractHelpViewer::DocPath = QString::fromLatin1("qthelp://com." - "trolltech.qt.%1/").arg(QString(QLatin1String(QT_VERSION_STR)) - .replace(QLatin1String("."), QLatin1String(""))); +QString AbstractHelpViewer::DocPath = QString::fromLatin1("qthelp://com.trolltech."); QString AbstractHelpViewer::AboutBlank = QCoreApplication::translate("HelpViewer", "about:blank"); diff --git a/tools/assistant/tools/assistant/helpviewer_qwv.cpp b/tools/assistant/tools/assistant/helpviewer_qwv.cpp index a19b29a..585c69d 100644 --- a/tools/assistant/tools/assistant/helpviewer_qwv.cpp +++ b/tools/assistant/tools/assistant/helpviewer_qwv.cpp @@ -139,9 +139,10 @@ QNetworkReply *HelpNetworkAccessManager::createRequest(Operation /*op*/, // the virtual folder if (!helpEngine.findFile(url).isValid()) { if (url.startsWith(AbstractHelpViewer::DocPath)) { - if (!url.startsWith(AbstractHelpViewer::DocPath + QLatin1String("qdoc/"))) { - url = url.replace(AbstractHelpViewer::DocPath, - AbstractHelpViewer::DocPath + QLatin1String("qdoc/")); + QUrl newUrl = request.url(); + if (!newUrl.path().startsWith(QLatin1String("/qdoc/"))) { + newUrl.setPath(QLatin1String("/qdoc/")+newUrl.path()); + url = newUrl.toString(); } } } -- cgit v0.12