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

We need to check for http only.

parent 6875a50d
No related branches found
No related tags found
No related merge requests found
...@@ -144,20 +144,20 @@ QUrl HelpViewer::source() const ...@@ -144,20 +144,20 @@ QUrl HelpViewer::source() const
void HelpViewer::setSource(const QUrl &url) void HelpViewer::setSource(const QUrl &url)
{ {
const QString &scheme = url.scheme();
if (scheme != QLatin1String("qthelp") && scheme != QLatin1String("about")) {
QTextBrowser::setSource(resolvedUrl);
emit loadFinished(true);
return;
}
const QString &string = url.toString(); const QString &string = url.toString();
if (url.isValid() && string != QLatin1String("help")) { if (url.isValid() && string != QLatin1String("help")) {
if (launchWithExternalApp(url)) if (launchWithExternalApp(url))
return; return;
const QHelpEngineCore &engine = HelpManager::instance().helpEngineCore(); QUrl resolvedUrl;
const QUrl &resolvedUrl = engine.findFile(url); if (url.scheme() == QLatin1String("http"))
resolvedUrl = url;
if (!resolvedUrl.isValid()) {
const QHelpEngineCore &engine = LocalHelpManager::helpEngine();
resolvedUrl = engine.findFile(url);
}
if (resolvedUrl.isValid()) { if (resolvedUrl.isValid()) {
QTextBrowser::setSource(resolvedUrl); QTextBrowser::setSource(resolvedUrl);
emit loadFinished(true); emit loadFinished(true);
......
...@@ -124,9 +124,10 @@ HelpNetworkAccessManager::HelpNetworkAccessManager(QObject *parent) ...@@ -124,9 +124,10 @@ HelpNetworkAccessManager::HelpNetworkAccessManager(QObject *parent)
QNetworkReply *HelpNetworkAccessManager::createRequest(Operation op, QNetworkReply *HelpNetworkAccessManager::createRequest(Operation op,
const QNetworkRequest &request, QIODevice* outgoingData) const QNetworkRequest &request, QIODevice* outgoingData)
{ {
const QString &scheme = request.url().scheme(); if (!HelpViewer::isLocalUrl(request.url())
if (scheme != QLatin1String("qthelp") && scheme != QLatin1String("about")) && request.url().scheme() == QLatin1String("http")) {
return QNetworkAccessManager::createRequest(op, request, outgoingData); return QNetworkAccessManager::createRequest(op, request, outgoingData);
}
QString url = request.url().toString(); QString url = request.url().toString();
const QHelpEngineCore &engine = LocalHelpManager::helpEngine(); const QHelpEngineCore &engine = LocalHelpManager::helpEngine();
......
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