Skip to content
Snippets Groups Projects
Commit d086f760 authored by kh1's avatar kh1
Browse files

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.

Reviewed-by: ck
parent f996b246
No related branches found
No related tags found
No related merge requests found
...@@ -44,14 +44,12 @@ ...@@ -44,14 +44,12 @@
using namespace Help::Internal; using namespace Help::Internal;
QString HelpViewer::DocPath = QString::fromLatin1("qthelp://com." const QString HelpViewer::DocPath = QLatin1String("qthelp://com.trolltech.");
"trolltech.qt.%1/").arg(QString(QLatin1String(QT_VERSION_STR))
.replace(QLatin1String("."), QLatin1String("")));
QString HelpViewer::AboutBlankPage = const QString HelpViewer::AboutBlankPage =
QCoreApplication::translate("HelpViewer", "<title>about:blank</title>"); QCoreApplication::translate("HelpViewer", "<title>about:blank</title>");
QString HelpViewer::PageNotFoundMessage = const QString HelpViewer::PageNotFoundMessage =
QCoreApplication::translate("HelpViewer", "<title>Error 404...</title><div " QCoreApplication::translate("HelpViewer", "<title>Error 404...</title><div "
"align=\"center\"><br><br><h1>The page could not be found</h1><br><h3>'%1'" "align=\"center\"><br><br><h1>The page could not be found</h1><br><h3>'%1'"
"</h3></div>"); "</h3></div>");
......
...@@ -85,9 +85,9 @@ public: ...@@ -85,9 +85,9 @@ public:
bool findText(const QString &text, Find::IFindSupport::FindFlags flags, bool findText(const QString &text, Find::IFindSupport::FindFlags flags,
bool incremental, bool fromSearch); bool incremental, bool fromSearch);
static QString DocPath; static const QString DocPath;
static QString AboutBlankPage; static const QString AboutBlankPage;
static QString PageNotFoundMessage; static const QString PageNotFoundMessage;
static bool isLocalUrl(const QUrl &url); static bool isLocalUrl(const QUrl &url);
static bool canOpenPage(const QString &url); static bool canOpenPage(const QString &url);
......
...@@ -133,9 +133,10 @@ QNetworkReply *HelpNetworkAccessManager::createRequest(Operation /*op*/, ...@@ -133,9 +133,10 @@ QNetworkReply *HelpNetworkAccessManager::createRequest(Operation /*op*/,
// the virtual folder // the virtual folder
if (!engine.findFile(url).isValid()) { if (!engine.findFile(url).isValid()) {
if (url.startsWith(HelpViewer::DocPath)) { if (url.startsWith(HelpViewer::DocPath)) {
if (!url.startsWith(HelpViewer::DocPath + "qdoc/")) { QUrl newUrl = request.url();
url = url.replace(HelpViewer::DocPath, if (!newUrl.path().startsWith(QLatin1String("/qdoc/"))) {
HelpViewer::DocPath + QLatin1String("qdoc/")); newUrl.setPath(QLatin1String("/qdoc/") + newUrl.path());
url = newUrl.toString();
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment