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