summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorkh1 <qt-info@nokia.com>2010-04-26 10:47:50 (GMT)
committerkh1 <qt-info@nokia.com>2010-04-26 10:49:41 (GMT)
commit2ee996bb3e8449e9c9d153326a2f55bc07b6b864 (patch)
tree0be1f93384b52af9040095f120d1870e42654a83 /tools
parentc7ca3da5ec1586083dfc4425200508929756ad61 (diff)
downloadQt-2ee996bb3e8449e9c9d153326a2f55bc07b6b864.zip
Qt-2ee996bb3e8449e9c9d153326a2f55bc07b6b864.tar.gz
Qt-2ee996bb3e8449e9c9d153326a2f55bc07b6b864.tar.bz2
Improved workaround for new qt documentation, base on dboddie's work.
Make the check more generic, to also work for all other Qt namespaces than qt.ver.s.ion. Still there's something broken in Qt webkit or so. Backported from Qt Creator code. Reviewed-by: ck
Diffstat (limited to 'tools')
-rw-r--r--tools/assistant/tools/assistant/helpviewer.cpp10
-rw-r--r--tools/assistant/tools/assistant/helpviewer.h8
-rw-r--r--tools/assistant/tools/assistant/helpviewer_qwv.cpp7
3 files changed, 12 insertions, 13 deletions
diff --git a/tools/assistant/tools/assistant/helpviewer.cpp b/tools/assistant/tools/assistant/helpviewer.cpp
index 22b3f30..6499139 100644
--- a/tools/assistant/tools/assistant/helpviewer.cpp
+++ b/tools/assistant/tools/assistant/helpviewer.cpp
@@ -52,17 +52,15 @@
QT_BEGIN_NAMESPACE
-QString AbstractHelpViewer::DocPath = QString::fromLatin1("qthelp://com."
- "trolltech.qt.%1/").arg(QString(QLatin1String(QT_VERSION_STR))
- .replace(QLatin1String("."), QLatin1String("")));
+const QLatin1String AbstractHelpViewer::DocPath("qthelp://com.trolltech.");
-QString AbstractHelpViewer::AboutBlank =
+const QString AbstractHelpViewer::AboutBlank =
QCoreApplication::translate("HelpViewer", "<title>about:blank</title>");
-QString AbstractHelpViewer::LocalHelpFile = QLatin1String("qthelp://"
+const QString AbstractHelpViewer::LocalHelpFile = QLatin1String("qthelp://"
"com.trolltech.com.assistantinternal-1.0.0/assistant/assistant.html");
-QString AbstractHelpViewer::PageNotFoundMessage =
+const QString AbstractHelpViewer::PageNotFoundMessage =
QCoreApplication::translate("HelpViewer", "<title>Error 404...</title><div "
"align=\"center\"><br><br><h1>The page could not be found</h1><br><h3>'%1'"
"</h3></div>");
diff --git a/tools/assistant/tools/assistant/helpviewer.h b/tools/assistant/tools/assistant/helpviewer.h
index 80a6f87..def9418 100644
--- a/tools/assistant/tools/assistant/helpviewer.h
+++ b/tools/assistant/tools/assistant/helpviewer.h
@@ -67,10 +67,10 @@ public:
virtual bool handleForwardBackwardMouseButtons(QMouseEvent *e) = 0;
- static QString DocPath;
- static QString AboutBlank;
- static QString LocalHelpFile;
- static QString PageNotFoundMessage;
+ static const QLatin1String DocPath;
+ static const QString AboutBlank;
+ static const QString LocalHelpFile;
+ static const QString PageNotFoundMessage;
static bool isLocalUrl(const QUrl &url);
static bool canOpenPage(const QString &url);
diff --git a/tools/assistant/tools/assistant/helpviewer_qwv.cpp b/tools/assistant/tools/assistant/helpviewer_qwv.cpp
index a19b29a..adaa45b 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();
}
}
}